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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? calc.asm

?? 實現簡單的計算器功能,方便又實用,簡單易懂,僅供參考
?? ASM
?? 第 1 頁 / 共 4 頁
字號:
		call initialize			; initialise the Keybuffer and the LCD dislay.	
		mov oldopcode,#00		
		mov opcounter,#00 		; Start back at zero operations performed.
		call bufferclear		; Clear the Keybuffer.
		mov decimalcnt,#00h
		jmp co_setflags

co_setflags:	mov pctopflag,#00h		; Set/Clear the appropriate flags.
		mov memopflag,#00h
		mov equalsflag,#00h
		mov arithopflag,#00h

co_done:	call resetsign			; Reset the sign to it's default state ( positive )
		mov status,#01h			; Status = 1 'cause it's an operator press.
		pop DPL				; Restore the Datapointer.
		pop DPH
		ret
		
;---------------------------------------------------------------------------------
;EQUALOP - Subroutine to handle the equals operation.
;---------------------------------------------------------------------------------
		
equalop:	push DPH			; Preserve the Datapointer.
		push DPL	       
		mov mode,#1			; DPTR addresses the Keybuffer.
		call getmode

		mov R5,equalsflag		; Check for repeat Equals presses.
		cjne R5,#1,eo_stattest
		jmp eo_multiple			; If repeated goto multiple.
		

eo_multiple:	call clearscreen		; Repeat Operations.
		mov mode,#3			; Use oldnumbuffer (holding last number)
		call inputnum			; Input the last number.
		mov mode,#1			; Address the Keybuffer.
		call getmode		
		call retrieveop			; Perform the operation and output.	
		mov R5,errorflag		; Test for errors.
		cjne R5,#1,eo_input1
		mov errorflag,#0		; Error found - don't input the number. Clear errorflag ( of no further use ).
		jmp eo_setflags		
eo_input1:	call inputnum			; No error so we can input the number safely.	
		jmp eo_setflags	

eo_stattest: 	mov R5,status
		cjne R5,#1,eo_single 		; If status = 1 goto single else test the operator flags.		

eo_pcttest:	mov R5,pctopflag		; If percentage op then treat the same as multiple press.
		cjne R5,#1,eo_memory
		jmp eo_multiple

eo_memory:	mov mode,#1			; If memory press adjust the bufferctr accordingly.
		mov R5,memcounter
		mov bufferctr,R5		; Run through to eo_single

eo_single:	mov digitcode,#0		; Single Equals.
		call storedigit			; Terminate the  ( second )number.
		mov mode,#1
		call inputnum			; Input the second (second )number. 
		mov copyfrom,#1			
		mov copyto,#3
		call buffercopy			; Copy the (second) number.
		call retrieveop			; Execute the operation and output the result.
				
		mov R5,errorflag
		cjne R5,#1,eo_input		; Test for errors.
		mov errorflag,#0		; Error found. Don't put result back on stack.
		jmp eo_setflags			; Clear the errorflag - we don't need it anymore.
eo_input:	call inputnum			; No error - put result back on stack and continue.	
		
eo_setflags:	mov equalsflag,#01h		; Set/Clear the appropriate flags.
		mov memopflag,#00h
		mov arithopflag,#00h
		mov pctopflag,#00h

eo_done:        call resetsign			; Reset the sign to it's default state ( positive ).
		mov status,#01h			; Operator press so Status = 1.
		pop DPL
		pop DPH				; Reatore the Datapointer.
		ret
		
		
;---------------------------------------------------------------------------------
;SIGNOP - Subroutine to change the sign of the number entered. This is a special case -
;         We treat this as a digit press and not as an operator press. This is a bit of a
;	  fudge to ensure that we get the proper visual output on the LCD screen after the next
;	  keypress ( Screen is cleared on a *op* - *digit* sequence which we don't want here ). 
;---------------------------------------------------------------------------------
signop:		mov mode,#1				; DPTR addresses the Keybuffer.
		call getmode
		
		mov R4,memopflag			
		cjne R4,#1,so_initialize		; Test for MRC press immediately prior to this.
		mov R4,memcounter			; MRC pressed so adjust the bufferctr accordingly.
		mov bufferctr,R4
		
so_initialize:	mov R2,signflag				; R2 holds the signflag
		mov R7,bufferctr			; Preserve the bufferctr in R7
		
so_toggle:	cjne R2,#0,so_negative			; If R2 = 0 then positive else negative
		mov R2,#1				; If positve change to negative
		jmp so_continue
so_negative:	mov R2,#0				; If negative change to positive
		
so_continue:	cjne R2,#0,so_enterneg
		mov digitcode,#020h			; If positive output a space.
		mov bufferctr,#00h			; Output in buffer position 0.
		call storedigit
		jmp so_status
		
so_enterneg:	mov digitcode,#02Dh			; If negative output a minus sign.
		mov bufferctr,#00h			; Output in buffer position zero.
		call storedigit
		
so_status:	mov R4,status				; If the status is one we need to change it to zero
		cjne R4,#1,so_complete			; for a correct visual display on the next keypress
		mov status,#0				; If status is zero we do not change anything.
 							
so_complete:	mov bufferctr,R7			; Restore the bufferctr.
		call bufferoutput			; Output the buffer to the LCD display.
		mov signflag,R2				; Set the signflag.
		ret
		
;---------------------------------------------------------------------------------
;PERCENTOP - Subroutine to work out the percentage.Arithmetically (num1*num2/100) is good for
;	     +,- ,* but we use (num1*100)/num2 to set up the divide case. Ordering the inputs on the 
;	     stack is important for the non - commutitive operators ( -,/).
;---------------------------------------------------------------------------------
percentop:	mov R4,memopflag			; Test for *num1* - *op* - *mrc* - *pct*
		cjne R4,#1,po_stattest	
		jmp po_continue

po_stattest:	mov R4,status				; Test for *num1* - *op* - *num2* -*pct*
		cjne R4,#1,po_continue					
		ret					; If *op* - *pct* do nothing.
po_continue:	mov R5,oldopcode
		cjne R5,#02Fh,po_standard		; Test for Divide Case. 		
		mov mode,#4				; Address the Hundred buffer
		call inputnum				; Input 100.		
		call floating_mul			; Gives us (num1 * 100).

		mov R5,memopflag
		cjne R5,#1,po_divok
		mov mode,#1
		mov R5,memcounter			; Adjust the bufferctr for memory buffer contents.
		mov bufferctr,R5
po_divok:	mov digitcode,#0			; Terminate the number.
		call storedigit
		mov mode,#1				; Address the Keybuffer.	
		call inputnum				; Input the number.
		call floating_div			; Divide.
		call floating_point_output		; Output in Keybuffer.
		call bufferoutput			; Output to LCD Display.
		call inputnum				; Put result back on the stack.
		jmp po_setflags				; End up with (num1*100) / num2.	
		
po_standard:	mov R5,memopflag
		cjne R5,#1,po_stok
		mov mode,#1	
		mov R4,memcounter			; Adjust the bufferctr as appropriate.	
		mov bufferctr,R4
		mov digitcode,#0			; Null terminate.
		call storedigit
		
po_stok:	mov mode,#1				; We can do this for the other 3 cases.
		call inputnum
		call floating_mul
		mov mode,#4
		call inputnum
		call floating_div			; We now have (num1*num2/100)
		

;Multiplication: We effectively have what we want from above. i.e (num1*num2/100 ).

		mov R5,oldopcode
		cjne R5,#02Ah,po_sub			; Test for Multiplication.
		mov mode,#1				; Address the Keybuffer.
		call getmode				
		call floating_point_output		; Output to the Keybuffer.
		call bufferoutput			; Output to the LCD display.
		mov digitcode,#0
		call storedigit				; Terminate.
		call inputnum				; Put result back on the stack.
		jmp po_setflags
		
; Subtraction:	We need to rearrange the numbers on the stack into the proper order before executing.
		
po_sub:		cjne R5,#02Dh,po_add			; Test for Subtraction.	
		mov mode,#1				; Address the Keybuffer.
		call getmode				
		call floating_point_output		; Output to the Keybuffer.
		mov mode,#3				; Address the oldnumbuffer.
		call inputnum				; Input the number 
		mov mode,#1				; Address the keybuffer.
		call inputnum				; Input the number.
		call retrieveop				; Execute the operation.
		call inputnum				; Input the result.
		jmp po_setflags
		
; Addition : Input the number from oldnumbuffer and execute.

po_add:		cjne R5,#02Bh,po_done			; Test for Addition.
		mov mode,#3				; Address the oldnumbuffer.
		call inputnum				; Input.
		mov mode,#1				; Address the Keybuffer.
		call getmode		
		call retrieveop				; Execute the operation and output.
		call inputnum				; Put the result back on the stack.
		jmp po_setflags
		
po_setflags:   	mov memopflag,#00h			; Set/Clear the appropriate flags.
		mov equalsflag,#00h
		mov arithopflag,#00h
		mov pctopflag,#01h
		
po_done:        mov status,#01h				; Set status as it's an operator press.
	        mov mode,#1
		call getmode				; Address the Keybuffer.
		ret
		
		
		
;============================================
;************ MEMORY OPERATORS **************
;============================================



		
;------------------------------------------------------------------------------
;MEMRECALL  - 1 press recalls the memory buffer - 2 consecutive presses clears
;	      the memory buffer.Memory Contents are stored in the MemoryBuffer. 				
;------------------------------------------------------------------------------

memrecall: 	mov R5,memocc			; Test for an empty buffer 
		cjne R5,#0,mr_validate		; If the memory buffer is empty and MRC is pressed
		mov mode,#2			; then initialise the buffer to zero and output to screen. 
		call getmode
		call bufferclear
		mov bufferctr,#00h
		mov digitcode,#030h
		call storedigit
		call bufferoutput
		jmp mr_setflags

mr_validate:	mov R5,memopflag
		cjne R5,#0,mr_consecutive	; test for two consecutive mrc presses.

		mov mode,#2			; Display the contents of the memorybuffer
		call getmode
		mov R4,memcounter		; Adjust the bufferctr.
		mov bufferctr,R4
		call bufferoutput		; Output to the LCD display.	
		
		mov mode ,#1			; Address the Keybuffer.
		call getmode			; Note that we do not input the number onto the stack here
		call bufferclear		; but rather copy it into the Keybuffer. The Stack handling operations 
		mov copyfrom,#2			; are handled inside the arithmetic op subroutine  or the percent subroutine
		mov copyto,#1			; which are the only cases where we might need this number on the stack.
		call buffercopy
		mov memopflag,#1		; Set the flag to indicate a MRC press. 
		jmp mr_setflags

mr_consecutive: mov mode,#2			; Consecutive MRC presses so clear the memorybuffer.
		call getmode
		call bufferclear
		mov status,#1
		call cancelop
		mov memopflag,#0		; Nothing in Memorybuffer so reset.
		mov memocc,#0			
		
mr_setflags:	mov equalsflag,#00h		; Clear opflags as appropriate.
		mov arithopflag,#00h
		mov pctopflag,#00h		


mr_done:	mov mode,#1			; Address the Keybuffer
		call getmode
		mov bufferctr,#00h		; Clear the Bufferctr.
		mov status,#1			; Operator press so set Status = 1.
		ret


;---------------------------------------------------------------------------------
;MEMPLUS - Subroutine to add the entered number to the value in the memory buffer.
;---------------------------------------------------------------------------------
memplus: 	mov mode,#2			; Address the MemoryBuffer as we are as performing 
		call getmode			; addition on it's contents.	
		
		call inputnum			; Input the contents of the memorybuffer (num1)
		call bufferclear
		
		mov mode,#1			; Input the number entered thru keypad  (num2)	
		call inputnum
		call bufferclear		; Clear the Keybuffer

		call floating_add		; Perform num1+num2 and output to memorybuffer
		mov mode,#2			; Address Memorybuffer.
		call getmode	
		call floating_point_output	
		mov R3,bufferctr
		mov memcounter,R3		; Take the length of the outputed number and put in memcounter.
		
		mov memocc,#1			; Indicate that a number is now in the memorybuffer. 
		
		mov mode ,#1			; Copy the result back into the keybuffer and display.
		call getmode
		call bufferclear			
		mov copyfrom,#2
		mov copyto,#1
		call buffercopy
		call bufferoutput				

mp_setflags:	mov memopflag,#00h		; Clear the appropriate flags.
		mov equalsflag,#00h
		mov arithopflag,#00h
		mov pctopflag,#00h	

mp_done:	mov status,#1			; Operator press so set Status = 1.
		ret	

;--------------------------------------------------------------------------------------
;MEMSUB - Subroutine to subtract the entered number from the value in the memorybuffer.
;---------------------------------------------------------------------------------------

memsub: 	mov mode,#2			
		call inputnum			;Input the contents of the memorybuffer (num1)
		call bufferclear		
		
		mov mode,#1			; Input the number entered thru keypad  (num2)	
		call inputnum
		call bufferclear

		call floating_sub		; Perform  num1 - num2		
		mov mode,#2
		call getmode
		call floating_point_output	
		mov R3,bufferctr
		mov memcounter,R3
		
		mov memocc,#1			; Indicate that a number is now in the memorybuffer. 
		
		mov mode ,#1			; Copy the result back into the keybuffer and display.
		call getmode			
		mov copyfrom,#2
		mov copyto,#1
		call bufferclear
		call buffercopy
		call bufferoutput				

ms_setflags:	mov memopflag,#00h
		mov equalsflag,#00h
		mov arithopflag,#00h
		mov pctopflag,#00h

ms_done:	mov status,#1
		ret	


;======================================
;******* UTILITY FUNCTIONS ************
;======================================

;---------------------------------------------------------------------------------
;STOREDIGIT - Subroutine to store a digit. DPTR addresses the KEYBUFFER.
;---------------------------------------------------------------------------------
storedigit:	call getmode	
		push DPH
		push DPL
		mov R5,bufferctr		; move the buffercounter into R5
		
		mov R4,mode			; If we are going into the errorbuffer we allow 25 digits
		cjne R4,#6,sd_entry		; This allows accurate comparison for bounds checking.
		cjne R5,#24,sd_test0
		jmp sd_continue
sd_test0:	jc sd_continue
		jmp sd_done

sd_entry:	cjne R5,#8,sd_test		; test to be sure that a maximum of 8 digits go in the buffer (sign + 8)
		jmp sd_decimal  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠网亚洲精品| 麻豆极品一区二区三区| 国产又黄又大久久| 91福利视频在线| 国产欧美综合在线观看第十页 | 91成人国产精品| 久久久久久久久久久电影| 天天亚洲美女在线视频| 色综合视频在线观看| 国产视频视频一区| 九九精品一区二区| 欧美精选午夜久久久乱码6080| 国产精品国产成人国产三级| 国产成人自拍网| 日韩三级高清在线| 五月天激情小说综合| 色哟哟一区二区在线观看| 国产精品久久久久久久午夜片 | 亚洲精品乱码久久久久久| 国产剧情一区二区| 日韩午夜av电影| 天堂在线亚洲视频| 欧美色精品在线视频| 亚洲免费av高清| av电影在线观看完整版一区二区| 久久久五月婷婷| 精品亚洲aⅴ乱码一区二区三区| 欧美精品在线观看一区二区| 亚洲伊人色欲综合网| 91国偷自产一区二区三区观看 | 欧美一区午夜视频在线观看 | 国产精品水嫩水嫩| 国产精品亚洲一区二区三区在线 | 在线播放亚洲一区| 天天影视色香欲综合网老头| 欧美精品在线视频| 日韩黄色在线观看| 欧美一区二区三区日韩视频| 石原莉奈一区二区三区在线观看| 欧美日韩一区二区欧美激情| 亚洲第一二三四区| 欧美日韩mp4| 亚洲国产wwwccc36天堂| 欧美日韩成人在线| 日韩高清在线不卡| 日韩三级免费观看| 国产一区二区电影| 国产精品日日摸夜夜摸av| 成人av网站在线| 亚洲视频在线一区观看| 色噜噜狠狠色综合欧洲selulu| 亚洲男同性视频| 欧美专区亚洲专区| 日韩**一区毛片| 欧美xxxxxxxx| 国产成人在线视频播放| 亚洲欧洲美洲综合色网| 色妹子一区二区| 午夜国产不卡在线观看视频| 91精品国产综合久久久蜜臀粉嫩| 久久99在线观看| 久久精品夜色噜噜亚洲aⅴ| 成人午夜激情在线| 亚洲欧美aⅴ...| 欧美日韩一本到| 久久精品国产免费看久久精品| 久久美女高清视频 | 毛片基地黄久久久久久天堂| www一区二区| 成人av在线网| 亚洲一级二级三级在线免费观看| 欧美精品xxxxbbbb| 国产一区福利在线| 综合色天天鬼久久鬼色| 欧美高清激情brazzers| 国产综合久久久久影院| 中文字幕一区二区三区在线播放| 欧美综合在线视频| 久久国内精品自在自线400部| 欧美国产精品v| 在线观看日韩毛片| 精品在线免费视频| 亚洲视频资源在线| 日韩欧美一区中文| av电影在线观看完整版一区二区| 亚洲成av人片在线观看| 久久久久久久久免费| 欧洲另类一二三四区| 国内偷窥港台综合视频在线播放| 1024成人网色www| 欧美成人伊人久久综合网| 96av麻豆蜜桃一区二区| 免费三级欧美电影| 中文字幕亚洲区| 日韩丝袜情趣美女图片| 91在线播放网址| 美女视频黄久久| 亚洲美女淫视频| 久久综合久久综合久久综合| 色偷偷88欧美精品久久久| 精品伊人久久久久7777人| 亚洲美女区一区| 久久毛片高清国产| 欧美久久高跟鞋激| 91在线高清观看| 国产精选一区二区三区| 亚洲v精品v日韩v欧美v专区| 国产清纯美女被跳蛋高潮一区二区久久w| 精品亚洲成a人| 亚洲午夜日本在线观看| 欧美国产丝袜视频| 欧美一区二区三区爱爱| 色呦呦网站一区| 丰满白嫩尤物一区二区| 欧美aaa在线| 亚洲午夜成aⅴ人片| 国产精品久久久久久久蜜臀| 精品99一区二区| 欧美日韩国产大片| 色国产综合视频| 成人免费看的视频| 国内精品免费**视频| 五月天中文字幕一区二区| 亚洲精品视频在线看| 国产欧美精品日韩区二区麻豆天美| 3d成人动漫网站| 欧美亚洲一区二区三区四区| 成人av网站在线观看免费| 国产一区 二区| 久久精品国产亚洲高清剧情介绍 | 蜜臀av国产精品久久久久| 一区二区三区四区乱视频| 欧美国产禁国产网站cc| 精品福利在线导航| 欧美一区二区精品在线| 欧美人与性动xxxx| 欧美午夜影院一区| 色婷婷激情久久| av激情亚洲男人天堂| 处破女av一区二区| 欧美国产日韩a欧美在线观看| 欧美一级精品在线| 5566中文字幕一区二区电影| 欧美性一二三区| 欧美亚洲另类激情小说| 色婷婷国产精品久久包臀| 一本久久精品一区二区| 91网页版在线| 色呦呦国产精品| 在线观看日韩精品| 欧美揉bbbbb揉bbbbb| 欧美午夜精品理论片a级按摩| 91福利资源站| 欧美视频一区二区在线观看| 欧美在线三级电影| 欧美网站一区二区| 欧美三级一区二区| 欧美美女视频在线观看| 欧美精品乱码久久久久久按摩| 欧美日韩国产高清一区二区三区 | 欧美精品1区2区3区| 91精品国产一区二区三区| 69av一区二区三区| 日韩午夜激情av| 久久久亚洲国产美女国产盗摄| 国产午夜亚洲精品不卡| 欧美激情一区在线| 国产精品超碰97尤物18| 亚洲男人电影天堂| 亚洲午夜激情网站| 蜜桃精品视频在线| 韩国一区二区在线观看| 国产精品亚洲综合一区在线观看| 成人av资源站| 欧美性生活一区| 日韩国产高清在线| 韩国女主播成人在线观看| 国产成人免费视频网站| 99国产精品久久久久久久久久久| 91福利视频久久久久| 欧美另类一区二区三区| 欧美v亚洲v综合ⅴ国产v| 中文字幕高清一区| 亚洲综合精品自拍| 蜜桃精品在线观看| 成人久久视频在线观看| 色哦色哦哦色天天综合| 欧美一区二区私人影院日本| 久久久噜噜噜久久人人看 | 国产视频911| 亚洲色欲色欲www| 日韩av一区二| 国产成人av电影在线观看| 一本一本久久a久久精品综合麻豆| 欧美精品v日韩精品v韩国精品v| 久久麻豆一区二区| 一区二区三区四区不卡视频| 美女视频黄免费的久久| 波多野洁衣一区| 91麻豆精品国产91久久久久久久久 |