// file: test.asm // date: 2015-12-19 18:42:18 // +++ file: "test.asm" +++ // K1-16/16 microcode // 2010-04-06 // 2015-12-07 // FAILURES 2010-04-06: // 0MHz: ld sr,sr,cy: oft // 2MHz: all tests passed // 4MHz: all tests passed // 8MHz: ld sr,sr,cy: 4 // 16MHz: Z-Test: 9 // ERROR: mca: Redefinition lokaler Label wird nicht bemerkt! // ================================================================ // Options and Symbolic Names: // ================================================================ // Welcher Quartz-Vorteiler soll maximal eingestellt werden? // 2 -> xtal/2 = 16 MHz // 4 -> xtal/4 = 8 MHz // 8 -> xtal/8 = 4 MHz // 16 -> xtal/16 = 2 MHz // xtal: = 32000 // kHz clock_predivider: = 2 // 2/4/8/16: Der Assembler kennt 'clock_predivider' und ersetzt ggf. "set clock2" und "4". //clock = xtal/clock_predivider // FYI fast_ival_z_test: = 0 // does "tst,nnnn : z" work? (req. 74AC151 on SSW) // note: "tst (areg)" does not work, even with 74AC151! #include "defs.asm" // +++ file: "defs.asm" +++ /* Copyright (c) Günter Woigk 2009 - 2015 mailto:kio@little-bat.de This file is free software This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ? Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. ? Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // K1-16/16 microcode // 2015-12-03 // ============================================================================== // Symbolic Names: // dis in out in out // ccc:E:oooooo:aaa:aaa:dddd:dddd // Data Bus: dreg cmd.clk = ___:0:______:___:___:0000:???? // cmd input (r/-) dreg ival.oe = ___:0:______:___:___:____:0000 // ival output (-/w) dreg mem.clk = ___:0:______:___:???:0001:???? // internal ram dreg mem.oe = ___:0:______:___:???:____:0001 // internal ram dreg io.clk = ___:0:____??:___:___:0010:???? // k1-bus i/o dreg io.oe = ___:0:____??:___:___:____:0010 // k1-bus i/o dreg dnop.clk = ___:0:______:___:___:0011:???? // dummy target (-/w) dreg axd.oe = ___:0:______:___:___:____:0011 // a-to-d port (r/-) dreg alu.clk = ___:0:__?_??:___:___:1000:???? // top of stack = tos = akku = alu dreg alu.oe = ___:0:______:___:___:____:1000 // top of stack = tos = akku = alu dreg sr.clk = ___:0:___?__:___:___:1100:???? // shift right // dreg sr_cy.clk = ___:0:___1__:___:___:1100:???? // shift right dreg sr.oe = ___:0:______:___:___:____:1100 // shift right dreg sl.clk = ___:0:___?__:___:___:1101:???? // shift left // dreg sl_cy.clk = ___:0:___1__:___:___:1101:???? // shift left dreg sl.oe = ___:0:______:___:___:____:1101 // shift left dreg d2ar.clk = ___:0:______:___:___:1111:???? // d-to-a register (-/w) dreg cmd_lo.oe = ___:0:______:___:___:____:1111 // cmd.lo register (r/-) dreg d0 = 4 // gp dreg register dreg d1 = 5 // "" dreg d2 = 6 // "" dreg d3 = 7 // scratch dreg dtmp = d3 // scratch dreg dxxx1 = 9 // unused dreg swap = 10 // swap hibyte <-> lobyte dreg dxxx2 = 11 // unused dreg msbit = 14 // 16-to-4 encoder // Address Bus: areg dxa.oe = ___:0:______:___:001:____:____ // d-to-a port areg anop.clk = ___:0:______:001:???:____:____ // dummy target areg d2ar.oe = ___:0:______:___:111:____:____ // d-to-a register (r/-) areg ioaddr.clk = ___:0:______:111:???:____:____ // k1-bus i/o address (w/-) areg ip = 0 // instruction pointer areg sp = 2 // stack pointer areg a0 = 3 // gp address register areg a1 = 4 // "" areg hp = 5 // heap pointer areg atmp = 6 // scratch // Option Lines: opt opt0 = ___:0:_____?:___:___:____:____ opt opt1 = ___:0:____?_:___:___:____:____ opt opt2 = ___:0:___?__:___:___:____:____ opt opt3 = ___:0:__?___:___:___:____:____ opt opt4 = ___:0:_?____:___:___:____:____ opt opt5 = ___:0:?_____:___:___:____:____ opt a_bits = ___:0:??____:___:___:____:____ opt d_bits = ___:0:__????:___:___:____:____ // for ALU: opt alu_fu = ___:0:____??:___:___:____:____ opt alu_cy = ___:0:___?__:___:___:____:____ // alu carry input opt alu_cpl = ___:0:__?___:___:___:____:____ // alu complement input opt cy = ___:0:___1__:___:___:____:____ opt nc = ___:0:___0__:___:___:____:____ opt add = ___:0:__0000:___:___:____:____ opt add_cy = ___:0:__0100:___:___:____:____ opt xor = ___:0:__0_01:___:___:____:____ opt and = ___:0:__0010:___:___:____:____ opt or = ___:0:__0110:___:___:____:____ opt load = ___:0:__0_11:___:___:____:____ opt sub = ___:0:__1100:___:___:____:____ opt sub_nc = ___:0:__1000:___:___:____:____ opt xor_cpl = ___:0:__1_01:___:___:____:____ opt and_cpl = ___:0:__1010:___:___:____:____ opt or_cpl = ___:0:__1110:___:___:____:____ opt load_cpl = ___:0:__1_11:___:___:____:____ // for Address Register: opt a_cpl = ___:0:_?____:___:___:____:____ opt a_dis = ___:0:?_____:___:___:____:____ opt add0 = ___:0:00____:___:001:____:____ // 001 = dxa.out opt sub2 = ___:0:01____:___:001:____:____ // 001 = dxa.out opt add1 = ___:0:00____:___:???:____:____ // ??? = !dxa.out opt sub1 = ___:0:01____:___:???:____:____ // ??? = !dxa.out opt adddis = ___:0:10____:___:???:____:____ // + cmd_lo opt subdis = ___:0:11____:___:???:____:____ // + cmd_lo - 256 // for I/O opt io_bits = ___:0:____??:___:___:____:____ opt i2c_clk = ___:0:___?01:___:___:____:0010 // 0010 = 2 = io.oe opt i2c_data = ___:0:__?_01:___:___:____:0010 // 0010 = 2 = io.oe // output: dreg io_data.clk = ___:0:____00:___:___:0010:???? // 0010 = 2 = io.clk dreg io_select.clk = ___:0:____01:___:___:0010:???? // 0010 = 2 = io.clk dreg io_ie_mask.clk = ___:0:____10:___:___:0010:???? // 0010 = 2 = io.clk dreg io_dummy.clk = ___:0:____11:___:___:0010:???? // 0010 = 2 = io.clk // input: dreg io_dummy.oe = ___:0:____00:___:___:____:0010 // 0010 = 2 = io.oe dreg io_i2c.oe = ___:0:__??01:___:___:____:0010 // 0010 = 2 = io.oe dreg io_irpt.oe = ___:0:____10:___:___:____:0010 // 0010 = 2 = io.oe dreg io_data.oe = ___:0:____11:___:___:____:0010 // 0010 = 2 = io.oe // Misc. Options: opt cmden = ___:0:______:___:___:____:____ opt cmddis = ___:1:___=_:________________ opt value = ___:1:___=_:???????????????? opt abort = ___:1:111=1:1111111111111111 // emulator only; reset on real machine // DIV_FF Names: "___:1:xxx=?:________________" opt clock2 = ___:1:000=?:________________ // 000 0 => XTAL/2 opt clock4 = ___:1:001=?:________________ // 001 0 => XTAL/4 opt halt = ___:1:010=?:________________ opt ei = ___:1:011=?:________________ opt led_grn = ___:1:100=?:________________ opt led_yel = ___:1:101=?:________________ opt led_red = ___:1:110=?:________________ opt reset = ___:1:111=?:________________ // Conditions: "000:_:______:___:___:____:____" cond 0 = 0 // (stay in) code plane 0 cond 1 = 1 // (stay in) code plane 1 cond cy = 2 // fork dep. on ALU carry flag cond z = 3 // fork dep. on ALU zero flag cond ovfl = 4 // fork dep. on ALU signed overflow flag cond rnd = 5 // fork dep. on RND cond bit0 = 6 // fork dep. on data bus bit 0 cond bit15 = 7 // fork dep. on data bus bit 15 // --- file: "defs.asm" --- #include "macros.asm" // +++ file: "macros.asm" +++ // flags.asm: instr test_z1(VALUE) ld d1,VALUE tst d0 TRAP !z tst d1 TRAP z end // alu.asm: instr test_addn(V1,V2) ld d1,V1 ld d2,V2 xor alu add d1 add_c d2 equ V1+V2+1 : z jp 0,error sub d2 sub_nc d1 TRAP !z add_c d1 add d2 equ V1+V2+1 : z TRAP 0 sub_nc d2 sub d1 TRAP !z end // dregs.asm: instr test_dreg(DR) ld DR,0 tst DR TRAP !z ld DR,$ffff tstn DR TRAP !z ld alu,$aa55 ld DR,alu equ DR TRAP !z ld alu,$55aa ld DR,alu equ DR TRAP !z end instr test_msbit(BIT) ld msbit,~(1<>(15-BIT)) ld alu,BIT equ msbit TRAP !z end // aregs.asm: instr testIncrDecrA(AR,N) ld AR,N-1 ld AR,AR+1 ld alu,N equ AR TRAP !z ld AR,AR-1 ld alu,N-1 equ AR TRAP !z end instr testAreg(AR) ld AR,0 tst AR TRAP !z ld AR,$ffff tstn AR TRAP !z ld alu,$55aa ld AR,alu equ AR TRAP !z ld alu,$aa55 ld AR,alu equ AR TRAP !z testIncrDecrA AR,1 testIncrDecrA AR,2 testIncrDecrA AR,4 testIncrDecrA AR,8 testIncrDecrA AR,$10 testIncrDecrA AR,$20 testIncrDecrA AR,$40 testIncrDecrA AR,$80 testIncrDecrA AR,$100 testIncrDecrA AR,$200 testIncrDecrA AR,$400 testIncrDecrA AR,$800 testIncrDecrA AR,$1000 testIncrDecrA AR,$2000 testIncrDecrA AR,$4000 testIncrDecrA AR,$8000 testIncrDecrA AR,0 end // --- file: "macros.asm" --- //#include "millicode.asm" //#include "millicode_int.asm" // ======================================================================== // Global Data // start at $0000 // ======================================================================= // Interrupts: int_vector data 16 // interrupt vectors int_mask data 1 // enable mask for installed handlers // Memory Management: gdata_ptr data 1 // allocation pointer for zeropage global data gcode_ptr data 1 // start of space for new words hp_base data 1 // bottom of data heap sp_base data 1 // top of return stack mem_data_start data 1 // Start of dynamic data blocks mem_data_end data 1 // Start of free memory between data and pointers mem_ptr_start data 1 // Start of global data pointers mem_free_ptr data 1 // Pointer to linked list of free global pointers mem_end data 1 mem_ptr_end := mem_end // End of local data pointers // Misc: opcode_Ret data 1 // opcode Ret: return_to_millicode // ====================================================================== // error exit // ====================================================================== // LED Codes: (RYG = red, yellow, green) // // --- after start // --G after first pass OK // --- after second pass OK => blinks with ~ 0.5 ? 1Hz // R-- error: a test failed :error clr clock4 clr clock2 set led_red clr led_yel clr led_grn l1 tst atmp // show error address on dbus jp l1 instr ERROR ld atmp,$ jp error end instr TRAP(COND) if COND ld atmp,$ jp error then end // ================================================================ // RESET // // Reset entry condition: // ? $3FFF:1 with 'cmddis=1' and 'cond=0' (for next instr) forced by INIT // ? $0000:0 is executed // ================================================================ : reset_7fff = $3FFF:1 clr reset // 'nop' : reset = $0000:0 clr halt di set clock4 // set full speed ? set clock2 // ? except if xtal/clock > 2 clr led_red // LEDs indicate: started clr led_yel clr led_grn // ====================================== // CPU & RAM Test // ====================================== start: #include "cmd.asm" // +++ file: "cmd.asm" +++ // ====================================== // CPU Test as in real mc rom: // ====================================== ld alu,1 do ld d0,alu ld a0,d0 ld d1,a0 ld a1,d1 ld d2,a1 ld atmp,d2 ld dtmp,atmp ld hp,dtmp ld sl,hp,cy ld sp,sl : bit15 if 0 ld sr,sp,nc else ld sr,sp,cy then ld ip,sr ld swap,ip ld swap,swap ld d2ar,swap equ d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add alu // nodelay until z // ====================================== // CMD.clk ld atmp,$ // error pos nop : 0 if 0 jp cc1 // dest plane: cond 0 hard coded jp error cc1 jp cc2 // dest plane: cond 1 hard coded jp error else jp error jp error jp error jp error then if 1 cc2 jp cc3 // dest plane: cond 0 hard coded jp error else jp error jp error then if 0 cc3 ld d0,cc4 jp d0 // dest plane: cond bit15 jp error cc4 ld d0,cc5 jp d0 // dest plane: cond bit15 jp error else jp error jp error jp error jp error jp error jp error then if 1 cc5 ld d0,cc6 jp d0 // dest plane: cond bit15 jp error cc6 ld d0,cc7 jp d0 // dest plane: cond bit15 jp error else jp error jp error jp error jp error jp error jp error then if 0 cc7 jp cc99 else jp error then cc99 nop // --- file: "cmd.asm" --- #include "flags.asm" // +++ file: "flags.asm" +++ /* ---- Z ------------------------------------------------ tst :z ival kommt aus dem uC-Ram => funktioniert nur in 99% aller Fälle (vor Allem Bit $0008 und auch Bit $1000) => vielleicht nach Ersetzen des HC151 durch AC151 */ // instr test_z1(VALUE) // ld d1,VALUE // tst d0 // TRAP !z // tst d1 // TRAP z // end ld d0,0 test_z1 1 ld d1,1 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 2 ld d1,2 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 4 ld d1,4 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 8 ld d1,8 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $10 ld d1,$10 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $20 ld d1,$20 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $40 ld d1,$40 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $80 ld d1,$80 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $100 ld d1,$100 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $200 ld d1,$200 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $400 ld d1,$400 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $800 ld d1,$800 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $1000 ld d1,$1000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $2000 ld d1,$2000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $4000 ld d1,$4000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $8000 ld d1,$8000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop // ---- bit0 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $0001 : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $fffe : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- bit15 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $8000 : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $7fff : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- cy ------------------------------------------------ // note: "add dreg" wird immer als doppel-opcode assembliert, wg. ripple-cy // "add ival" wird über dtmp realisiert, ist also auch ein "add dreg" // man kann deswegen nie "add $1234 : cy" schreiben, weil der cy-Test nicht auf dem ival // platziert werden kann, weil das add selbst eben ein "add dtmp" ist. ld alu,$7000 add $8000 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $0FFF // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add alu // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$8000 add alu TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $ffff // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- ovfl ------------------------------------------------ ld alu,$5000 add $1000 // $5000 -> $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $6000 -> $9000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $9000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $5000 // $C000 -> $1000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $B000 // $1000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $C000 -> $9000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $9000 -> $6000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $E000 // $6000 -> $4000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7000 add $1000 // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $F000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $1fff // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add -1 // $7FFF ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $8000 // $0000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add_c $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "flags.asm" --- #include "alu.asm" // +++ file: "alu.asm" +++ // Test ALU // test alu register: ld alu,0 tst alu TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff equ $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test cpl: nop,ival.oe,alu.clk,load_cpl // load alu,!0 dw 0 equ $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop,ival.oe,alu.clk,load_cpl // load alu,!$ffff dw $ffff equ $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop,ival.oe,alu.clk,load_cpl // load alu,!xxxx dw $55aa equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop,ival.oe,alu.clk,load_cpl // load alu,!xxxx dw $aa55 equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test xor: ld alu,$0000 // $0000 ^ $0000 xor $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP equ $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff // $ffff ^ $ffff xor $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP equ $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff // $ffff ^ $aa55 xor $aa55 equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // $55aa ^ $ffff xor $ffff equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0000 // $0000 ^ $aa55 xor $aa55 equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // $55aa ^ $0000 xor $0000 equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test and: ld alu,$0000 and $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and 1 equ 1 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $8000 equ $8000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $fffe equ $fffe : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $7fff equ $7fff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa and $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $55aa equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 and $ffff equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // and ~$aaaa nop, ival.oe,alu.clk, alu_fu=2, nc, alu_cpl=1 dw $aaaa equ $0055 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test or: ld alu,$0000 or $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa or $aa55 equ $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0000 or 1 equ 1 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0000 or $8000 equ $8000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0F0F or $55aa equ $5FaF : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 or $f0f0 equ $FaF5 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // or ~$aaaa nop,ival.oe,alu.clk, alu_fu=2, cy, alu_cpl=1 dw $aaaa equ $ff55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // add, sub: // instr test_addn(V1,V2) // ld d1,V1 // ld d2,V2 // xor alu // // add d1 // add_c d2 // equ V1+V2+1 : z // jp 0,error // sub d2 // sub_nc d1 // TRAP !z // // add_c d1 // add d2 // equ V1+V2+1 : z // TRAP 0 // sub_nc d2 // sub d1 // TRAP !z // end test_addn 0,0 ld d1,0 // * test_addn ld d2,0 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 0+0+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 0+0+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn $ffff,0 ld d1,$ffff // * test_addn ld d2,0 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ $ffff+0+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ $ffff+0+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn $7fff,$7fff ld d1,$7fff // * test_addn ld d2,$7fff // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ $7fff+$7fff+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ $7fff+$7fff+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn $7fff,$8000 ld d1,$7fff // * test_addn ld d2,$8000 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ $7fff+$8000+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ $7fff+$8000+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 4711,0815 ld d1,4711 // * test_addn ld d2,0815 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 4711+0815+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 4711+0815+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 60425,12082 ld d1,60425 // * test_addn ld d2,12082 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 60425+12082+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 60425+12082+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 13409,44581 ld d1,13409 // * test_addn ld d2,44581 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 13409+44581+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 13409+44581+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 38932,16796 ld d1,38932 // * test_addn ld d2,16796 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 38932+16796+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 38932+16796+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 8932,796 ld d1,8932 // * test_addn ld d2,796 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 8932+796+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 8932+796+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 32,76 ld d1,32 // * test_addn ld d2,76 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 32+76+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 32+76+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "alu.asm" --- #include "dregs.asm" // +++ file: "dregs.asm" +++ // Test Data Registers: // instr test_dreg(DR) // ld DR,0 // tst DR // TRAP !z // // ld DR,$ffff // tstn DR // TRAP !z // // ld alu,$aa55 // ld DR,alu // equ DR // TRAP !z // // ld alu,$55aa // ld DR,alu // equ DR // TRAP !z // end test_dreg d0 ld d0,0 // * test_dreg tst d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d0,$ffff // * test_dreg tstn d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d0,alu // * test_dreg equ d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d0,alu // * test_dreg equ d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_dreg d1 ld d1,0 // * test_dreg tst d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d1,$ffff // * test_dreg tstn d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d1,alu // * test_dreg equ d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d1,alu // * test_dreg equ d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_dreg d2 ld d2,0 // * test_dreg tst d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d2,$ffff // * test_dreg tstn d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d2,alu // * test_dreg equ d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d2,alu // * test_dreg equ d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_dreg d3 ld d3,0 // * test_dreg tst d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d3,$ffff // * test_dreg tstn d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d3,alu // * test_dreg equ d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d3,alu // * test_dreg equ d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // SL ld sl,$4001,nc tst sl TRAP !bit15 if !bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst sl TRAP bit0 if bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sl,-1,nc nop,cy ld sl,sl,nc tst sl TRAP bit0 if bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,0 ld sl,0,nc nop,nc ld sl,sl,cy tst sl TRAP !bit0 if !bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sl,0,nc nop,nc ld sl,sl,cy tst sl TRAP !bit0 if !bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sl,0,nc nop,cy ld sl,sl,nc tst sl TRAP bit0 if bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sl,$5591,nc ld alu,$AB22 equ sl TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sl,12345,cy // $3039 ld alu,12345*2+1 // $6073 equ sl TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // SR ld sr,$8002,nc tst sr TRAP !bit0 if !bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst sr TRAP bit15 if bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sr,-1,nc nop,cy ld sr,sr,nc tst sr TRAP bit15 if bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,$ ld alu,0 ld sr,0,nc nop,nc ld sr,sr,cy // BAD || !BAD ? tst sr TRAP !bit15 if !bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sr,0,nc nop,nc ld sr,sr,cy tst sr TRAP !bit15 if !bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sr,0,nc nop,cy ld sr,sr,nc tst sr TRAP bit15 if bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sr,$89AA,nc ld alu,$44D5 equ sr TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sr,54321,cy ld alu,$8000+54321/2 equ sr TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // SWAP ld swap,$ff00 ld alu,$00ff equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld swap,swap ld alu,$ff00 equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld swap,$5AB4 ld alu,$B45A equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld swap,swap ld alu,$5AB4 equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // 16TO4 // instr test_msbit(BIT) // ld msbit,~(1<>(15-BIT)) // ld alu,BIT // equ msbit // TRAP !z // end ld msbit,$7f00 ld alu,15 equ msbit TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,$ffff tst msbit TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 0 ld msbit,~(1<<0) // * test_msbit ld alu,0 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-0)) // * test_msbit ld alu,0 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 1 ld msbit,~(1<<1) // * test_msbit ld alu,1 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-1)) // * test_msbit ld alu,1 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 2 ld msbit,~(1<<2) // * test_msbit ld alu,2 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-2)) // * test_msbit ld alu,2 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 3 ld msbit,~(1<<3) // * test_msbit ld alu,3 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-3)) // * test_msbit ld alu,3 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 4 ld msbit,~(1<<4) // * test_msbit ld alu,4 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-4)) // * test_msbit ld alu,4 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 5 ld msbit,~(1<<5) // * test_msbit ld alu,5 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-5)) // * test_msbit ld alu,5 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 6 ld msbit,~(1<<6) // * test_msbit ld alu,6 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-6)) // * test_msbit ld alu,6 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 7 ld msbit,~(1<<7) // * test_msbit ld alu,7 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-7)) // * test_msbit ld alu,7 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 8 ld msbit,~(1<<8) // * test_msbit ld alu,8 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-8)) // * test_msbit ld alu,8 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 9 ld msbit,~(1<<9) // * test_msbit ld alu,9 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-9)) // * test_msbit ld alu,9 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 10 ld msbit,~(1<<10) // * test_msbit ld alu,10 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-10)) // * test_msbit ld alu,10 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 11 ld msbit,~(1<<11) // * test_msbit ld alu,11 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-11)) // * test_msbit ld alu,11 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 12 ld msbit,~(1<<12) // * test_msbit ld alu,12 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-12)) // * test_msbit ld alu,12 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 13 ld msbit,~(1<<13) // * test_msbit ld alu,13 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-13)) // * test_msbit ld alu,13 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 14 ld msbit,~(1<<14) // * test_msbit ld alu,14 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-14)) // * test_msbit ld alu,14 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 15 ld msbit,~(1<<15) // * test_msbit ld alu,15 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-15)) // * test_msbit ld alu,15 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // D2A, A2D: ld alu,0 ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // D2AR: ld d2ar,0 tst d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d2ar,$ffff tstn d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa ld d2ar,alu equ d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 ld d2ar,alu equ d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "dregs.asm" --- #include "aregs.asm" // +++ file: "aregs.asm" +++ // instr testIncrDecrA(AR,N) // ld AR,N-1 // ld AR,AR+1 // ld alu,N // equ AR // TRAP !z // ld AR,AR-1 // ld alu,N-1 // equ AR // TRAP !z // end // instr testAreg(AR) // ld AR,0 // tst AR // TRAP !z // // ld AR,$ffff // tstn AR // TRAP !z // // ld alu,$55aa // ld AR,alu // equ AR // TRAP !z // // ld alu,$aa55 // ld AR,alu // equ AR // TRAP !z // // testIncrDecrA AR,1 // testIncrDecrA AR,2 // testIncrDecrA AR,4 // testIncrDecrA AR,8 // testIncrDecrA AR,$10 // testIncrDecrA AR,$20 // testIncrDecrA AR,$40 // testIncrDecrA AR,$80 // testIncrDecrA AR,$100 // testIncrDecrA AR,$200 // testIncrDecrA AR,$400 // testIncrDecrA AR,$800 // testIncrDecrA AR,$1000 // testIncrDecrA AR,$2000 // testIncrDecrA AR,$4000 // testIncrDecrA AR,$8000 // testIncrDecrA AR,0 // end testAreg a0 ld a0,0 // * testAreg tst a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,$ffff // * testAreg tstn a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld a0,alu // * testAreg equ a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld a0,alu // * testAreg equ a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,1 // * testAreg ld a0,1 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,2 // * testAreg ld a0,2 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,4 // * testAreg ld a0,4 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,8 // * testAreg ld a0,8 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$10 // * testAreg ld a0,$10 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$20 // * testAreg ld a0,$20 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$40 // * testAreg ld a0,$40 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$80 // * testAreg ld a0,$80 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$100 // * testAreg ld a0,$100 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$200 // * testAreg ld a0,$200 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$400 // * testAreg ld a0,$400 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$800 // * testAreg ld a0,$800 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$1000 // * testAreg ld a0,$1000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$2000 // * testAreg ld a0,$2000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$4000 // * testAreg ld a0,$4000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$8000 // * testAreg ld a0,$8000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,0 // * testAreg ld a0,0 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg a1 ld a1,0 // * testAreg tst a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,$ffff // * testAreg tstn a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld a1,alu // * testAreg equ a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld a1,alu // * testAreg equ a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,1 // * testAreg ld a1,1 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,2 // * testAreg ld a1,2 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,4 // * testAreg ld a1,4 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,8 // * testAreg ld a1,8 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$10 // * testAreg ld a1,$10 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$20 // * testAreg ld a1,$20 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$40 // * testAreg ld a1,$40 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$80 // * testAreg ld a1,$80 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$100 // * testAreg ld a1,$100 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$200 // * testAreg ld a1,$200 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$400 // * testAreg ld a1,$400 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$800 // * testAreg ld a1,$800 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$1000 // * testAreg ld a1,$1000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$2000 // * testAreg ld a1,$2000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$4000 // * testAreg ld a1,$4000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$8000 // * testAreg ld a1,$8000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,0 // * testAreg ld a1,0 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg hp ld hp,0 // * testAreg tst hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,$ffff // * testAreg tstn hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld hp,alu // * testAreg equ hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld hp,alu // * testAreg equ hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,1 // * testAreg ld hp,1 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,2 // * testAreg ld hp,2 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,4 // * testAreg ld hp,4 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,8 // * testAreg ld hp,8 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$10 // * testAreg ld hp,$10 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$20 // * testAreg ld hp,$20 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$40 // * testAreg ld hp,$40 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$80 // * testAreg ld hp,$80 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$100 // * testAreg ld hp,$100 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$200 // * testAreg ld hp,$200 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$400 // * testAreg ld hp,$400 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$800 // * testAreg ld hp,$800 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$1000 // * testAreg ld hp,$1000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$2000 // * testAreg ld hp,$2000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$4000 // * testAreg ld hp,$4000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$8000 // * testAreg ld hp,$8000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,0 // * testAreg ld hp,0 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg atmp ld atmp,0 // * testAreg tst atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,$ffff // * testAreg tstn atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld atmp,alu // * testAreg equ atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld atmp,alu // * testAreg equ atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,1 // * testAreg ld atmp,1 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,2 // * testAreg ld atmp,2 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,4 // * testAreg ld atmp,4 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,8 // * testAreg ld atmp,8 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$10 // * testAreg ld atmp,$10 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$20 // * testAreg ld atmp,$20 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$40 // * testAreg ld atmp,$40 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$80 // * testAreg ld atmp,$80 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$100 // * testAreg ld atmp,$100 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$200 // * testAreg ld atmp,$200 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$400 // * testAreg ld atmp,$400 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$800 // * testAreg ld atmp,$800 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$1000 // * testAreg ld atmp,$1000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$2000 // * testAreg ld atmp,$2000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$4000 // * testAreg ld atmp,$4000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$8000 // * testAreg ld atmp,$8000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,0 // * testAreg ld atmp,0 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg ip ld ip,0 // * testAreg tst ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,$ffff // * testAreg tstn ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld ip,alu // * testAreg equ ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld ip,alu // * testAreg equ ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,1 // * testAreg ld ip,1 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,2 // * testAreg ld ip,2 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,4 // * testAreg ld ip,4 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,8 // * testAreg ld ip,8 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$10 // * testAreg ld ip,$10 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$20 // * testAreg ld ip,$20 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$40 // * testAreg ld ip,$40 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$80 // * testAreg ld ip,$80 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$100 // * testAreg ld ip,$100 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$200 // * testAreg ld ip,$200 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$400 // * testAreg ld ip,$400 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$800 // * testAreg ld ip,$800 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$1000 // * testAreg ld ip,$1000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$2000 // * testAreg ld ip,$2000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$4000 // * testAreg ld ip,$4000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$8000 // * testAreg ld ip,$8000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,0 // * testAreg ld ip,0 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg sp ld sp,0 // * testAreg tst sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,$ffff // * testAreg tstn sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld sp,alu // * testAreg equ sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld sp,alu // * testAreg equ sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,1 // * testAreg ld sp,1 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,2 // * testAreg ld sp,2 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,4 // * testAreg ld sp,4 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,8 // * testAreg ld sp,8 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$10 // * testAreg ld sp,$10 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$20 // * testAreg ld sp,$20 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$40 // * testAreg ld sp,$40 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$80 // * testAreg ld sp,$80 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$100 // * testAreg ld sp,$100 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$200 // * testAreg ld sp,$200 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$400 // * testAreg ld sp,$400 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$800 // * testAreg ld sp,$800 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$1000 // * testAreg ld sp,$1000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$2000 // * testAreg ld sp,$2000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$4000 // * testAreg ld sp,$4000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$8000 // * testAreg ld sp,$8000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,0 // * testAreg ld sp,0 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "aregs.asm" --- #include "ramtest.asm" // +++ file: "ramtest.asm" +++ /* Copyright (c) Günter Woigk 2009 - 2010 mailto:kio@little-bat.de This file is free software This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ? Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. ? Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // adapted from "?/mc/asm/ramtest.asm" /* -------------------------------------------------- Test and Clear Ram Test and clear 64k ram with $0000. "run-through" version: no ret at end ram_test should detect defective bits, defective chips, total failure of ram, defective data lines and defective address lines. failure in first loop: defective word at a0: issue with data lines? Bit always 0, always 1, shortened? */ // in: - // out: - // mod: alu,a1,a0,dtmp // Check whole ram word by word: // Store and read 16 x single bit 1 and 16 x single bit 0 ld atmp,$ // error position ld a0,$0000 // a0 -> ram do ld alu,$8000 // alu = pattern = $8000 --> $0001 ld dtmp,alu do cpl ld (a0),alu tst dtmp // toggle data on bus tst (a0) // delay 16 MHz equ (a0) // compare ld dtmp,alu : z jp 0,error // defective word at a0 cpl ld (a0),alu tst dtmp tst (a0) // delay 16 MHz equ (a0) // compare ld dtmp,alu : z jp 0,error // defective word at a0 ld sr,alu,nc // note: data bit 0 on bus ld alu,sr : bit0 // note: test for bit0 until 1 // note: conditional branch // same byte, next bit inc a0 tst a0 until z // next byte // now: all RAM[?] = $01 // Check for folding (defective address lines) and clear ram to $0000: // ld a0,$0000 // a0 = pointer ist schon // ld dtmp,1 // const: 1 ist schon do ld alu,(a0) sub dtmp // -1 ld (a0++),alu : z // $01 -> $00 while 1 // Abort if ram cell did not contain $0001: // either due to folded addresses due to defective address line // or because entire 64k were cleared. // a0 points behind the mirrored cell or at $0001 if entire 64k are ok: xor alu // if stopped because 64k have been cleared: ld (--a0),alu // clear ram[$0000] tst a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "ramtest.asm" --- //#include "cmd_lo.asm" set led_grn // 1st half of test loop passed jp again : again #include "cmd.asm" // +++ file: "cmd.asm" +++ // ====================================== // CPU Test as in real mc rom: // ====================================== ld alu,1 do ld d0,alu ld a0,d0 ld d1,a0 ld a1,d1 ld d2,a1 ld atmp,d2 ld dtmp,atmp ld hp,dtmp ld sl,hp,cy ld sp,sl : bit15 if 0 ld sr,sp,nc else ld sr,sp,cy then ld ip,sr ld swap,ip ld swap,swap ld d2ar,swap equ d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add alu // nodelay until z // ====================================== // CMD.clk ld atmp,$ // error pos nop : 0 if 0 jp cc1 // dest plane: cond 0 hard coded jp error cc1 jp cc2 // dest plane: cond 1 hard coded jp error else jp error jp error jp error jp error then if 1 cc2 jp cc3 // dest plane: cond 0 hard coded jp error else jp error jp error then if 0 cc3 ld d0,cc4 jp d0 // dest plane: cond bit15 jp error cc4 ld d0,cc5 jp d0 // dest plane: cond bit15 jp error else jp error jp error jp error jp error jp error jp error then if 1 cc5 ld d0,cc6 jp d0 // dest plane: cond bit15 jp error cc6 ld d0,cc7 jp d0 // dest plane: cond bit15 jp error else jp error jp error jp error jp error jp error jp error then if 0 cc7 jp cc99 else jp error then cc99 nop // --- file: "cmd.asm" --- #include "flags.asm" // +++ file: "flags.asm" +++ /* ---- Z ------------------------------------------------ tst :z ival kommt aus dem uC-Ram => funktioniert nur in 99% aller Fälle (vor Allem Bit $0008 und auch Bit $1000) => vielleicht nach Ersetzen des HC151 durch AC151 */ // instr test_z1(VALUE) // ld d1,VALUE // tst d0 // TRAP !z // tst d1 // TRAP z // end ld d0,0 test_z1 1 ld d1,1 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 2 ld d1,2 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 4 ld d1,4 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 8 ld d1,8 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $10 ld d1,$10 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $20 ld d1,$20 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $40 ld d1,$40 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $80 ld d1,$80 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $100 ld d1,$100 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $200 ld d1,$200 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $400 ld d1,$400 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $800 ld d1,$800 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $1000 ld d1,$1000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $2000 ld d1,$2000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $4000 ld d1,$4000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $8000 ld d1,$8000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop // ---- bit0 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $0001 : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $fffe : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- bit15 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $8000 : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $7fff : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- cy ------------------------------------------------ // note: "add dreg" wird immer als doppel-opcode assembliert, wg. ripple-cy // "add ival" wird über dtmp realisiert, ist also auch ein "add dreg" // man kann deswegen nie "add $1234 : cy" schreiben, weil der cy-Test nicht auf dem ival // platziert werden kann, weil das add selbst eben ein "add dtmp" ist. ld alu,$7000 add $8000 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $0FFF // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add alu // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$8000 add alu TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $ffff // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- ovfl ------------------------------------------------ ld alu,$5000 add $1000 // $5000 -> $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $6000 -> $9000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $9000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $5000 // $C000 -> $1000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $B000 // $1000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $C000 -> $9000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $9000 -> $6000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $E000 // $6000 -> $4000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7000 add $1000 // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $F000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $1fff // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add -1 // $7FFF ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $8000 // $0000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add_c $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "flags.asm" --- nop #include "flags.asm" // +++ file: "flags.asm" +++ /* ---- Z ------------------------------------------------ tst :z ival kommt aus dem uC-Ram => funktioniert nur in 99% aller Fälle (vor Allem Bit $0008 und auch Bit $1000) => vielleicht nach Ersetzen des HC151 durch AC151 */ // instr test_z1(VALUE) // ld d1,VALUE // tst d0 // TRAP !z // tst d1 // TRAP z // end ld d0,0 test_z1 1 ld d1,1 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 2 ld d1,2 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 4 ld d1,4 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 8 ld d1,8 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $10 ld d1,$10 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $20 ld d1,$20 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $40 ld d1,$40 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $80 ld d1,$80 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $100 ld d1,$100 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $200 ld d1,$200 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $400 ld d1,$400 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $800 ld d1,$800 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $1000 ld d1,$1000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $2000 ld d1,$2000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $4000 ld d1,$4000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $8000 ld d1,$8000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop // ---- bit0 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $0001 : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $fffe : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- bit15 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $8000 : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $7fff : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- cy ------------------------------------------------ // note: "add dreg" wird immer als doppel-opcode assembliert, wg. ripple-cy // "add ival" wird über dtmp realisiert, ist also auch ein "add dreg" // man kann deswegen nie "add $1234 : cy" schreiben, weil der cy-Test nicht auf dem ival // platziert werden kann, weil das add selbst eben ein "add dtmp" ist. ld alu,$7000 add $8000 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $0FFF // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add alu // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$8000 add alu TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $ffff // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- ovfl ------------------------------------------------ ld alu,$5000 add $1000 // $5000 -> $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $6000 -> $9000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $9000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $5000 // $C000 -> $1000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $B000 // $1000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $C000 -> $9000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $9000 -> $6000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $E000 // $6000 -> $4000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7000 add $1000 // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $F000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $1fff // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add -1 // $7FFF ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $8000 // $0000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add_c $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "flags.asm" --- nop nop #include "flags.asm" // +++ file: "flags.asm" +++ /* ---- Z ------------------------------------------------ tst :z ival kommt aus dem uC-Ram => funktioniert nur in 99% aller Fälle (vor Allem Bit $0008 und auch Bit $1000) => vielleicht nach Ersetzen des HC151 durch AC151 */ // instr test_z1(VALUE) // ld d1,VALUE // tst d0 // TRAP !z // tst d1 // TRAP z // end ld d0,0 test_z1 1 ld d1,1 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 2 ld d1,2 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 4 ld d1,4 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 8 ld d1,8 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $10 ld d1,$10 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $20 ld d1,$20 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $40 ld d1,$40 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $80 ld d1,$80 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $100 ld d1,$100 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $200 ld d1,$200 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $400 ld d1,$400 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $800 ld d1,$800 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $1000 ld d1,$1000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $2000 ld d1,$2000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $4000 ld d1,$4000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $8000 ld d1,$8000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop // ---- bit0 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $0001 : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $fffe : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- bit15 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $8000 : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $7fff : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- cy ------------------------------------------------ // note: "add dreg" wird immer als doppel-opcode assembliert, wg. ripple-cy // "add ival" wird über dtmp realisiert, ist also auch ein "add dreg" // man kann deswegen nie "add $1234 : cy" schreiben, weil der cy-Test nicht auf dem ival // platziert werden kann, weil das add selbst eben ein "add dtmp" ist. ld alu,$7000 add $8000 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $0FFF // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add alu // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$8000 add alu TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $ffff // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- ovfl ------------------------------------------------ ld alu,$5000 add $1000 // $5000 -> $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $6000 -> $9000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $9000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $5000 // $C000 -> $1000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $B000 // $1000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $C000 -> $9000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $9000 -> $6000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $E000 // $6000 -> $4000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7000 add $1000 // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $F000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $1fff // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add -1 // $7FFF ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $8000 // $0000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add_c $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "flags.asm" --- nop nop nop #include "flags.asm" // +++ file: "flags.asm" +++ /* ---- Z ------------------------------------------------ tst :z ival kommt aus dem uC-Ram => funktioniert nur in 99% aller Fälle (vor Allem Bit $0008 und auch Bit $1000) => vielleicht nach Ersetzen des HC151 durch AC151 */ // instr test_z1(VALUE) // ld d1,VALUE // tst d0 // TRAP !z // tst d1 // TRAP z // end ld d0,0 test_z1 1 ld d1,1 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 2 ld d1,2 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 4 ld d1,4 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 8 ld d1,8 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $10 ld d1,$10 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $20 ld d1,$20 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $40 ld d1,$40 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $80 ld d1,$80 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $100 ld d1,$100 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $200 ld d1,$200 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $400 ld d1,$400 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $800 ld d1,$800 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $1000 ld d1,$1000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $2000 ld d1,$2000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $4000 ld d1,$4000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_z1 $8000 ld d1,$8000 // * test_z1 tst d0 // * test_z1 TRAP !z // * test_z1 if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 // * test_z1 TRAP z // * test_z1 if z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop // ---- bit0 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $0001 : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $fffe : bit0 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit0 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- bit15 ------------------------------------------------ ld d1,~0 ld d0,0 tst d1 tst $0000 : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $8000 : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d1 tst $7fff : bit15 TRAP 1 if 1 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst d0 tst $ffff : bit15 TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- cy ------------------------------------------------ // note: "add dreg" wird immer als doppel-opcode assembliert, wg. ripple-cy // "add ival" wird über dtmp realisiert, ist also auch ein "add dreg" // man kann deswegen nie "add $1234 : cy" schreiben, weil der cy-Test nicht auf dem ival // platziert werden kann, weil das add selbst eben ein "add dtmp" ist. ld alu,$7000 add $8000 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $0FFF // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add 1 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff add alu // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP cy if cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c 0 // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$8000 add alu TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $ffff // *dtmp* TRAP !cy if !cy // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // ---- ovfl ------------------------------------------------ ld alu,$5000 add $1000 // $5000 -> $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $6000 -> $9000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $3000 // $9000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $5000 // $C000 -> $1000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $B000 // $1000 -> $C000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $C000 -> $9000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $D000 // $9000 -> $6000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $E000 // $6000 -> $4000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7000 add $1000 // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $F000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add $7000 // $6000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $1fff // $8000 ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add -1 // $7FFF ovfl *dtmp* TRAP !ovfl if !ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c $8000 // $0000 !ovfl *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$7fff add_c $8000 // *dtmp* TRAP ovfl if ovfl // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "flags.asm" --- #include "alu.asm" // +++ file: "alu.asm" +++ // Test ALU // test alu register: ld alu,0 tst alu TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff equ $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test cpl: nop,ival.oe,alu.clk,load_cpl // load alu,!0 dw 0 equ $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop,ival.oe,alu.clk,load_cpl // load alu,!$ffff dw $ffff equ $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop,ival.oe,alu.clk,load_cpl // load alu,!xxxx dw $55aa equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP nop,ival.oe,alu.clk,load_cpl // load alu,!xxxx dw $aa55 equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test xor: ld alu,$0000 // $0000 ^ $0000 xor $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP equ $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff // $ffff ^ $ffff xor $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP equ $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff // $ffff ^ $aa55 xor $aa55 equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // $55aa ^ $ffff xor $ffff equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0000 // $0000 ^ $aa55 xor $aa55 equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // $55aa ^ $0000 xor $0000 equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test and: ld alu,$0000 and $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and 1 equ 1 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $8000 equ $8000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $fffe equ $fffe : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $7fff equ $7fff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa and $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff and $55aa equ $55aa : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 and $ffff equ $aa55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // and ~$aaaa nop, ival.oe,alu.clk, alu_fu=2, nc, alu_cpl=1 dw $aaaa equ $0055 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // test or: ld alu,$0000 or $0000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa or $aa55 equ $ffff : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0000 or 1 equ 1 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0000 or $8000 equ $8000 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$0F0F or $55aa equ $5FaF : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 or $f0f0 equ $FaF5 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // or ~$aaaa nop,ival.oe,alu.clk, alu_fu=2, cy, alu_cpl=1 dw $aaaa equ $ff55 : z TRAP 0 if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // add, sub: // instr test_addn(V1,V2) // ld d1,V1 // ld d2,V2 // xor alu // // add d1 // add_c d2 // equ V1+V2+1 : z // jp 0,error // sub d2 // sub_nc d1 // TRAP !z // // add_c d1 // add d2 // equ V1+V2+1 : z // TRAP 0 // sub_nc d2 // sub d1 // TRAP !z // end test_addn 0,0 ld d1,0 // * test_addn ld d2,0 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 0+0+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 0+0+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn $ffff,0 ld d1,$ffff // * test_addn ld d2,0 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ $ffff+0+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ $ffff+0+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn $7fff,$7fff ld d1,$7fff // * test_addn ld d2,$7fff // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ $7fff+$7fff+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ $7fff+$7fff+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn $7fff,$8000 ld d1,$7fff // * test_addn ld d2,$8000 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ $7fff+$8000+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ $7fff+$8000+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 4711,0815 ld d1,4711 // * test_addn ld d2,0815 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 4711+0815+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 4711+0815+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 60425,12082 ld d1,60425 // * test_addn ld d2,12082 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 60425+12082+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 60425+12082+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 13409,44581 ld d1,13409 // * test_addn ld d2,44581 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 13409+44581+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 13409+44581+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 38932,16796 ld d1,38932 // * test_addn ld d2,16796 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 38932+16796+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 38932+16796+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 8932,796 ld d1,8932 // * test_addn ld d2,796 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 8932+796+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 8932+796+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_addn 32,76 ld d1,32 // * test_addn ld d2,76 // * test_addn xor alu // * test_addn add d1 // * test_addn add_c d2 // * test_addn equ 32+76+1 : z // * test_addn jp 0,error // * test_addn sub d2 // * test_addn sub_nc d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP add_c d1 // * test_addn add d2 // * test_addn equ 32+76+1 : z // * test_addn TRAP 0 // * test_addn if 0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP sub_nc d2 // * test_addn sub d1 // * test_addn TRAP !z // * test_addn if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "alu.asm" --- #include "dregs.asm" // +++ file: "dregs.asm" +++ // Test Data Registers: // instr test_dreg(DR) // ld DR,0 // tst DR // TRAP !z // // ld DR,$ffff // tstn DR // TRAP !z // // ld alu,$aa55 // ld DR,alu // equ DR // TRAP !z // // ld alu,$55aa // ld DR,alu // equ DR // TRAP !z // end test_dreg d0 ld d0,0 // * test_dreg tst d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d0,$ffff // * test_dreg tstn d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d0,alu // * test_dreg equ d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d0,alu // * test_dreg equ d0 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_dreg d1 ld d1,0 // * test_dreg tst d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d1,$ffff // * test_dreg tstn d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d1,alu // * test_dreg equ d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d1,alu // * test_dreg equ d1 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_dreg d2 ld d2,0 // * test_dreg tst d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d2,$ffff // * test_dreg tstn d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d2,alu // * test_dreg equ d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d2,alu // * test_dreg equ d2 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_dreg d3 ld d3,0 // * test_dreg tst d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d3,$ffff // * test_dreg tstn d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * test_dreg ld d3,alu // * test_dreg equ d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * test_dreg ld d3,alu // * test_dreg equ d3 // * test_dreg TRAP !z // * test_dreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // SL ld sl,$4001,nc tst sl TRAP !bit15 if !bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst sl TRAP bit0 if bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sl,-1,nc nop,cy ld sl,sl,nc tst sl TRAP bit0 if bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,0 ld sl,0,nc nop,nc ld sl,sl,cy tst sl TRAP !bit0 if !bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sl,0,nc nop,nc ld sl,sl,cy tst sl TRAP !bit0 if !bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sl,0,nc nop,cy ld sl,sl,nc tst sl TRAP bit0 if bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sl,$5591,nc ld alu,$AB22 equ sl TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sl,12345,cy // $3039 ld alu,12345*2+1 // $6073 equ sl TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // SR ld sr,$8002,nc tst sr TRAP !bit0 if !bit0 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP tst sr TRAP bit15 if bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sr,-1,nc nop,cy ld sr,sr,nc tst sr TRAP bit15 if bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,$ ld alu,0 ld sr,0,nc nop,nc ld sr,sr,cy // BAD || !BAD ? tst sr TRAP !bit15 if !bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sr,0,nc nop,nc ld sr,sr,cy tst sr TRAP !bit15 if !bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,-1 ld sr,0,nc nop,cy ld sr,sr,nc tst sr TRAP bit15 if bit15 // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sr,$89AA,nc ld alu,$44D5 equ sr TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sr,54321,cy ld alu,$8000+54321/2 equ sr TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // SWAP ld swap,$ff00 ld alu,$00ff equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld swap,swap ld alu,$ff00 equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld swap,$5AB4 ld alu,$B45A equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld swap,swap ld alu,$5AB4 equ swap TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // 16TO4 // instr test_msbit(BIT) // ld msbit,~(1<>(15-BIT)) // ld alu,BIT // equ msbit // TRAP !z // end ld msbit,$7f00 ld alu,15 equ msbit TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,$ffff tst msbit TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 0 ld msbit,~(1<<0) // * test_msbit ld alu,0 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-0)) // * test_msbit ld alu,0 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 1 ld msbit,~(1<<1) // * test_msbit ld alu,1 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-1)) // * test_msbit ld alu,1 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 2 ld msbit,~(1<<2) // * test_msbit ld alu,2 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-2)) // * test_msbit ld alu,2 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 3 ld msbit,~(1<<3) // * test_msbit ld alu,3 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-3)) // * test_msbit ld alu,3 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 4 ld msbit,~(1<<4) // * test_msbit ld alu,4 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-4)) // * test_msbit ld alu,4 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 5 ld msbit,~(1<<5) // * test_msbit ld alu,5 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-5)) // * test_msbit ld alu,5 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 6 ld msbit,~(1<<6) // * test_msbit ld alu,6 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-6)) // * test_msbit ld alu,6 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 7 ld msbit,~(1<<7) // * test_msbit ld alu,7 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-7)) // * test_msbit ld alu,7 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 8 ld msbit,~(1<<8) // * test_msbit ld alu,8 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-8)) // * test_msbit ld alu,8 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 9 ld msbit,~(1<<9) // * test_msbit ld alu,9 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-9)) // * test_msbit ld alu,9 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 10 ld msbit,~(1<<10) // * test_msbit ld alu,10 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-10)) // * test_msbit ld alu,10 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 11 ld msbit,~(1<<11) // * test_msbit ld alu,11 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-11)) // * test_msbit ld alu,11 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 12 ld msbit,~(1<<12) // * test_msbit ld alu,12 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-12)) // * test_msbit ld alu,12 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 13 ld msbit,~(1<<13) // * test_msbit ld alu,13 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-13)) // * test_msbit ld alu,13 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 14 ld msbit,~(1<<14) // * test_msbit ld alu,14 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-14)) // * test_msbit ld alu,14 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP test_msbit 15 ld msbit,~(1<<15) // * test_msbit ld alu,15 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld msbit,~($aaaa>>(15-15)) // * test_msbit ld alu,15 // * test_msbit equ msbit // * test_msbit TRAP !z // * test_msbit if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // D2A, A2D: ld alu,0 ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$ffff ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 ld a0,alu equ a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // D2AR: ld d2ar,0 tst d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld d2ar,$ffff tstn d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa ld d2ar,alu equ d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 ld d2ar,alu equ d2ar TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "dregs.asm" --- #include "aregs.asm" // +++ file: "aregs.asm" +++ // instr testIncrDecrA(AR,N) // ld AR,N-1 // ld AR,AR+1 // ld alu,N // equ AR // TRAP !z // ld AR,AR-1 // ld alu,N-1 // equ AR // TRAP !z // end // instr testAreg(AR) // ld AR,0 // tst AR // TRAP !z // // ld AR,$ffff // tstn AR // TRAP !z // // ld alu,$55aa // ld AR,alu // equ AR // TRAP !z // // ld alu,$aa55 // ld AR,alu // equ AR // TRAP !z // // testIncrDecrA AR,1 // testIncrDecrA AR,2 // testIncrDecrA AR,4 // testIncrDecrA AR,8 // testIncrDecrA AR,$10 // testIncrDecrA AR,$20 // testIncrDecrA AR,$40 // testIncrDecrA AR,$80 // testIncrDecrA AR,$100 // testIncrDecrA AR,$200 // testIncrDecrA AR,$400 // testIncrDecrA AR,$800 // testIncrDecrA AR,$1000 // testIncrDecrA AR,$2000 // testIncrDecrA AR,$4000 // testIncrDecrA AR,$8000 // testIncrDecrA AR,0 // end testAreg a0 ld a0,0 // * testAreg tst a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,$ffff // * testAreg tstn a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld a0,alu // * testAreg equ a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld a0,alu // * testAreg equ a0 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,1 // * testAreg ld a0,1 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,2 // * testAreg ld a0,2 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,4 // * testAreg ld a0,4 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,8 // * testAreg ld a0,8 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$10 // * testAreg ld a0,$10 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$20 // * testAreg ld a0,$20 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$40 // * testAreg ld a0,$40 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$80 // * testAreg ld a0,$80 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$100 // * testAreg ld a0,$100 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$200 // * testAreg ld a0,$200 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$400 // * testAreg ld a0,$400 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$800 // * testAreg ld a0,$800 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$1000 // * testAreg ld a0,$1000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$2000 // * testAreg ld a0,$2000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$4000 // * testAreg ld a0,$4000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,$8000 // * testAreg ld a0,$8000 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a0,0 // * testAreg ld a0,0 -1 // * testIncrDecrA ld a0,a0+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a0,a0-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ a0 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg a1 ld a1,0 // * testAreg tst a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,$ffff // * testAreg tstn a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld a1,alu // * testAreg equ a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld a1,alu // * testAreg equ a1 // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,1 // * testAreg ld a1,1 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,2 // * testAreg ld a1,2 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,4 // * testAreg ld a1,4 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,8 // * testAreg ld a1,8 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$10 // * testAreg ld a1,$10 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$20 // * testAreg ld a1,$20 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$40 // * testAreg ld a1,$40 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$80 // * testAreg ld a1,$80 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$100 // * testAreg ld a1,$100 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$200 // * testAreg ld a1,$200 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$400 // * testAreg ld a1,$400 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$800 // * testAreg ld a1,$800 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$1000 // * testAreg ld a1,$1000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$2000 // * testAreg ld a1,$2000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$4000 // * testAreg ld a1,$4000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,$8000 // * testAreg ld a1,$8000 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA a1,0 // * testAreg ld a1,0 -1 // * testIncrDecrA ld a1,a1+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld a1,a1-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ a1 // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg hp ld hp,0 // * testAreg tst hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,$ffff // * testAreg tstn hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld hp,alu // * testAreg equ hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld hp,alu // * testAreg equ hp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,1 // * testAreg ld hp,1 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,2 // * testAreg ld hp,2 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,4 // * testAreg ld hp,4 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,8 // * testAreg ld hp,8 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$10 // * testAreg ld hp,$10 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$20 // * testAreg ld hp,$20 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$40 // * testAreg ld hp,$40 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$80 // * testAreg ld hp,$80 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$100 // * testAreg ld hp,$100 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$200 // * testAreg ld hp,$200 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$400 // * testAreg ld hp,$400 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$800 // * testAreg ld hp,$800 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$1000 // * testAreg ld hp,$1000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$2000 // * testAreg ld hp,$2000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$4000 // * testAreg ld hp,$4000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,$8000 // * testAreg ld hp,$8000 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA hp,0 // * testAreg ld hp,0 -1 // * testIncrDecrA ld hp,hp+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld hp,hp-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ hp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg atmp ld atmp,0 // * testAreg tst atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,$ffff // * testAreg tstn atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld atmp,alu // * testAreg equ atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld atmp,alu // * testAreg equ atmp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,1 // * testAreg ld atmp,1 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,2 // * testAreg ld atmp,2 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,4 // * testAreg ld atmp,4 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,8 // * testAreg ld atmp,8 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$10 // * testAreg ld atmp,$10 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$20 // * testAreg ld atmp,$20 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$40 // * testAreg ld atmp,$40 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$80 // * testAreg ld atmp,$80 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$100 // * testAreg ld atmp,$100 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$200 // * testAreg ld atmp,$200 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$400 // * testAreg ld atmp,$400 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$800 // * testAreg ld atmp,$800 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$1000 // * testAreg ld atmp,$1000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$2000 // * testAreg ld atmp,$2000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$4000 // * testAreg ld atmp,$4000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,$8000 // * testAreg ld atmp,$8000 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA atmp,0 // * testAreg ld atmp,0 -1 // * testIncrDecrA ld atmp,atmp+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld atmp,atmp-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ atmp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg ip ld ip,0 // * testAreg tst ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,$ffff // * testAreg tstn ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld ip,alu // * testAreg equ ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld ip,alu // * testAreg equ ip // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,1 // * testAreg ld ip,1 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,2 // * testAreg ld ip,2 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,4 // * testAreg ld ip,4 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,8 // * testAreg ld ip,8 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$10 // * testAreg ld ip,$10 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$20 // * testAreg ld ip,$20 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$40 // * testAreg ld ip,$40 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$80 // * testAreg ld ip,$80 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$100 // * testAreg ld ip,$100 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$200 // * testAreg ld ip,$200 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$400 // * testAreg ld ip,$400 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$800 // * testAreg ld ip,$800 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$1000 // * testAreg ld ip,$1000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$2000 // * testAreg ld ip,$2000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$4000 // * testAreg ld ip,$4000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,$8000 // * testAreg ld ip,$8000 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA ip,0 // * testAreg ld ip,0 -1 // * testIncrDecrA ld ip,ip+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld ip,ip-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ ip // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testAreg sp ld sp,0 // * testAreg tst sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,$ffff // * testAreg tstn sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$55aa // * testAreg ld sp,alu // * testAreg equ sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld alu,$aa55 // * testAreg ld sp,alu // * testAreg equ sp // * testAreg TRAP !z // * testAreg if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,1 // * testAreg ld sp,1 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,1 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,2 // * testAreg ld sp,2 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,2 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,2 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,4 // * testAreg ld sp,4 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,4 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,4 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,8 // * testAreg ld sp,8 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,8 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,8 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$10 // * testAreg ld sp,$10 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$10 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$10 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$20 // * testAreg ld sp,$20 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$20 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$20 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$40 // * testAreg ld sp,$40 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$40 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$40 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$80 // * testAreg ld sp,$80 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$80 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$80 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$100 // * testAreg ld sp,$100 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$100 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$100 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$200 // * testAreg ld sp,$200 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$200 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$200 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$400 // * testAreg ld sp,$400 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$400 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$400 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$800 // * testAreg ld sp,$800 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$800 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$800 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$1000 // * testAreg ld sp,$1000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$1000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$1000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$2000 // * testAreg ld sp,$2000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$2000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$2000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$4000 // * testAreg ld sp,$4000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$4000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$4000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,$8000 // * testAreg ld sp,$8000 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,$8000 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,$8000 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP testIncrDecrA sp,0 // * testAreg ld sp,0 -1 // * testIncrDecrA ld sp,sp+1 // * testIncrDecrA ld alu,0 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP ld sp,sp-1 // * testIncrDecrA ld alu,0 -1 // * testIncrDecrA equ sp // * testIncrDecrA TRAP !z // * testIncrDecrA if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "aregs.asm" --- #include "ramtest.asm" // +++ file: "ramtest.asm" +++ /* Copyright (c) Günter Woigk 2009 - 2010 mailto:kio@little-bat.de This file is free software This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ? Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. ? Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // adapted from "?/mc/asm/ramtest.asm" /* -------------------------------------------------- Test and Clear Ram Test and clear 64k ram with $0000. "run-through" version: no ret at end ram_test should detect defective bits, defective chips, total failure of ram, defective data lines and defective address lines. failure in first loop: defective word at a0: issue with data lines? Bit always 0, always 1, shortened? */ // in: - // out: - // mod: alu,a1,a0,dtmp // Check whole ram word by word: // Store and read 16 x single bit 1 and 16 x single bit 0 ld atmp,$ // error position ld a0,$0000 // a0 -> ram do ld alu,$8000 // alu = pattern = $8000 --> $0001 ld dtmp,alu do cpl ld (a0),alu tst dtmp // toggle data on bus tst (a0) // delay 16 MHz equ (a0) // compare ld dtmp,alu : z jp 0,error // defective word at a0 cpl ld (a0),alu tst dtmp tst (a0) // delay 16 MHz equ (a0) // compare ld dtmp,alu : z jp 0,error // defective word at a0 ld sr,alu,nc // note: data bit 0 on bus ld alu,sr : bit0 // note: test for bit0 until 1 // note: conditional branch // same byte, next bit inc a0 tst a0 until z // next byte // now: all RAM[?] = $01 // Check for folding (defective address lines) and clear ram to $0000: // ld a0,$0000 // a0 = pointer ist schon // ld dtmp,1 // const: 1 ist schon do ld alu,(a0) sub dtmp // -1 ld (a0++),alu : z // $01 -> $00 while 1 // Abort if ram cell did not contain $0001: // either due to folded addresses due to defective address line // or because entire 64k were cleared. // a0 points behind the mirrored cell or at $0001 if entire 64k are ok: xor alu // if stopped because 64k have been cleared: ld (--a0),alu // clear ram[$0000] tst a0 TRAP !z if !z // * TRAP ld atmp,$ // * TRAP jp error // * TRAP then // * TRAP // --- file: "ramtest.asm" --- //#include "cmd_lo.asm" clr led_grn // 2nd half of test loop passed jp start // again? // #include "ldir.asm" // TODO: // IO // Interrupt // --- file: "test.asm" ---