一个MCU编译器自动生成的汇编代码(汇编宏),看不大懂啥意思,各位帮忙瞧瞧。
;--------------------------------------------------; GET_WORD MACRO
;--------------------------------------------------
; Parameters:
; None
; Register setup
; A = ROM Source Address MSB
; X = ROM Source Address LSB
MACRO GET_WORD
PUSH A ; Quickly get a RAM temp
PUSH A ; Save the source MSB
ROMX ; Get the first byte
PUSH X ; Save X
MOV X,SP ; Get SP, to index to the temp
MOV [X - 3],A ; Save the first byte
POP X ; Get back the source LSB
POP A ; And the MSB
INC X ; Point to the second byte
ADC A, 0 ;
ROMX ; Get the second byte
MOV X,A ; Save it in X
POP A ; And the first byte in A
ENDM
[ 本帖最后由 pengzi007 于 2011-11-3 16:07 编辑 ]