diff --git a/CHIPOS68.asm b/CHIPOS68.asm index 080933d..45567b8 100755 --- a/CHIPOS68.asm +++ b/CHIPOS68.asm @@ -140,8 +140,14 @@ EXCALL: LDAB PIR ; GET INSTR REG CMPA #$EE BEQ RETDO RTS ; NOP, FETCH +; + ORG $C079 +; ERASE: CLRA ; WRITE ZEROS TO SCREEN LDX #DISBUF ; POINT TO DISPLAY BUFF +; + ORG $C07D +; FILL: STAA 0,X ; FILL SCREEN WITH ACC-A INX CPX #ENDBUF ; DONE? @@ -250,6 +256,8 @@ PUTVX: LDX VXLOC ; REPLACE VX RTS ; ; RANDOM BYTE GENERATOR +; + ORG $C132 ; RANDOM: LDAA #$C0 ; HIGH-ORDER BYTE OF RNDX = STAA RNDX ; =MSB OF CHIP8 START ADRS @@ -313,6 +321,8 @@ LETIV: CLRB ; 16-BIT ADD VX TO I ; ; COPY COMPRESSED DIGIT PATTERN (FROM TABLE) ; TO 5-BYTE ARRAY (DDPAT), & SET I FOR 'SHOW', +; + ORG $C193 ; LETDSP: LDX #HEXTAB-2 ; POINT TO HEX DIGIT PATTERNS , ANDA #$0F ; ISOLATE LS DIGIT @@ -358,6 +368,9 @@ HEXTAB: FDB $F6DF ; 0 FDB $934F ; F ; LETDEQ: LDX I ; GET MI POINTER +; + ORG $C1E0 +; LDAB #100 ; N=100 BSR DECI ; CALC 100'S DIGIT LDAB #10 ; N=10 @@ -399,7 +412,13 @@ MOVX1: PULA ; GET NEXT V ; SHOW: LDAB PIR+1 ; GET N (OPCODE LSB) CLR VF ; CLEAR OVERLAP FLAG +; + ORG $C224 +; SHOWI: LDX I ; POINT TO PATTERN BYTES +; + ORG $C226 +; SHOWX: LDAA #$01 ; SET DISPLAY ADRS MSB = STAA BLOC ; = DISBUF HIGH-ORDER BYTE. ANDB #$0F ; COMPUTE NO. OF BYTES (N) @@ -444,6 +463,8 @@ SHOWUP: TAB ; UPDATE DISPLAY BYTE SHOWR: RTS ; ; COMPUTE ADRS OF DISPLAY BYTE AT COORDS(B, VY): +; + ORG $C275 ; DISLOC: LDAA VY ; FETCH Y COORD ANDA #$1F ; MASK TO 5 BITS FOR WRAP-ROUN @@ -460,6 +481,8 @@ DISLOC: LDAA VY ; FETCH Y COORD RTS ; ; KEYPAD ROUTINES +; + ORG $C287 ; PAINZ: LDAB #$F0 ; INITIALIZE PORT PAINV: LDX #PIAA ; (ENTRY PT FOR INV. DDR) @@ -471,6 +494,8 @@ PAINV: LDX #PIAA ; (ENTRY PT FOR INV. DDR) RTS ; ; KEYPAD INPUT SERVICE ROUTINE +; + ORG $C297 ; KEYINP: BSR PAINZ ; RESET KEYPAD PORT CLR BADRED ; RESET BAD-READ FLAG @@ -501,6 +526,8 @@ KBILD1: INCA ; (A=RESULT) RTS ; ; GETKEY WAIT FOR KEYDOWN, THEN INPUTS +; + ORG $C2C4 ; GETKEY: STX XTEMP ; SAVE X FOR CALLING ROUTINE GETK1: BSR PAINZ ; RESET PORT, CLEAR FLAGS @@ -518,10 +545,15 @@ HEXK1: BSR BLEEP ; O.K. ACKNOWLEDGE RTS ; RETURN (WITH A