设有两个16位无符号数NA,NB分别存放在8051单片机内部RAM的40H、41H及50H、51H单元中.

2024-12-01 08:07:17
推荐回答(1个)
回答1:

子程序形式出现 : YCIT

ORG 1000H
YCIT: CJNE 40H,50H,LOP
CJNZ 41H,51H,LOP1
JMP LOP3 ; 相等
LOP: MOV A,40H
SUBB A,50H
JC LOP3 ; NA MOV 41H,#00H ;NA>NB
JMP NEXT
LOP1:MOV A,41H
SUBB A,51H
JC LOP3 ; NA MOV 41H,#00H ;NA>NB
JMP NEXT
LOP3: MOV 41H,#0FFH
NEXT: RET
END