问题问
编写一个汇编程序,将程序本身可执行部分的第一个字节(用机器语言表示)或与 11110000(2) 存储在内存中的变量中。该程序应给出正确的结果,而与加载位置无关.
解决方案是
; Prepared for Metrowerks Codewarrior v3.
include preamble.inc ; Do not change this line.
;******************************************************************
;* Your main program instructions must immediately follow the *
;* label "ENTRY". This label must not be changed. *
;******************************************************************
; Data Declarations Follow:
org $0000
; Main Program :
org $0800
ENTRY:
START ldaa START ; A <== (M[START])
oraa #%11110000 ; A <== (A) OR %11110000
; Halt execution
swi
nop
; Subroutine Area Follows:
org $0A00
; Physical end of the program:
end
现在我的问题是,我不明白这是在做什么。例如,
START ldaa START
这个加载到累加器 a 中的是什么?它是加载数据START并用数据START调用地址START吗?此外,START如何加载到累加器a中?你可以在那里加载字符吗?
也不明白 OR 的目的。可能有一个重要的概念我应该选择这个,但我不知道那是什么
HC12 手册:http ://www.eng.uwo.ca/electrical/e-shop/micros/HC12%20CPU12%20Reference%20Manual.pdf