我试图以十进制显示 D0,但是当我运行程序时,什么都没有显示。我没有收到任何错误,当我查看寄存器 D0 时,我看到了十六进制的预期数字,但没有显示十进制等效数字。我正在尝试使用 TRAP 来做到这一点,我们在课堂上展示了这一点。我究竟做错了什么?有问题的代码行是代码开始处的第 17 行。它说“TRAP #15 以十进制显示 D0”。谢谢你的帮助。
*-----------------------------------------------------------
* Program Number: 0
* Written by : Bryan Kriss
* Date Created : 10/06/2013
* Description : This program performs If-then-else statement.
*
*-----------------------------------------------------------
START ORG $1000 Program starts at loc $1000
IF CMP #12,P Is P > 12?
BLE ENDIF If P < 12, go to ENDIF
ASL P Shift left
ASL P Shift left
ASL P Shift left
ADD #4,P P + 4
MOVE P,D0 Move P into D0
EXT.L D0
TRAP #15 Display D0 in decimal
STOP #$2700 Stop execution
ENDIF MOVE Q,D1 Move the value of Q into D1
SUB D1,D0 P - D1 (P-Q)
MOVE D0,D1 Move P into D1
STOP #$2700 Stop execution
* Data section
ORG $2000 Data starts at loc 2000
P DC.W 15 int P = 15;
Q DC.W 7 int Q = 7;
END START