1# mach: all 2# output: 3# sim: --environment operating 4 5.include "t-macros.i" 6 7 start 8 9 PSW_BITS = PSW_FX|PSW_ST|PSW_SM 10 loadpsw2 PSW_BITS 11 12 ;; Test normal sadd 13 14 loadacc2 a0 0x00 0x7fff 0xffff 15 loadacc2 a1 0xff 0x8000 0x0000 16 sadd a1, a0 17 checkacc2 1 a0 0x00 0x7fff 0xffff 18 checkacc2 2 a1 0xff 0x8000 0x7fff 19 20 ;; Test overflow 21 22 loadacc2 a0 0x00 0x0000 0x0000 23 loadacc2 a1 0x01 0x8000 0x0000 24 sadd a1, a0 25 checkacc2 3 a0 0x00 0x0000 0x0000 26 checkacc2 4 a1 0x00 0x7fff 0xffff 27 28 loadacc2 a0 0x00 0xffff 0xffff 29 loadacc2 a1 0x00 0xffff 0xffff 30 sadd a1, a0 31 checkacc2 5 a1 0x00 0x7fff 0xffff 32 checkacc2 6 a0 0x00 0xffff 0xffff 33 34 ;; Test underflow 35 36 loadacc2 a0 0x00 0x0000 0x0000 37 loadacc2 a1 0x80 0x8000 0x0000 38 sadd a1, a0 39 checkacc2 7 a0 0x00 0x0000 0x0000 40 checkacc2 8 a1 0xff 0x8000 0x0000 41 42 exit0 43