用于在8085微处理器中从键盘输入2个数字的程序
我们使用键盘上的两个2位十六进制数字编写了一个8085汇编语言程序,该程序有两个输入,然后在地址字段中相加并输出结果。
FILE NAME ADD2NUM.ASM ORG C000H CURAD: EQU FFF7H UPDAD: EQU 06BCH CLEAR: EQU 044AH GTHEX: EQU 052FH MVI A, 0EH SIM EI ; Unmask RST5.5 and enable interrupts MVI B, 01 CALL GTHEX ; Input a 2 digit number and display in data field MOV A, E STA C100H ; Store the 2-digit hex number in C100H MVI B, 01 CALL GTHEX ; Input a 2 digit number and display in data field LDA C100H ADD E STA CURAD ; Add the two numbers and store in CURAD JNC SKIP MVI A, 01 STA CURAD+1 ; If Carry =1, store 1 in CURAD+1 SKIP: CALL CLEAR ; Blank the entire display CALL UPDAD ; Display sum in address field. HLT