将代码输入Keil C51编译器,编译调试,观察寄存器和内存窗口:
立即寻址
org 00h
ajmp start
org 30h
start: mov 30h,#20h
mov a,30h
end
直接寻址
org 00h
ajmp start
org 30h
start: mov a,#30h
end
寄存器寻址
org 00h
ajmp start
org 30h
start: mov r0,#20h
mov a,r0
end
间接寻址
org 00h
ajmp start
org 30h
start: mov 30h,#20h
mov r0,#30h
mov a,@r0
end
位寻址
org 00h
ajmp start
org 30h
start: setb 20h
mov c,20h
clr c
end
变址寻址
org 00h
ajmp start
org 30h
start: mov a,#30h
mov dptr,#300h
movc a,@a+dptr
org 330h
db 20h
end
相对寻址
org 00h
setb c
ajmp start
org 100h
start: jc loop
org 160h
loop: nop
end
文章评论(0条评论)
登录后参与讨论