亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? calc.asm

?? 基于8051系列單片機(jī)的計(jì)算器源代碼程序!
?? ASM
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
sd_test:	jc sd_decimal   
		
		
sd_decimal:	mov R4,digitcode		; Test for decimal points - only  allow one per number to be inputed.
		cjne R4,#02Eh,sd_continue
		inc decimalcnt			; We need to see whether this is the first decimal point to be inputed in this number.
		mov R3,decimalcnt		; This will be reset in the inputnum subroutine when we are finished with the number.
		cjne R3,#1,sd_done		; It is a decimal point and it is not the first so don't store it.
						; Fall through to sd_continue if it is the first decimal point.				
sd_continue:	cjne R5,#0,sd_loop		; If it is zero goto write
		jmp sd_write			;

sd_loop:	inc DPTR	
		djnz R5,sd_loop			; increment DPTR to DPTR + bufferctr
		
sd_write:	mov A,digitcode
		movx @DPTR,A			; Write the digit into the Buffer
		inc bufferctr			; we write digits from bufferctr pos 1 - 8.
						; Buffer position 0 is reserved for the sign.
			
sd_done:	pop DPL
		pop DPH
	        ret
;---------------------------------------------------------------------------------
;STATUSCHECK - Subroutine to test if this is the first key pressed after an operation
;	       and if so to clear the screen.	
;---------------------------------------------------------------------------------
statuscheck:	mov R2,status			
		cjne R2,#1,sc_done		
		mov R2,equalsflag
		cjne R2,#1,sc_clear

		mov R4,digitcode		; This caters for num - op - num - equ - num. A number after an equals 
		mov local, R4			; signifies a new calculation.
		mov mode,#3
		call getmode
		call floating_point_output
		call bufferclear
		mov opcounter,#0
		mov bufferctr,#00h
		mov digitcode,#020h
		call storedigit
		mov R4,local
		mov digitcode,R4
		mov mode,#1
		call getmode
		mov decimalcnt,#00h
sc_clear:	mov status,#00h		
			
				
sc_setflags:	mov memopflag,#00h
		mov equalsflag,#00h
		mov arithopflag,#00h
		mov pctopflag,#00h
sc_done:	ret				; clear status to indicate that a digit key has been pressed.
;---------------------------------------------------------------------------------
;BUFFEROUTPUT - Subroutine to write the keybuffer onto the screen.
;---------------------------------------------------------------------------------
bufferoutput:	push DPH			; preserve the Datapointer
		push DPL
		
		call clearscreen		; clears the screen and sets the LCD address to the far right.
		call getmode			; point at the keybuffer
		mov R3,bufferctr     		; We know the length of the number from the bufferctr
		mov bufferctr,#0
		mov R5,#0

bo_start:	mov R7,bufferctr
		clr A
bo_output:	movx A,@DPTR			; read the digit into A
		;cjne A,#02Eh,bo_write		; if a decimal point don't count that as one of the 8 output chars.
		;dec R5
		;jmp bo_write

bo_write:	call wrdata			; write out the digit.				
		
bo_test:	clr c				; need to clear the carry before the subb instruction.
		mov  A,R3			; test for the end of the string.
		subb A,R7
		mov R7,A			
		clr A
	        cjne R7,#01h,bo_test2		
		jmp bo_sign

		
bo_test2:   	cjne R5,#8,bo_test3
		jmp bo_increment			
bo_test3:	jc bo_increment
		jmp bo_sign

bo_increment:	inc bufferctr
		inc R5
		inc DPTR
		jmp bo_start
		
bo_sign:	mov R4,memocc
		cjne R4,#1,bo_done
		mov A,R3			; Draws the 'M' on the far left when there is a number
		add A,#LCD_SETDDADDR + 1	; in the memory buffer. We need to offset by the amount of the
		call wrcmd			; buffercounter because of the *shift* mode we have the LCD display
		mov A,#04Dh			; set up in.
		call wrdata

bo_done:	mov bufferctr,R3
		pop DPL
		pop DPH
		ret
;---------------------------------------------------------------------------------
;BUFFERCLEAR - Subroutine to clear the keybuffer.
;---------------------------------------------------------------------------------
bufferclear:	push DPH
		push DPL
		call getmode
		mov R2,#9			; Clear the buffer.
		mov A,#0					
bc_loop:	movx @DPTR,A			; Write a zero into the buffer position addressed by DPTR
		inc DPTR			; move the Datapointer along the databuffer. 
		djnz R2,bc_loop			; loop through the bufferlength		
		pop DPL
		pop DPH
		ret
;---------------------------------------------------------------------------------
;CLEARSCREEN - Subroutine to clear the screen and set the writing to the RHS.
;---------------------------------------------------------------------------------
clearscreen:	mov A,#LCD_CLS
		call wrcmd
		mov R4,memocc			; We need to account for the extra digit outputed ( 'M' ) when
		cjne R4,#1,cs_standard		; there is a number in memory. Due to the mode that we have set the 
		mov A,#LCD_SETDDADDR + 16	; display in (i.e. shifts display left) we need ddaddress set one further  
		call wrcmd			; right in this case.
		jmp cs_done
cs_standard:	mov A,#LCD_SETDDADDR + 15	; Standard case when nothing is in memory (output number only ) 
		call wrcmd
cs_done:	ret
;---------------------------------------------------------------------------------
;BUFFERCOPY - Subroutine to copy the keybuffer contents into  oldnumbuffer.
;---------------------------------------------------------------------------------
buffercopy:	push DPH			; Preserve the DataPointer
		push DPL
		mov R7,bufferctr		; Preserve the Bufferctr
		mov bufferctr,#00h
		mov R2,#8			; Set the counter to the buffer size

bc_transfer:	
		mov R5,bufferctr

		mov R6,copyfrom			; Get the copy info. 
		mov mode,R6			; ( set to a mode depending on which buffer we wish to access )
		call getmode			

		cjne R5,#0,bc_address1
		jmp bc_readin

bc_address1:	inc DPTR
		djnz R5,bc_address1

bc_readin:	movx A,@DPTR

		;cjne A,#020h,bc_continue
		;jmp bc_increment

bc_continue:	mov R6,copyto
		mov mode,R6
		call getmode

		mov R5,bufferctr
		cjne R5,#0,bc_address2
		jmp bc_writeout
bc_address2:	inc DPTR
		djnz R5,bc_address2

bc_writeout:	movx @DPTR,A 

bc_increment:	inc bufferctr			; loop through the Buffersize .
		djnz R2,bc_transfer
		
		mov bufferctr,R7		; Restore Bufferctr
		mov mode,#1
bc_done:        pop DPL
		pop DPH
		ret
;---------------------------------------------------------------------------------
;INPUTNUM - Subroutine to push the number onto the stack.
;---------------------------------------------------------------------------------
inputnum:	call getmode			; move the DPTR back to the beginning of the appropriate buffer
		call floating_point_input	; move the contents of the keybuffer onto the floating point stack	
		mov bufferctr,#00h		; move the buffercounter back to zero ready for the next operation
		mov decimalcnt,#00h		; Reset the decimal point counter for the next number.
		ret
;---------------------------------------------------------------------------------
;INITIALIZE - Subroutine to initialize the calc on startup.
;---------------------------------------------------------------------------------
initialize: 	mov mode,#1			; set the mode to default ( DPTR, points at the KEYBUFFER )
		call getmode			; Set the DPTR to address the appropriate buffer.
		call bufferclear
		mov bufferctr,#00h
		mov digitcode,#020h		; initialise with a space in position 0 to indicate a positive number.
		call storedigit
	
		mov signflag,#0
		mov status,#1			; start with status = 1 so if an op is pressed first 0 becomes the first no
						; on the stack - if a digit is pressed first the zero is trashed.
		call clearscreen		; sets the ddaddress to be at  the RHS
		mov digitcode,#30h		; start with 0 on the screen
		call storedigit
		call bufferoutput
		mov R4,bufferctr
		dec R4
		mov bufferctr,R4
		
		ret				
;---------------------------------------------------------------------------------
;RESETSIGN - Subroutine to ensure that every number starts as being positive.
;---------------------------------------------------------------------------------
resetsign:	call getmode			; point at the buffer to clear.
		call bufferclear
		
		mov bufferctr,#00h		; Clear the signfrom the buffer and set the buffer position.
		mov digitcode,#020h		; StoreDigit increments the buffer position *AFTER* storage.
		call storedigit			; This leaves us with position 0 clear and bufferctr set to 1.
		mov signflag,#00h
rs_done:	ret
;----------------------------------------------------------------------------------------------
;GETMODE - Subroutine to point the Datapointer at the required buffer - dependant on the mode.
;----------------------------------------------------------------------------------------------
getmode:	mov R4,mode
		cjne R4,#1,gm_memory
		mov DPTR,#KEYBUFFER
		jmp gm_done

gm_memory:	cjne R4,#2,gm_oldnum
		mov DPTR,#MEMORYBUFFER
		jmp gm_done

gm_oldnum:	cjne R4,#3,gm_const
		mov DPTR,#OLDNUMBUFFER
		jmp gm_done

gm_const:	cjne R4,#4,gm_bounds
		mov DPTR,#HUNDREDBUFF
		jmp gm_done
gm_bounds:	cjne R4,#5,gm_temp
		mov DPTR,#BOUNDBUFFER
		jmp gm_done
gm_temp:	cjne R4,#6,gm_done
		mov DPTR,#TEMPBUFFER			
gm_done:	ret

;----------------------------------------------------------------------------------------------
;BOUNDSBUFFER- Generate a buffer with the maximum permissable value i.e 99999999
;----------------------------------------------------------------------------------------------

boundsbuffer:	push DPH
		push DPL
		mov mode,#5
		mov R3,bufferctr		; Preserve the bufferctr.
		mov bufferctr,#0
		mov digitcode,#020h
		call storedigit			
bb_loop:	mov digitcode,#039h		; Enter  digit 9.
		call storedigit
		mov  R4,bufferctr
		cjne R4,#9, bb_loop
		mov digitcode,#0
		call storedigit
		mov bufferctr,R3
		
bb_done:	pop DPL
		pop DPH
		ret


;----------------------------------------------------------------------------------------------
;ERRORCHECK - Checks the upper and lower bounds and divide by zero. 
;----------------------------------------------------------------------------------------------

errorcheck:	jb ACC.3,ec_divide		; Result is on the stack.
		mov errorflag,#01h		; We set the error flag here and clear it if appropriate later.
		mov mode,#6			; output and then input result
		call getmode
		mov bufferctr,#0
		call floating_point_output
		call inputnum

		mov mode,#5
		mov bufferctr,#0
		mov digitcode,#020h
		call storedigit
		call inputnum			; input the UBound on the stack
		clr c
		call floating_comp		; Call floating_compare ( pops twice and returns status ).
		jc ec_lower			; Carry set so less than Ubound
		jmp ec_upperr			; Otherwise error - result too large.
		
ec_lower:	mov mode,#6
		call inputnum			; input result
		
		mov mode,#5			; make the max number negative ( i.e. the lower bound )
		mov bufferctr,#0
		mov digitcode,#02Dh
		call storedigit
		mov mode,#5
		call inputnum			; input the lower bound.	

		clr c
		call floating_comp
		jc ec_lowerr			; Error - result too low
		
		jmp ec_ok			; Greater than lower bound so o.k.

ec_divide:	call clearscreen
		mov DPTR,#errorstr		; Error message.
		call wrstr
		mov DPTR,#500
		call wtms
		mov mode,#6
		call inputnum			; input result.
		mov mode,#1
		call getmode
		mov status,#1
		jmp ec_done

ec_upperr:	call clearscreen
		mov DPTR,#errorstr		; Error message.
		call wrstr
		mov DPTR,#500
		call wtms
		mov mode,#6
		call inputnum			; input result.
		mov mode,#1
		call getmode
		mov status,#1
		jmp ec_done

ec_lowerr:	call clearscreen
		mov DPTR,#errorstr		; Error Message
		call wrstr
		mov DPTR,#500
		call wtms
		mov mode,#6
		call inputnum			; input result.
		mov mode,#1
		call getmode
		mov status,#1
		jmp ec_done


ec_ok:		mov mode,#6
		call inputnum			; input result.
		mov errorflag,#00h
	
ec_done:	mov mode,#6
		call getmode
		call bufferclear
		mov mode,#1
		call getmode
		ret


;----------------------------------------------------------------------------------------------
;BANNER - Exports a wraparound banner to the LCD screen. 
;----------------------------------------------------------------------------------------------

Banner:		
	
		call clearscreen
		mov A,#LCD_SETDDADDR+16		; Start at right hand side of the display
		call wrcmd
		
Reloop:		mov DPTR,#STRING1        			
                
Iterate:	call wrstr

		mov DPTR,#1000
		call wtms
	
		call clearscreen
		ret

END

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩激情一区| 成人精品视频一区二区三区尤物| 激情综合网最新| 国产精品中文有码| 色网综合在线观看| 日韩欧美成人激情| 国产精品福利av| 丝袜亚洲另类欧美综合| 国产成人综合亚洲网站| 欧洲一区在线观看| 欧美bbbbb| 风间由美一区二区三区在线观看| 91久久精品一区二区| 精品国产电影一区二区| 中文字幕亚洲成人| 久久国产精品色婷婷| 成人h精品动漫一区二区三区| 欧美日韩一区精品| 国产日韩欧美不卡| 天堂va蜜桃一区二区三区 | 7777精品伊人久久久大香线蕉的| 久久新电视剧免费观看| 亚洲一区二区三区视频在线播放 | 精品国产91乱码一区二区三区| 国产精品久久午夜夜伦鲁鲁| 午夜精品免费在线观看| 成人午夜大片免费观看| 日韩久久免费av| 亚洲一区在线播放| fc2成人免费人成在线观看播放 | 国模一区二区三区白浆| 91黄色激情网站| 中文字幕免费不卡在线| 美女一区二区三区在线观看| 色美美综合视频| 国产欧美精品国产国产专区| 日本美女一区二区三区视频| 色综合久久久久综合99| 国产性做久久久久久| 久久精品国产秦先生| 欧美视频精品在线观看| 亚洲男人天堂av网| bt7086福利一区国产| 久久精品在这里| 捆绑调教一区二区三区| 欧美日韩黄视频| 亚洲午夜精品17c| 91视频国产观看| 中文字幕一区二区三区视频 | 中文一区一区三区高中清不卡| 日本成人中文字幕| 在线不卡中文字幕| 亚洲一二三四久久| 色噜噜狠狠成人网p站| 国产精品久久久久久妇女6080| 国产美女av一区二区三区| 日韩欧美一区中文| 日本强好片久久久久久aaa| 欧美日韩一区二区三区免费看| 亚洲精品国产一区二区三区四区在线| 成人自拍视频在线观看| 久久精品一区四区| 国产一区二区三区香蕉| 欧美精品一区二区在线观看| 久久精品国产久精国产爱| 日韩av中文字幕一区二区三区| 欧美视频一区在线观看| 一区二区免费在线| 欧美亚洲国产怡红院影院| 亚洲一区二区三区小说| 欧美色倩网站大全免费| 亚洲第一狼人社区| 欧美日韩精品一区视频| 爽好多水快深点欧美视频| 欧美一三区三区四区免费在线看| 丝袜亚洲另类欧美| 欧美一区二区女人| 久久国产综合精品| 国产日韩欧美综合在线| 99精品久久久久久| 一区二区三区在线影院| 欧美日韩国产高清一区二区 | 日韩免费观看2025年上映的电影| 琪琪一区二区三区| 久久久久久夜精品精品免费| 大胆亚洲人体视频| 亚洲女性喷水在线观看一区| 在线一区二区三区四区| 丝袜美腿高跟呻吟高潮一区| 日韩美一区二区三区| 国产成人a级片| 成人欧美一区二区三区小说 | 日韩国产欧美在线播放| 欧美tickling网站挠脚心| 国产一区久久久| 国产精品国产成人国产三级| 99在线热播精品免费| 亚洲一区在线视频观看| 日韩免费观看高清完整版在线观看| 黄一区二区三区| 亚洲特级片在线| 欧美精选一区二区| 韩国理伦片一区二区三区在线播放 | 最近日韩中文字幕| 欧美日韩一级视频| 精品一区二区免费| 1024成人网| 日韩网站在线看片你懂的| 床上的激情91.| 亚洲一区二区三区视频在线播放| 日韩一区二区三区视频在线| 国产成人一区二区精品非洲| 亚洲综合在线视频| 国产乱理伦片在线观看夜一区| 国产精品免费aⅴ片在线观看| 在线精品视频小说1| 麻豆一区二区在线| 亚洲视频一区二区免费在线观看| 欧美四级电影在线观看| 国产一区二区精品久久99| 夜夜操天天操亚洲| 久久欧美中文字幕| 精品视频一区二区三区免费| 国产乱码精品一区二区三区av| 亚洲激情图片小说视频| 26uuuu精品一区二区| 在线看一区二区| 国产suv一区二区三区88区| 亚洲h动漫在线| 国产精品午夜春色av| 在线不卡a资源高清| 99麻豆久久久国产精品免费| 久久精工是国产品牌吗| 亚洲激情在线播放| 国产欧美日韩视频一区二区| 欧美伦理影视网| 成人h动漫精品一区二| 美女国产一区二区| 亚洲一区二区偷拍精品| 中文av一区二区| 日韩一级片网址| 色婷婷精品久久二区二区蜜臂av| 国产一区二区美女| 免费看欧美美女黄的网站| 一区二区三区欧美视频| 欧美国产97人人爽人人喊| 日韩美女视频在线| 337p亚洲精品色噜噜噜| 91偷拍与自偷拍精品| 精品国产一区二区三区不卡| 欧美日韩视频在线一区二区| 95精品视频在线| 国产成人av影院| 美女www一区二区| 亚洲不卡在线观看| 一区二区三区在线免费视频| 中文字幕免费不卡| 国产三级一区二区| 欧美成人激情免费网| 在线91免费看| 欧美无乱码久久久免费午夜一区| 91免费视频观看| 成人黄色小视频在线观看| 国产老肥熟一区二区三区| 蜜臀精品久久久久久蜜臀| 午夜电影网一区| 亚洲大片一区二区三区| 亚洲午夜久久久久久久久久久| 亚洲狼人国产精品| 亚洲久草在线视频| 亚洲免费毛片网站| 亚洲男人天堂av网| 亚洲精品乱码久久久久久久久| 中文字幕亚洲一区二区va在线| 国产精品色一区二区三区| 国产网站一区二区| 久久免费美女视频| 国产日韩精品一区| 欧美韩日一区二区三区| 国产午夜亚洲精品羞羞网站| 久久久久久久综合色一本| 久久夜色精品国产噜噜av| 久久免费视频一区| 欧美国产精品专区| 国产精品国产三级国产专播品爱网 | 日韩av不卡在线观看| 日本女优在线视频一区二区| 日韩av一区二区三区四区| 美国三级日本三级久久99 | 欧美经典三级视频一区二区三区| 国产亚洲一本大道中文在线| 国产喂奶挤奶一区二区三区| 国产精品久久久久aaaa樱花| 亚洲四区在线观看| 亚洲一级电影视频| 免费日韩伦理电影| 国产精品自拍一区| 99久久久免费精品国产一区二区| 色婷婷激情综合| 91精选在线观看|