汇编语言问题求解
时间:10-02
整理:3721RD
点击:
; void XC8L_BankWrite(unsigned char RAMAddr)
RSEG ?PR?_XC8L_BankWrite?FLASH(有疑问的地方-开始)
_XC8L_BankWrite:
USING 0
MOV DPTR,#RAMAddr?140
MOV A,R7
MOVX @DPTR,A(有疑问的地方-结束)
// RAMAddr is in R7 of current bank
; #pragma asm
; // set the target Flash address to program in DPH and DPL
; MOV A,#FlashProAddress_High
MOV A,#(0xaf00 >> 8)
; MOV DPH,A
MOV DPH,A
; MOV A,#FlashProAddress_Low // the DPL will = DPL+0x20 after one successful program
MOV A,#(0xaf00 & 0xff)
; MOV DPL,A
MOV DPL,A
; MOV B,R7 // use B to transfer the data between bank
MOV B,R7
; //switch to bank 3
; PUSH PSW
PUSH PSW
; MOV A,#0x18
MOV A,#0x18
; ORL PSW,A
ORL PSW,A
; MOV R0,B // the start address is passed through B
MOV R0,B
; MOV SCU_PAGE, #0x00
MOV SCU_PAGE, #0x00
; // clear all the NMI Flags
; MOV NMISR,#0x00
MOV NMISR,#0x00
; // call the program routine
; LCALL FLASH_PROG
LCALL 0xDFF6
; POP PSW // return to orignal bank
POP PSW
; #pragma endasm
;
; }
; SOURCE LINE # 92
RET
; END OF _XC8L_BankWrite
请问该程序开始处的6.7句分别什么意思?实现什么功能?
再问下语句中问号?有什么用法?
RSEG ?PR?_XC8L_BankWrite?FLASH(有疑问的地方-开始)
_XC8L_BankWrite:
USING 0
MOV DPTR,#RAMAddr?140
MOV A,R7
MOVX @DPTR,A(有疑问的地方-结束)
// RAMAddr is in R7 of current bank
; #pragma asm
; // set the target Flash address to program in DPH and DPL
; MOV A,#FlashProAddress_High
MOV A,#(0xaf00 >> 8)
; MOV DPH,A
MOV DPH,A
; MOV A,#FlashProAddress_Low // the DPL will = DPL+0x20 after one successful program
MOV A,#(0xaf00 & 0xff)
; MOV DPL,A
MOV DPL,A
; MOV B,R7 // use B to transfer the data between bank
MOV B,R7
; //switch to bank 3
; PUSH PSW
PUSH PSW
; MOV A,#0x18
MOV A,#0x18
; ORL PSW,A
ORL PSW,A
; MOV R0,B // the start address is passed through B
MOV R0,B
; MOV SCU_PAGE, #0x00
MOV SCU_PAGE, #0x00
; // clear all the NMI Flags
; MOV NMISR,#0x00
MOV NMISR,#0x00
; // call the program routine
; LCALL FLASH_PROG
LCALL 0xDFF6
; POP PSW // return to orignal bank
POP PSW
; #pragma endasm
;
; }
; SOURCE LINE # 92
RET
; END OF _XC8L_BankWrite
请问该程序开始处的6.7句分别什么意思?实现什么功能?
再问下语句中问号?有什么用法?