/ ; ******************************************************** / / ; *** Errors.68a *** / / ; *** Tests the error detection in Sim68k *** / / ; *** You will have to test each error ONE BY ONE *** / / ; *** Your program must HALT after each error but only *** / / ; *** after displaying an appropriate error message *** / / ; *** There is no .result file for this test program *** / / ; ******************************************************** / / / / ; Assembly Language OpCode Oper1 Oper2 / / ; MSB LSB MSB LSB MSB LSB / / ;--------------------------------------------------------- / / / / ; Branch to the first instruction / / BRA.W @Main ; / $92 $60 $00 $0E / / / ; Declarations / / DEF.B @Err1, #$01 ; / $01 / DEF.B @Err2, #$02 ; / $02 / DEF.B @Err3, #$03 ; / $03 / DEF.B @Err4, #$04 ; / $04 / DEF.B @Err5, #$05 ; / $05 / DEF.B @Err6, #$06 ; / $06 / ; If the following value / / ; is displayed, then the / / ; error has not been / / ; detected correctly. / / DEF.L @Error, #$FFFFFFFF; / $FF $FF $FF $FF / / / ;------------------------ / / ; Main program / / LABEL @Main ; / / ; Select one of the six errors to be tested / / INP.B D0 ; / $E0 $00 / CMP.B @Err1, D0 ; / $81 $60 $00 $04 / BEQ.W @TestErr1 ; / $A2 $60 $00 $44 / CMP.B @Err2, D0 ; / $81 $60 $00 $05 / BEQ.W @TestErr2 ; / $A2 $60 $00 $4A / CMP.B @Err3, D0 ; / $81 $60 $00 $06 / BEQ.W @TestErr3 ; / $A2 $60 $00 $52 / CMP.B @Err4, D0 ; / $81 $60 $00 $07 / BEQ.W @TestErr4 ; / $A2 $60 $00 $58 / CMP.B @Err5, D0 ; / $81 $60 $00 $08 / BEQ.W @TestErr5 ; / $A2 $60 $00 $60 / CMP.B @Err6, D0 ; / $81 $60 $00 $09 / BEQ.W @TestErr6 ; / $A2 $60 $00 $66 / ; Incorrect input provided / / BRA.W @Main ; / $92 $60 $00 $0E / ; *** Invalid number of operands / / LABEL @TestErr1 ; / / ADDQ.B #$0, D0 ; / $09 $00 / DSP.L @Error ; / $EC $60 $00 $0A / / / ; *** Invalid data size / / LABEL @TestErr2 ; / / BRA.B $0001 ; / $90 $60 $00 $01 / DSP.L @Error ; / $EC $60 $00 $0A / / / ; *** Invalid addressing mode / / LABEL @TestErr3 ; / / BRA.W D0 ; / $92 $00 / DSP.L @Error ; / $EC $60 $00 $0A / / / ; *** Invalid addressing mode / / LABEL @TestErr4 ; / / MOVEA.W #$0001, D0 ; / $DB $60 $00 $01 / DSP.L @Error ; / $EC $60 $00 $0A / / / ; *** Invalid addressing mode / / LABEL @TestErr5 ; / / MOVEA.W D0, (A0) ; / $DB $08 / DSP.L @Error ; / $EC $60 $00 $0A / / / ; Division by zero / / LABEL @TestErr6 ; / / CLR.L D1 ; / $3C $10 / DIVS.L D1, D0 ; / $2D $10 / DSP.L @Error ; / $EC $60 $00 $0A / HLT.B ; / $F8 $00