需要帮助调试,当汇编代码进入我的子程序时,它会打印出寄存器 B 的值而不是寄存器 A 的值。非常感谢任何帮助。
dc.b "Type a character"
dc.b 0 ; using zero terminated strings
LDS #ROMStart ; load stack pointer
JSR TermInit ; needed for Simulator only
LOOP
LDD #PROMPT ; pass the adr of the string
JSR printf ; print the string
JSR getchar ; call getchar function -result is: character in B
JSR putchar
CMPB ‘W’ ;COMPARE USER INPUT TO W
BNE LOOP ;
JSR WFCN
-------------------------------------------------------------------------------------------------------
WFCN PSHA
LDAA #$3D
EORA #$6F
JSR out2hex
PULA
RTS```