Wenn ich versuche, den Inhalt eines Registers mit Trap-Task 17 anzuzeigen, bekomme ich einige seltsame Fehler. Hier ist mein Code:Easy 68k Fehler, wenn Trap-Befehl aufgerufen wird
*Equates section
program_start equ $1000 *Start Location of program
timesToAdd equ 10 *Number to multiply numToMultiply by
numToMultiply equ 512 *Number to multiply through cumulative sum
ORG program_start
START: ; first instruction of program
* Put program code here
MOVE.L #$00000000,D0 *Initially set value in D0 to 0
MOVE.B #timesToAdd,D2 *Store times left to add in D2
loop CMP.B #0,D2 *Check if we are finished adding
BEQ loop_end *exit loop if we are done
SUB.B #1,D2 *decrement timesToAdd by 1
ADDI.L #numToMultiply,D0 *Add numToMultiply to value in D0
BCC skipSet
MOVE.B #1,D1 *Set D1 to 1 if carry bit is set
skipSet BRA loop
loop_end
MOVE.L D0,D2
MOVE.L #17,D0
CMP.B #0,D1 *Check if there was a carry
BEQ skipCarry
LEA Carry,A1
Trap #15 *Print Carry: with carry bit
skipCarry
MOVE.L D2,D1
LEA Product,A1
Trap #15
SIMHALT ; halt simulator
Carry DC.B 'Carry: '
Product DC.B 'Product= '
END START ; last line of source
Als ich das laufen lasse, erhalte ich diese Ausgabe: Output
Bundesstaat Register vor der Falle Aufruf: Before Trap
Jede Hilfe würde geschätzt.
Vielen Dank für die Hilfe Mann – RagCity