将下列程序代码手工编译为用十六进制数表示的机器码。(可查51指令码表)
BCD1 DATA 30H
BCD2 DATA 40H
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN: MOV A,BCD1
ADD A,BCD2
DA A
MOV BCD1,A
MOV A,BCD1+1
ADDC A,BCD2+1
DA A
MOV BCD1+1,A
SJMP $
END
麻烦大神编译一下,万分感谢!
5: LJMP MAIN
6: ORG 0030H
7: MAIN:
C:0x0000 020030 LJMP MAIN(C:0030)
C:0x0003 00 NOP
C:0x0004 00 NOP
C:0x0005 00 NOP
C:0x0006 00 NOP
C:0x0007 00 NOP
C:0x0008 00 NOP
C:0x0009 00 NOP
C:0x000A 00 NOP
C:0x000B 00 NOP
C:0x000C 00 NOP
C:0x000D 00 NOP
C:0x000E 00 NOP
C:0x000F 00 NOP
C:0x0010 00 NOP
C:0x0011 00 NOP
C:0x0012 00 NOP
C:0x0013 00 NOP
C:0x0014 00 NOP
C:0x0015 00 NOP
C:0x0016 00 NOP
C:0x0017 00 NOP
C:0x0018 00 NOP
C:0x0019 00 NOP
C:0x001A 00 NOP
C:0x001B 00 NOP
C:0x001C 00 NOP
C:0x001D 00 NOP
C:0x001E 00 NOP
C:0x001F 00 NOP
C:0x0020 00 NOP
C:0x0021 00 NOP
C:0x0022 00 NOP
C:0x0023 00 NOP
C:0x0024 00 NOP
C:0x0025 00 NOP
C:0x0026 00 NOP
C:0x0027 00 NOP
C:0x0028 00 NOP
C:0x0029 00 NOP
C:0x002A 00 NOP
C:0x002B 00 NOP
C:0x002C 00 NOP
C:0x002D 00 NOP
C:0x002E 00 NOP
C:0x002F 00 NOP
8: MOV A, BCD1
C:0x0030 E530 MOV A,0x30
9: ADD A, BCD2
C:0x0032 2540 ADD A,0x40
10: DA A
C:0x0034 D4 DA A
11: MOV BCD1, A
C:0x0035 F530 MOV 0x30,A
12: MOV A,BCD1 + 1
C:0x0037 E531 MOV A,0x31
13: ADDC A,BCD2 + 1
C:0x0039 3541 ADDC A,0x41
14: DA A
C:0x003B D4 DA A
15: MOV BCD1 + 1, A
C:0x003C F531 MOV 0x31,A
16: SJMP $
C:0x003E 80FE SJMP C:003E
C:0x0040 00 NOP追问
6: ORG 0030H
7: MAIN:
C:0x0000 020030 LJMP MAIN(C:0030)
C:0x0003 00 NOP
C:0x0004 00 NOP
C:0x0005 00 NOP
C:0x0006 00 NOP
C:0x0007 00 NOP
C:0x0008 00 NOP
C:0x0009 00 NOP
C:0x000A 00 NOP
C:0x000B 00 NOP
C:0x000C 00 NOP
C:0x000D 00 NOP
C:0x000E 00 NOP
C:0x000F 00 NOP
C:0x0010 00 NOP
C:0x0011 00 NOP
C:0x0012 00 NOP
C:0x0013 00 NOP
C:0x0014 00 NOP
C:0x0015 00 NOP
C:0x0016 00 NOP
C:0x0017 00 NOP
C:0x0018 00 NOP
C:0x0019 00 NOP
C:0x001A 00 NOP
C:0x001B 00 NOP
C:0x001C 00 NOP
C:0x001D 00 NOP
C:0x001E 00 NOP
C:0x001F 00 NOP
C:0x0020 00 NOP
C:0x0021 00 NOP
C:0x0022 00 NOP
C:0x0023 00 NOP
C:0x0024 00 NOP
C:0x0025 00 NOP
C:0x0026 00 NOP
C:0x0027 00 NOP
C:0x0028 00 NOP
C:0x0029 00 NOP
C:0x002A 00 NOP
C:0x002B 00 NOP
C:0x002C 00 NOP
C:0x002D 00 NOP
C:0x002E 00 NOP
C:0x002F 00 NOP
8: MOV A, BCD1
C:0x0030 E530 MOV A,0x30
9: ADD A, BCD2
C:0x0032 2540 ADD A,0x40
10: DA A
C:0x0034 D4 DA A
11: MOV BCD1, A
C:0x0035 F530 MOV 0x30,A
12: MOV A,BCD1 + 1
C:0x0037 E531 MOV A,0x31
13: ADDC A,BCD2 + 1
C:0x0039 3541 ADDC A,0x41
14: DA A
C:0x003B D4 DA A
15: MOV BCD1 + 1, A
C:0x003C F531 MOV 0x31,A
16: SJMP $
C:0x003E 80FE SJMP C:003E
C:0x0040 00 NOP追问
是不是每一条指令下面相对应的?
追答你给定的程序,经过编译,就是这样的结果。
答案,应该怎样写,应该看你的教材中的例题。
然后再从这些,挑出有用的,写在纸上,交给老师。
温馨提示:答案为网友推荐,仅供参考