mirror of https://github.com/mist64/cbmsrc.git
Michael Steil
4 years ago
20 changed files with 3117 additions and 0 deletions
@ -0,0 +1,131 @@
|
||||
.PAGE 'ALTII4 11/04/80' |
||||
; |
||||
; |
||||
.SKIP 3 |
||||
; MICROTUS IRQ HANDLER |
||||
; |
||||
REPET |
||||
; |
||||
REPEX |
||||
LDA ROLVEC+1 ;CALL IRQ ROUTINE AS A SUBROUTINE |
||||
PHA |
||||
LDA ROLVEC |
||||
PHA ;A RETURN ADR |
||||
LDA #0 ;A FAKE STATUS (BREAK FLAG CLEAR) |
||||
PHA ;A FAKE STATUS |
||||
PHA ;A FAKE A REG |
||||
PHA ;A FAKE X REG |
||||
PHA ;A FAKE Y REG |
||||
JMP (KEYS) ;DO IRQ KEYSCAN |
||||
.SKIP 3 |
||||
; READ BYTE MODIFY AND BACKUP |
||||
; A=# OF BYTES TO MOD |
||||
; |
||||
BYTMOD STA TMPC ;TEMP CTR |
||||
PHA |
||||
BY100 JSR RDOC ;SKIP DELIMITER |
||||
JSR BYTE ;READ 1 BYTE AND MOD |
||||
BNE BY100 ;IF NOT DONE |
||||
PLA |
||||
BY200 EOR #$FF ;MAKE NEG FOR BACKUP |
||||
JMP TMPA10 ;ADJUST TMP0 |
||||
.SKIP 3 |
||||
; DISPLAY MEMORY AND ASCII |
||||
; |
||||
INTGRT |
||||
LDA #$40 ;FLAG ASCII DUMP |
||||
.BYT $2C |
||||
DSPLYM |
||||
LDA #0 |
||||
STA TMPC ;INDICATE HEX DUMP |
||||
JSR RANGE ;FIND START ADR AND END ADR |
||||
INT100 LDX WRAP ;WRAP OVER $FFFF |
||||
BNE INTEND ;YES |
||||
JSR DCMP ;DONE ? |
||||
BCC INTEND ;YES |
||||
BIT TMPC ;IS IT AN INTEROGATE? |
||||
BVC DOMEM ;BRANCH IF NOT |
||||
JSR INTONE ;ELSE DISPLAY ASCII |
||||
JMP SCHECK |
||||
DOMEM |
||||
JSR HEXDMP ;DISPLAY 5 BYTES IN HEX |
||||
SCHECK |
||||
JSR STOP1 ;STOP KEY ? |
||||
BNE INT100 ;NO |
||||
INTEND JMP DISSTR ;CURSOR UP, START |
||||
.SKIP 3 |
||||
; INTERROGATE ONE LINE |
||||
; |
||||
INTONE |
||||
JSR CRLF |
||||
INTO10 LDX #'. ;PRINT ".' " |
||||
LDA #'' |
||||
JSR WRTWO |
||||
JSR SPACE |
||||
JSR WROA ;PRINT ADDRESS |
||||
LDA #$12 ;DISPLAY IT IN RVS |
||||
JSR WRT |
||||
LDY #ISIZE ;PRINT ISIZE # ASCII BYTES |
||||
LDX #0 ;FOR INDIRECT |
||||
INTO20 JSR FROMR0 ;GET BYTE |
||||
AND #$7F ;CONVERT TO ASCII ONLY |
||||
CMP #$20 ;A CONTROL CHAR ? |
||||
BCS INTO30 ;NO |
||||
LDA #'. ;PRINT A PERIOD INSTEAD |
||||
INTO30 JSR WRT ;PRINT IT |
||||
CMP #$22 ;WAS IT A DOUBLE QUOTE ? |
||||
BNE INTO40 ;BRANCH IF NOT |
||||
INTO35 LDA #$14 ;DELETE IT |
||||
JSR WRT |
||||
LDA #$22 ;AND PRINT IT AGAIN |
||||
JSR WRT |
||||
INTO40 JSR INCTMP ;NEXT CHAR |
||||
DEY |
||||
BNE INTO20 |
||||
LDA #$92 ;TURN OFF RVS |
||||
JSR WRT ;DO IT AND RETURN |
||||
LDA TMP0 ;BACKUP UP FOR HEX DUMP |
||||
SEC |
||||
SBC #ISIZE |
||||
STA TMP0 |
||||
BCS INTO50 |
||||
DEC TMP0+1 |
||||
INTO50 LDA #ISIZE ;DUMP ISIZE BYTES |
||||
JMP DM |
||||
.SKIP 3 |
||||
; |
||||
; DISPLAY ONE LINE - MSIZE # BYTES - IN HEX |
||||
; |
||||
HEXDMP JSR CRLF ;START ON NEXT LINE |
||||
HEXDM2 LDX #'. ;ENTRY WITHOUT GOING TO NEXT LINE |
||||
LDA #': |
||||
JSR WRTWO ;PRINT ".:" |
||||
JSR WROA ;PRINT THE ADDRESS OF THE LINE |
||||
LDA #MSIZE ;DISPLAY MSIZE # BYTES |
||||
JMP DM ;GENERATE DISPLAY AND RETURN |
||||
.SKI 3 |
||||
; ALTER MEMORY |
||||
; |
||||
ALTMEM JSR SKTMP0 ;SKIP SPACES READ ADR |
||||
LDA #MSIZE |
||||
JSR BYTMOD ;MOD MSIZE # BYTES |
||||
JSR CURUP ;CURSOR UP |
||||
JSR HEXDMP ;DISPLAY ONE LINE |
||||
LDA #': ;A ":" |
||||
STA KEYD |
||||
LDA #0 ;A NULL IN KEYBUFFER |
||||
JMP AS701 |
||||
.SKIP 3 |
||||
; INPUT RANGE START ADR AND MAYBE END ADR |
||||
; |
||||
RANGE JSR SKTMP0 ;READ SA MOVE TO TMP2 |
||||
STA TMP2 |
||||
STX TMP2+1 |
||||
JSR RDT ;GET NEXT CHAR |
||||
CMP #$0D ;A RETURN ? |
||||
BEQ RNG300 ;YES - LEAVE END ADR SAME AS START |
||||
JSR RDTMP2 ;GET END ADR |
||||
RNG300 |
||||
JMP CRLF |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,197 @@
|
||||
.PAGE 'ASMII4 11/02/80' |
||||
; SIMPLE ASSEMBLER |
||||
; SYNTAX A 1111 LDA ($00,X) |
||||
; SYNTAX A 1111 DEX: |
||||
; :=TERMINATOR |
||||
; |
||||
ASSM JSR SKADR ;SKIP SP'S READ SA TO TMP2 |
||||
STA TMP2 |
||||
STX TMP2+1 |
||||
AS010 LDX #0 |
||||
STX MTCH+1 ;CLEAR LEFT MNEMONIC |
||||
AS020 JSR RDOC ;GET A CHAR |
||||
CMP #$20 ;IS IT A SPACE ? |
||||
BEQ AS010 ;YES - START AGAIN |
||||
STA MSAL,X ;NO - SAVE CHAR |
||||
INX |
||||
CPX #3 ;GOT THREE CHARS ? |
||||
BNE AS020 ;NO - LOOP |
||||
AS030 DEX ;SQUISHED ALL THREE ? |
||||
BMI AS045 ;YES |
||||
LDA MSAL,X ;NO - FIRST IN LAST OUT |
||||
SEC ;NO BORROW |
||||
SBC #$3F ;NORMALIZE |
||||
LDY #5 ;SET FOR 5 SHIFT RIGHTS |
||||
AS040 LSR A |
||||
ROR MTCH+1 ;LEFT MNEMONIC |
||||
ROR MTCH ;RIGHT MNEMONIC |
||||
DEY ;DONE 5 SHIFTS? |
||||
BNE AS040 ;NO-LOOP |
||||
BEQ AS030 ;ALWAYS |
||||
AS045 LDX #2 ;MOVE INDEX PAST MNEMONIC |
||||
AS050 JSR RDT ;GET A CHAR |
||||
CMP #$0D ;A CR? |
||||
BEQ AS100 ;YES-DONE |
||||
CMP #$3A ;A ":" ? |
||||
BEQ AS100 ;YES-DONE |
||||
CMP #$20 ;A SPACE |
||||
BEQ AS050 ;YES-SKIP IT |
||||
JSR CHRTST ;A HEX #? |
||||
BCS AS070 ;NO-BUFFER IF |
||||
JSR RDOB2 ;FIN A READ BYTE |
||||
LDY TMP0 ;SHIFT TMP0 TO TMP0+1 |
||||
STY TMP0+1 |
||||
STA TMP0 ;SAVE BYTE |
||||
LDA #'0 ;BUFFER ASCII 0 |
||||
STA MTCH,X |
||||
INX |
||||
AS070 STA MTCH,X |
||||
INX |
||||
BNE AS050 ;BRANCH ALWAYS |
||||
AS100 STX TMP10 ;SAVE INPUT # OF CHARS |
||||
LDX #0 |
||||
STX WRAP ;START TRIAL AT ZERO |
||||
AS110 LDX #0 |
||||
STX TMPC ;DISA INDEX=0 |
||||
LDA WRAP ;GET TRIAL BYTE |
||||
JSR DSET ;DIGEST IT |
||||
LDX FORMAT ;SAVE FORMAT FOR LATER |
||||
STX TMP10+1 |
||||
TAX ;INDEX INTO MNEMONIC TABLE |
||||
LDA MNEMR,X ;GET COMPRESSED |
||||
JSR TSTX ; MNEMONIC AND TEST |
||||
LDA MNEML,X |
||||
JSR TSTX |
||||
LDX #6 ;SIX FORMAT BITS |
||||
AS210 CPX #3 |
||||
BNE AS230 |
||||
LDY LENGTH |
||||
BEQ AS230 ;SKIP-SINGLE BYTE INSTR |
||||
AS220 LDA FORMAT |
||||
CMP #$E8 ;A RELATIVE INSTR? |
||||
LDA #'0 ;TEST ZEROS |
||||
BCS AS250 ;NO-3 BYTE |
||||
JSR TST2 ;TEST A BYTE,2 CHARS |
||||
DEY |
||||
BNE AS220 |
||||
AS230 ASL FORMAT |
||||
BCC AS240 |
||||
LDA CHAR1-1,X |
||||
JSR TSTX ;TEST SYNTAX |
||||
LDA CHAR2-1,X |
||||
BEQ AS240 |
||||
JSR TSTX ;TEST MORE SYNTAX |
||||
AS240 DEX |
||||
BNE AS210 |
||||
BEQ AS300 |
||||
AS250 JSR TST2 ;TEST A WORD,4 CHARS |
||||
JSR TST2 |
||||
AS300 LDA TMP10 ;CHECK # CHARS OF BOTH |
||||
CMP TMPC |
||||
BEQ AS310 ;MATCH, SKIP |
||||
JMP TST05 ;FAIL |
||||
AS310 JSR T2T2 ;TMP0=SA,TMP2=DATA |
||||
LDY LENGTH |
||||
BEQ AS500 ;IF ONLY 1 BYTE INSTR SKIP |
||||
LDA TMP10+1 ;GET SAVED FORMAT |
||||
CMP #$9D ;A RELATIVE INSTR? |
||||
BNE AS400 ;NO-SKIP |
||||
JSR DCMP ;CALCULATE A RELATIVE |
||||
BCC AS320 |
||||
TYA ;OUT OF RANGE,Y=0 |
||||
BNE AERR |
||||
LDX DIFF |
||||
BMI AERR |
||||
BPL AS340 |
||||
AS320 INY ;OUT OF RANGE,Y=$FF |
||||
BNE AERR |
||||
LDX DIFF |
||||
BPL AERR |
||||
AS340 DEX ;SUBTRACT 2 FOR INSTR |
||||
DEX |
||||
TXA |
||||
LDY LENGTH ;SET INDEX TO LENGTH |
||||
BNE AS420 ;BRANCH ALWAYS |
||||
AS400 LDA TMP2-1,Y ;NO-PUT BYTE OUT THERE |
||||
AS420 JSR PUTBYY ;RELOCATE TMP0 AND STORE DATA IN .A |
||||
DEY |
||||
BNE AS400 |
||||
AS500 LDA WRAP ;GET GOOD OP CODE |
||||
JSR PUTBYY ;PUT OUT THERE |
||||
LDY #'A' ;PRT '.A ' |
||||
AS600 STY KEYD ;PUT NEXT NUMBER IN KEYBUFFER |
||||
JSR CURUP ;CURSOR UP |
||||
JSR DISSPC ;DISASSEMBLE ONE LINE |
||||
JSR TMPADJ ;ADJUST TMP0 FOR NEXT INSTR |
||||
AS700 LDA #$20 ;SPACES |
||||
AS701 |
||||
STA KEYD+1 |
||||
LDA TMP0+1 ;PUT NEW HI ADR IN |
||||
JSR BUFASC ;CONVERT TO HEX |
||||
STX KEYD+2 |
||||
STA KEYD+3 |
||||
LDA TMP0 ;PUT NEW LO ADR IN |
||||
JSR BUFASC |
||||
STX KEYD+4 |
||||
STA KEYD+5 |
||||
LDA #$20 |
||||
STA KEYD+6 |
||||
LDA #7 ;SET CHAR COUNT IN TYPE AHEAD BUFFER |
||||
STA NDX |
||||
JMP STRT |
||||
.SKIP 3 |
||||
;TEST CHAR IN A WITH CHAR IN MTCH |
||||
; |
||||
TST2 JSR TSTX ;DO TWO TESTS |
||||
TSTX STX SAVX |
||||
LDX TMPC ;GET CURRENT POSITION |
||||
CMP MTCH,X ;SAME CHAR |
||||
BEQ TST10 ;YES-SKIP |
||||
PLA ;PULL JSR OFF STACK |
||||
PLA |
||||
TST05 INC WRAP ;TRY NEXT TRIAL |
||||
BEQ AERR ;=0 TRIED ALL,SORRY |
||||
JMP AS110 |
||||
AERR JMP ERROPR |
||||
TST10 INX |
||||
STX TMPC |
||||
LDX SAVX ;RESTORE X |
||||
RTS |
||||
.SKIP 3 |
||||
; CHARACTER TEST |
||||
; TEST FOR CHAR BETWEEN 0-F |
||||
; IF 0<=CHAR<=F THEN CARRY=0 |
||||
; |
||||
CHRTST CMP #'0 |
||||
BCC CHR10 |
||||
CMP #'G |
||||
RTS |
||||
CHR10 SEC |
||||
CHRTS RTS |
||||
.SKIP 3 |
||||
; SKIP PRINT IF CHAR SAME AS PTCH |
||||
; |
||||
CHKPCH CMP PTCH ;SKIP THIS CHAR ? |
||||
BNE CCWRT ;ALWAYS |
||||
RTS |
||||
.SKIP 3 |
||||
; PRINT CURSOR UP |
||||
; |
||||
CURUP LDA #$91 ;CURUP |
||||
CCWRT JMP WRT |
||||
.SKIP 3 |
||||
; CONVERT BYTE TO HEX ASCII |
||||
; X=HI NYBBLE A=LO NYBBLE |
||||
; |
||||
BUFASC PHA ;SAVE BYTE |
||||
LSR A ;DO HI NYBBLE |
||||
LSR A |
||||
LSR A |
||||
LSR A |
||||
JSR ASCII ;MAKE HEX ASCII |
||||
TAX ;SAVE IN X |
||||
PLA ;RESTORE BYTE |
||||
AND #$0F ;DO LO NYBBLE |
||||
JMP ASCII |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,37 @@
|
||||
*=$9110 ;DEVICE1 6522 (PAGE2 NMI) |
||||
D1ORB *=*+1 |
||||
D1ORAH *=*+1 |
||||
D1DDRB *=*+1 |
||||
D1DDRA *=*+1 |
||||
D1T1L *=*+1 |
||||
D1T1H *=*+1 |
||||
D1T1LL *=*+1 |
||||
D1T1LH *=*+1 |
||||
D1D2L *=*+1 |
||||
D1T2H *=*+1 |
||||
D1SR *=*+1 |
||||
D1ACR *=*+1 |
||||
D1PCR *=*+1 |
||||
D1IFR *=*+1 |
||||
D1IER *=*+1 |
||||
D1ORA *=*+1 |
||||
.SKI2 |
||||
*=$9120 ;DEVICE2 6522 (PAGE3 IRQ) |
||||
COLM ;KEYBOARD MATRIX |
||||
D2ORB *=*+1 |
||||
ROWS ;KEYBOARD MATRIX |
||||
D2ORAH *=*+1 |
||||
D2DDRB *=*+1 |
||||
D2DDRA *=*+1 |
||||
D2T1L *=*+1 |
||||
D2T1H *=*+1 |
||||
D2T1LL *=*+1 |
||||
D2T1LH *=*+1 |
||||
D2T2L *=*+1 |
||||
D2T2H *=*+1 |
||||
D2SR *=*+1 |
||||
D2ACR *=*+1 |
||||
D2PCR *=*+1 |
||||
D2IFR *=*+1 |
||||
D2IER *=*+1 |
||||
D2ORA *=*+1 |
@ -0,0 +1,194 @@
|
||||
.PAGE 'DISII4 11/03/80' |
||||
; DISASSEMBLE MEMORY |
||||
; SYNTAX D 1000 |
||||
; SYNTAX D 1000-2000 |
||||
; |
||||
DISA JSR RANGE ;READ SA AND MAYBE EA |
||||
DIS200 JSR DCMP ;DONE ? |
||||
BCC DISSTR ;YES |
||||
LDY #', ;SETUP FOR MOD DISASSEMBLE |
||||
JSR DISSPC ;NO - DISASSEMBLE ANOTHER |
||||
JSR TMPADJ ;ADJUST TMP0 NEXT OP CODE |
||||
JSR STOP1 ;STOP KEY ? |
||||
BNE DIS200 ;NO - KEEP GOING |
||||
DISSTR JSR CURUP ;PRINT CUSOR UP |
||||
BNE SSTR ;ALWAYS I HOPE ! |
||||
DIS300 JSR ALTRIT |
||||
DIS400 JSR WROA ;PRINT PC |
||||
JSR SPACE |
||||
JSR GDSET ;GET INSTR AND DIGEST IT |
||||
PHA ;SAVE INDEX TO MNEMONIC |
||||
JSR DISDMP ;DO DISASSEMBLY HEX DUMP |
||||
PLA ;RESTORE INDEX TO MNEMONIC |
||||
LDX #3 ;3 CHARS FOR MNEMONIC |
||||
DIS500 JSR PRMNE ;PRINT MNEMONIC |
||||
LDX #6 ;SIX FORMAT BITS |
||||
PRADR1 CPX #3 |
||||
BNE PRADR3 ;IF X=3 PRT ADR VAL |
||||
LDY LENGTH |
||||
BEQ PRADR3 ;NO PRT IF LENGTH=0 |
||||
PRADR2 LDA FORMAT |
||||
CMP #$E8 ;RELATIVE ADDRESSING MODE? |
||||
JSR R0BYY ;GET A BYTE FROM RELOCATED ADDR AND INDEXED BY .Y |
||||
BCS RELADR ;YES |
||||
JSR WROBX ;NO-PRT 1 OR 2 BYTE ADR |
||||
DEY ;MOST SIGNIFICANT BYTE FIRST |
||||
BNE PRADR2 |
||||
PRADR3 ASL FORMAT ;TEST NEXT FORMAT BIT |
||||
BCC PRADR4 ;IF 0 NO PRT |
||||
LDA CHAR1-1,X |
||||
JSR CHKPCH ;CHECK FOR A PRINT |
||||
LDA CHAR2-1,X ;IF 0 NO PRT |
||||
BEQ PRADR4 |
||||
JSR CHKPCH |
||||
PRADR4 DEX |
||||
BNE PRADR1 |
||||
RTS ;RETURN IF DONE 6 FORMAT BITS |
||||
RELADR JSR PCADJ3 ;PCL,H+DISP+1 TO A,Y |
||||
TAX |
||||
INX |
||||
BNE PRNTYX |
||||
INY |
||||
PRNTYX TYA |
||||
PRNTAX JSR WROBX ;PRT TARGET OF BRANCH |
||||
PRNTX TXA |
||||
;SAVE X WRITE A BYTE |
||||
; |
||||
WROBX STX SAVX |
||||
JSR WROB |
||||
LDX SAVX |
||||
RTS |
||||
.SKIP 3 |
||||
; ADJUST TMP0 BY VALUE IN LENGTH |
||||
; A=0 THEN TMP0=TMP0+1 |
||||
; A=FF THEN TMP0=TMP0-1 |
||||
; |
||||
TMPADJ LDA LENGTH |
||||
TMPA10 JSR PCADJ2 |
||||
STA TMP0 |
||||
STY TMP0+1 |
||||
RTS |
||||
.SKIP 3 |
||||
; ADJUST PC A=LO Y=HI |
||||
; |
||||
PCADJ2 SEC ; 2=3-BYTES |
||||
PCADJ3 LDY TMP0+1 |
||||
TAX ;TEST DISP SIGN FOR REL BRANCH) |
||||
BPL PCADJ4 ;EXTEND NEG BY DEC PCH |
||||
DEY |
||||
PCADJ4 ADC TMP0 ;PCL+LENGTH(OR DISP)+ |
||||
BCC PCRTS ; +1 TO A CARRY INTO |
||||
INY ; Y(PCH) |
||||
PCRTS RTS |
||||
.SKIP 3 |
||||
;DISASSEMBLER INSTRUCTION HEX DUMP |
||||
; |
||||
DISDMP |
||||
LDY LENGTH ;ONE LESS THAN INSTR LENGTH |
||||
INY |
||||
TYA |
||||
PHA ;SAVE LENGTH FOR BACKING UP |
||||
JSR DM ;DUMP THIS # OF BYTES |
||||
PLA |
||||
STA TMPC2 ;BACK UP |
||||
SEC |
||||
LDA TMP0 |
||||
SBC TMPC2 |
||||
STA TMP0 |
||||
BCS DSD30 |
||||
DEC TMP0+1 |
||||
DSD30 LDA LENGTH ;PRINT SPACES FOR LOOKS |
||||
CLC |
||||
ADC LENGTH |
||||
ADC LENGTH |
||||
TAY |
||||
DSD50 LDA #$20 |
||||
JSR WRT |
||||
INY |
||||
CPY #7 ;PRINTS 1,4, OR 7 SPACES |
||||
BNE DSD50 |
||||
RTS |
||||
.SKIP 3 |
||||
;DISASSEMBLER DIGEST ROUTINE |
||||
; |
||||
DSET TAY |
||||
LSR A ;EVEN/ODD TEST |
||||
BCC IEVEN |
||||
LSR A ;TEST B1 |
||||
BCS ERR ;XXXXXX11 INSTR BAD |
||||
CMP #$22 |
||||
BEQ ERR ;10001001 INSTR BAD |
||||
AND #$7 ;MASK 3 BITS FOR ADR MODE |
||||
ORA #$80 ;ADD INDEXING OFFSET |
||||
IEVEN LSR A ;LEFT/RIGHT TEST |
||||
TAX |
||||
LDA MODE,X ;INDEX INTO MODE TABLE |
||||
BCS RTMODE ;IF CARRY SET USE LSB FOR |
||||
LSR A ; PRINT FORMAT INDEX |
||||
LSR A |
||||
LSR A ; IF CARRY CLR USE MSB |
||||
LSR A |
||||
RTMODE AND #$0F ;MASK FOR 4-BIT INDEX |
||||
BNE GETFMT ;$0 FOR BAD OPCODES |
||||
ERR LDY #$80 ;SUB $80 FOR BAD OPCODE |
||||
LDA #0 ;SET FORMAT INDEX TO ZERO |
||||
GETFMT TAX |
||||
LDA MODE2,X ;INDEX INTO PRT FORMAT TAB |
||||
STA FORMAT ;SAVE FOR ADR FIELD FORMAT |
||||
AND #3 ;MASK 2-BIT LENGTH. 0=1BYTE |
||||
STA LENGTH ;1=2BYTE,2=3BYTE |
||||
TYA ;OP CODE |
||||
AND #$8F ;MASK FOR 1XXX1010 TEST |
||||
TAX ;SAVE IN X |
||||
TYA ;OP CODE AGAIN |
||||
LDY #3 |
||||
CPX #$8A |
||||
BEQ MNNDX3 |
||||
MNNDX1 LSR A |
||||
BCC MNNDX3 ;FORM INDEX INTO MNEMONIC TAB |
||||
LSR A |
||||
MNNDX2 LSR A ;1XXX1010->00101XXX |
||||
ORA #$20 ;XXXYYY01->00111XXX |
||||
DEY ;XXXYYY10->00110XXX |
||||
BNE MNNDX2 ;XXXYY100->00100XXX |
||||
INY ;XXXXX000->000XXXXX |
||||
MNNDX3 DEY |
||||
BNE MNNDX1 |
||||
RTS |
||||
.SKIP 3 |
||||
;PRINT OP CODE BYTES IN HEX |
||||
; |
||||
PROP JSR R0BYY ;GET OP CODE |
||||
JSR WROBX |
||||
LDX #1 |
||||
PROPBL JSR SPCX ;PRT INSTR 1 TO 3 BYTES |
||||
CPY LENGTH |
||||
INY |
||||
BCC PROP |
||||
LDX #3 ;SKIP 3 SPACES |
||||
CPY #3 |
||||
BCC PROPBL ;NO |
||||
RTS |
||||
.SKIP 3 |
||||
;PRINT MNEMONIC |
||||
; ENTER X=3 CHARACTERS |
||||
; |
||||
PRMNE TAY |
||||
LDA MNEML,Y ;FETCH 3 CHAR MNEMONIC |
||||
STA TMP10 |
||||
LDA MNEMR,Y |
||||
STA TMP10+1 |
||||
PRMN1 LDA #0 |
||||
LDY #5 |
||||
PRMN2 ASL TMP10+1 ;SHIFT 5 BITS OF CHAR |
||||
ROL TMP10 ; INTO A |
||||
ROL A ;CLEAR CARRY |
||||
DEY |
||||
BNE PRMN2 |
||||
ADC #$3F ;ADD '?' OFFSET |
||||
JSR WRT ;PRINT IT |
||||
DEX |
||||
BNE PRMN1 |
||||
JMP SPACE ;FINISH WITH SPACE |
||||
.SKIP 3 |
||||
.END |
@ -0,0 +1,3 @@
|
||||
.PAGE 'ERRII4' |
||||
.OPT NOLIST,NOSYM |
||||
.FILE MICII4 |
@ -0,0 +1,51 @@
|
||||
;******************************************************************** |
||||
; |
||||
; GET A BYTE AT RELOCATED ADDRESS INDEXED BY .Y |
||||
; |
||||
;******************************************************************** |
||||
; |
||||
R0BYY |
||||
PHP |
||||
TSX ;CLEAR THE GOD DAMN BREAK FLAG!!! |
||||
LDA $101,X ;GET THE STATUS BYTE |
||||
AND $#EF ;MASK OUT THE BREAK FLAG |
||||
STA $101,X ;PUT BACK ON THE STACK |
||||
STY TEMPY |
||||
TYA |
||||
CLC |
||||
ADC TMP0 |
||||
STA R0 |
||||
LDA #0 |
||||
ADC TMP0+1 |
||||
STA R0+1 |
||||
CMP #01 ;IF RESULT IS IN ZERO PAGE THEN RELOCATE IT |
||||
BCS R0OK ;BRANCH IF OUTSIDE SYSTEMPAGE |
||||
; |
||||
LDA NORELO ;IS RELOCATION OFF? |
||||
BNE R0OK ;BRANCH IF SO |
||||
LDA R0 ; HAVE TO RELOCATE IT |
||||
ADC SPAGE |
||||
STA R0 |
||||
LDA R0+1 |
||||
ADC SPAGE+1 |
||||
STA R0+1 |
||||
; |
||||
R0OK |
||||
LDY #0 |
||||
LDA (R0),Y |
||||
LDY TEMPY |
||||
PLP |
||||
RTS |
||||
; |
||||
;----- PUT A BYTE INDEXED BY Y AND TMP0 |
||||
; |
||||
PUTBYY |
||||
PHA |
||||
JSR R0BYY ;SET UP R0 |
||||
STY TEMPY |
||||
LDY #0 |
||||
PLA ;GET THE BYTE I'M SUPPOSED TO STORE |
||||
STA (R0),Y |
||||
LDY TEMPY |
||||
RTS |
||||
.END |
@ -0,0 +1,284 @@
|
||||
.PAGE 'MANII4 11/03/80' |
||||
; ****** CONSTANTS ****** |
||||
; |
||||
CR = $0D ;ASCII RETURN CODE |
||||
SPERR = $10 ;TAPE ERROR |
||||
LLEN = 40 ;40 COLUMNS |
||||
WLKNUM = 59 ;WALK CLOCK COUNT |
||||
.SKIP 3 |
||||
; ****** Z-PAGE VARABLES ****** |
||||
; |
||||
MEMSIZ = $34 ;TOP OF MEMORY FOR BASIC |
||||
CINV = $90 ;INDIRECT VECTOR FOR IRQ |
||||
CBINV = $92 ;BRK RAM VECTOR |
||||
NMINV = $94 ;NMI RAM VECTOR |
||||
SATUS = $96 ;I/O OPERATION STATUS BYTE |
||||
LSTX = $97 ;LAST KEY INDEX |
||||
STKEY = $9B ;STOP KEY FLAG |
||||
VERCK = $9D ;LOAD OR VERIFY FLAG |
||||
NDX = $9E ;# CHARS IN KEYBUFFER |
||||
BLNSW = $A7 ;BLINK CURSOR SWITCH |
||||
BLNCT = $A8 ;CURSOR BLINK CTR |
||||
GDBLN = $A9 ;BEFORE BLINK CHAR |
||||
BLNON = $AA ;CHAR IS REVERSE FLAG |
||||
DFLTN = $AF ;DEFAULT INPUT DEVICE # |
||||
DFLTO = $B0 ;DEFAULT OUTPUT DEVICE # |
||||
PNT = $C4 ;LINE ADDRESS OF CURSOR |
||||
PNTR = $C6 ;COLUMN OF CURSOR |
||||
SAL = $C7 ;POINTER USED IN SCROLL DOWN |
||||
FNLEN = $D1 ;LENGTH OF CURRENT FILE NAME |
||||
FA = $D4 ;IEEE-488 FIRST ADDRESS |
||||
TBLX = $D8 ;ACTIVE CURSOR LINE |
||||
FNADR = $DA ;OFFSET FOR NEW LOCATER |
||||
TMP0 = $FB ;INDIRECT 1 |
||||
TMP2 = $FD ;INDIRECT 2 |
||||
.SKIP 3 |
||||
*=$027A ;USE CASS #1 BUFFER FOR VARABLES |
||||
PCH *=*+1 |
||||
PCL *=*+1 |
||||
FLGS *=*+1 |
||||
ACC *=*+1 |
||||
XR *=*+1 |
||||
YR *=*+1 |
||||
SP *=*+1 |
||||
INVH *=*+1 |
||||
INVL *=*+1 |
||||
SAVLS *=*+1 ;SAVE OF LAST KEY INDEX |
||||
DELAY *=*+1 ;DELAY BEFORE REPEATS |
||||
REPDY *=*+1 ;DELAY BETWEEN REPEATS |
||||
WSW *=*+1 ;FLAG FOR QUICK TRACE |
||||
SAVCMD *=*+1 ;LAST COMMAND LETTER |
||||
SAVX *=*+1 ;PLACE TO SAVE X |
||||
TMPC *=*+1 |
||||
TMPC2 *=*+1 |
||||
LENGTH *=*+1 ;DIS INSTR LENGTH |
||||
PTCH *=*+1 ;TEMP FOR DISA |
||||
MSAL *=*+2 |
||||
EAL *=*+2 |
||||
DIFF *=*+1 |
||||
TMP10 *=*+2 |
||||
WRAP *=*+1 ;WRAP FFFF FLAG |
||||
TMPC4 *=*+1 |
||||
FORMAT *=*+1 |
||||
BAD *=*+1 |
||||
BRKADR *=*+2 ;STOP ADR FOR QUICK TRACE |
||||
BRKCNT *=*+2 ;# OCCURENCES |
||||
TMP12 *=*+2 ;OCCURENCE CTR FOR QUICK |
||||
KEYS *=*+2 ;SAVED KEYBOARD IRQ VECTOR |
||||
NEWLC *=*+2 ;OFFSET FOR NEW LOCATER |
||||
RBUSY *=*+1 ;ROLL BUSY FLAG |
||||
MTCH *=*+64 ;64 CHAR MATCH BUFFER |
||||
.SKIP 2 |
||||
KEYD = $026F ;KEYBOAD INPUT BUF |
||||
BEGIN = $1000 ;START EXTRAMON HERE |
||||
.SKIP 3 |
||||
; ****** ROM ROUTINES ****** |
||||
.SKIP 3 |
||||
LD15B2 = $F322 ;LEVEL 2 MONITOR LOAD ENTRY |
||||
LD15B4 = $F356 ;LEVEL 4 MONITOR LOAD ENTRY |
||||
SV5B2 = $F6A4 ;LEVEL 2 MONITOR SAVE ENTRY |
||||
SV5B4 = $F6E3 ;LEVEL 4 MONITOR SAVE ENTRY |
||||
CLRCH = $FFCC ;CLEAR CHANNEL |
||||
BASIN = $FFCF ;INPUT A CHAR |
||||
GETIN = $FFE4 ;GET A CHAR |
||||
BSOUT = $FFD2 ;OUTPUT A CHAR |
||||
.SKIP 3 |
||||
; ****** INPUT/OUTPUT ****** |
||||
*=$9110 ;DEVICE1 6522 (PAGE2 NMI) |
||||
D1ORB *=*+1 |
||||
D1ORAH *=*+1 |
||||
D1DDRB *=*+1 |
||||
D1DDRA *=*+1 |
||||
D1T1L *=*+1 |
||||
D1T1H *=*+1 |
||||
D1T1LL *=*+1 |
||||
D1T1LH *=*+1 |
||||
D1D2L *=*+1 |
||||
D1T2H *=*+1 |
||||
D1SR *=*+1 |
||||
D1ACR *=*+1 |
||||
D1PCR *=*+1 |
||||
D1IFR *=*+1 |
||||
D1IER *=*+1 |
||||
D1ORA *=*+1 |
||||
.SKI2 |
||||
*=$9120 ;DEVICE2 6522 (PAGE3 IRQ) |
||||
COLM ;KEYBOARD MATRIX |
||||
D2ORB *=*+1 |
||||
ROWS ;KEYBOARD MATRIX |
||||
D2ORAH *=*+1 |
||||
D2DDRB *=*+1 |
||||
D2DDRA *=*+1 |
||||
D2T1L *=*+1 |
||||
D2T1H *=*+1 |
||||
D2T1LL *=*+1 |
||||
D2T1LH *=*+1 |
||||
D2T2L *=*+1 |
||||
D2T2H *=*+1 |
||||
D2SR *=*+1 |
||||
D2ACR *=*+1 |
||||
D2PCR *=*+1 |
||||
D2IFR *=*+1 |
||||
D2IER *=*+1 |
||||
D2ORA *=*+1 |
||||
.SKIP 4 |
||||
*= BEGIN |
||||
COLDS JMP INIT ;COLD START MONITOR |
||||
WARMS JMP BRKE ;WARM START MONITOR |
||||
.SKIP 3 |
||||
RDT JMP BASIN ;ALL INPUT THRU HERE |
||||
WRT JMP BSOUT ;ALL OUTPUT THRU HERE |
||||
.SKIP 3 |
||||
; INSTALL EXTRA MONITOR COMMANDS |
||||
; |
||||
INIT SEI ;STOP IRQ'S |
||||
LDA WWLK ;INIT NEW BRK VECTOR |
||||
LDX WWLK+1 |
||||
STA CBINV |
||||
STX CBINV+1 |
||||
LDA CINV ;GET OLD IRQ VECTOR |
||||
LDX CINV+1 |
||||
CMP WINTR ;CHANGED ALREADY ? |
||||
BNE INIT10 ;NO - GO CHANGE |
||||
CPX WINTR+1 |
||||
BEQ INIT20 ;YES - LEAVE BE |
||||
INIT10 STA KEYS |
||||
STX KEYS+1 |
||||
LDA WINTR ;INSTALL REPEAT KEYS |
||||
LDX WINTR+1 |
||||
STA CINV |
||||
STX CINV+1 |
||||
INIT20 |
||||
LDA WCOLDS |
||||
LDX WCOLDS+1 |
||||
CPX #$80 ;IN ROM ABOVE SCREEN ? |
||||
BCS INIT30 |
||||
STA MEMSIZ |
||||
STX MEMSIZ+1 |
||||
INIT30 LDA #$10 ;SET DELAYS FOR REPEAT |
||||
STA DELAY |
||||
STA REPDY |
||||
LDA #0 |
||||
STA WSW ;DO A BREAK |
||||
STA RBUSY ;NOT BUSY |
||||
CLI ;ALLOW IRQ'S |
||||
BRK |
||||
.SKIP 4 |
||||
BRKE |
||||
SEC |
||||
LDA PCL ;BACK UP ONE BYTE |
||||
SBC #1 |
||||
STA PCL |
||||
LDA PCH |
||||
SBC #0 |
||||
STA PCH |
||||
B5 JSR CRLF |
||||
LDX #'B ;SET X EQUAL TO B |
||||
B567 LDA #'* |
||||
JSR WRTWO |
||||
LDA #'R ;SET FOR R DISPLAY TO |
||||
; PERMIT IMMEDIATE |
||||
; ALTER FOLLOWING |
||||
; BREAKPOINT |
||||
BNE NWCMD ;ALWAYS |
||||
ERROPR LDA #$3F ;PRINT A "?" FOR AN ERROR |
||||
JSR WRT |
||||
STRT |
||||
JSR CRLF |
||||
STRT10 LDA #'. ;TYPE A PROMPTING '.' |
||||
JSR WRT |
||||
LDA #0 ;ZERO WRAP FLAG |
||||
STA WRAP |
||||
STA RBUSY ;NOT BUST NOW |
||||
LDX #$FF ;RESET THE STACK |
||||
TXS |
||||
ST1 JSR RDOC ;READ COMMAND. CHARACTER |
||||
; IS RETURNED IN A |
||||
CMP #'. ;IGNORE PROMPTING '.' |
||||
BEQ ST1 |
||||
CMP #$20 ;IGNORE SPACES |
||||
BEQ ST1 |
||||
.SKIP 3 |
||||
; SEARCH FOR COMMANDS |
||||
; |
||||
NWCMD LDX #NCMDS-1 |
||||
NW10 CMP CMDS,X |
||||
BNE NW20 |
||||
STA SAVCMD |
||||
TXA ;MULT BY TWO |
||||
ASL A |
||||
TAX ;INDEX INTO DISPATCH TABLE |
||||
.SKIP 3 |
||||
; DISPATCH TO COMMAND |
||||
; |
||||
LDA ADRS,X ;FAKE INDEXED JMP |
||||
STA TMP0 |
||||
LDA ADRS+1,X ;PUSH ADR-1 AND RTS |
||||
STA TMP0+1 |
||||
JMP (TMP0) |
||||
; |
||||
NW20 DEX |
||||
BPL NW10 |
||||
BMI ERROPR ;CMD NOT FOUND ERROR |
||||
.SKIP 3 |
||||
; DEC TMP0 OR TMP2 |
||||
; |
||||
DECT2 LDX #2 ;DEC TMP2 WORD |
||||
BNE DEC30 ;ALWAYS |
||||
DECT0 LDX #0 ;DEC TMP0 WORD |
||||
DEC30 LDY TMP0,X ;A BORROW? |
||||
BNE DEC20 ;NO-SKIP |
||||
LDY TMP0+1,X ;A MEMORY WRAP |
||||
BNE DEC10 ;NO-SKIP |
||||
INC WRAP ;YES-SET FLAG |
||||
DEC10 DEC TMP0+1,X |
||||
DEC20 DEC TMP0,X |
||||
DRTS RTS |
||||
.SKIP 3 |
||||
;DISASSEMBLE ONE LINE PRINT 9 SPACES |
||||
; |
||||
DISSPC LDA #0 ;PRINT ALL CHARS |
||||
STA PTCH |
||||
JSR DIS300 ;DIS. ONE |
||||
LDX #9 ;SET FOR 9 SPACES |
||||
.SKIP 3 |
||||
;PRINT # OF SPACES=X |
||||
; |
||||
SPCX JSR SPACE |
||||
DEX |
||||
BNE SPCX |
||||
RTS |
||||
.SKIP 3 |
||||
; EXCHANGE TMP REGISTERS |
||||
; |
||||
T0T10 LDX #2 ;EXCHANGE TMP0 WITH |
||||
T0T100 LDA TMP0-1,X ; TMP10 |
||||
PHA |
||||
LDA TMP10-1,X |
||||
STA TMP0-1,X |
||||
PLA |
||||
STA TMP10-1,X |
||||
DEX |
||||
BNE T0T100 |
||||
RTS |
||||
.SKIP 3 |
||||
; DOUBLE SUBTRACT |
||||
; DIFF=LO DIFFERENCE |
||||
; Y=HI DIFFERENCE |
||||
; A=0 IF ZERO DIFFERENCE |
||||
; |
||||
DCT10 LDA TMP10 ;TMP10-TMP0 |
||||
LDY TMP10+1 |
||||
JMP DC10 ;SKIP OVER |
||||
DCMP LDA TMP2 ;TMP2-TMP0 |
||||
LDY TMP2+1 |
||||
DC10 SEC |
||||
SBC TMP0 |
||||
STA DIFF |
||||
TYA ;HI BYTE IN Y |
||||
SBC TMP0+1 |
||||
TAY ;SAVE HI RESULT IN Y |
||||
ORA DIFF ;OR LO FOR EQUAL TEST |
||||
RTS |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,161 @@
|
||||
.SKIP 4 |
||||
*= BEGIN |
||||
COLDS JMP INIT ;COLD START MONITOR |
||||
WARMS JMP BRKE ;WARM START MONITOR |
||||
.SKIP 3 |
||||
RDT JMP BASIN ;ALL INPUT THRU HERE |
||||
WRT JMP BSOUT ;ALL OUTPUT THRU HERE |
||||
.SKIP 3 |
||||
; INSTALL EXTRA MONITOR COMMANDS |
||||
; |
||||
INIT SEI ;STOP IRQ'S |
||||
LDA WWLK ;INIT NEW BRK VECTOR |
||||
LDX WWLK+1 |
||||
STA CBINV |
||||
STX CBINV+1 |
||||
LDA CINV ;GET OLD IRQ VECTOR |
||||
LDX CINV+1 |
||||
CMP WINTR ;CHANGED ALREADY ? |
||||
BNE INIT10 ;NO - GO CHANGE |
||||
CPX WINTR+1 |
||||
BEQ INIT20 ;YES - LEAVE BE |
||||
INIT10 STA KEYS |
||||
STX KEYS+1 |
||||
LDA WINTR ;INSTALL REPEAT KEYS |
||||
LDX WINTR+1 |
||||
STA CINV |
||||
STX CINV+1 |
||||
INIT20 |
||||
LDA WCOLDS |
||||
LDX WCOLDS+1 |
||||
CPX #$80 ;IN ROM ABOVE SCREEN ? |
||||
BCS INIT30 |
||||
STA MEMSIZ |
||||
STX MEMSIZ+1 |
||||
INIT30 LDA #$10 ;SET DELAYS FOR REPEAT |
||||
STA DELAY |
||||
STA REPDY |
||||
LDA #0 |
||||
STA WSW ;DO A BREAK |
||||
STA RBUSY ;NOT BUSY |
||||
CLI ;ALLOW IRQ'S |
||||
BRK |
||||
.SKIP 4 |
||||
BRKE |
||||
SEC |
||||
LDA PCL ;BACK UP ONE BYTE |
||||
SBC #1 |
||||
STA PCL |
||||
LDA PCH |
||||
SBC #0 |
||||
STA PCH |
||||
B5 JSR CRLF |
||||
LDX #'B ;SET X EQUAL TO B |
||||
B567 LDA #'* |
||||
JSR WRTWO |
||||
LDA #'R ;SET FOR R DISPLAY TO |
||||
; PERMIT IMMEDIATE |
||||
; ALTER FOLLOWING |
||||
; BREAKPOINT |
||||
BNE NWCMD ;ALWAYS |
||||
ERROPR LDA #$3F ;PRINT A "?" FOR AN ERROR |
||||
JSR WRT |
||||
STRT |
||||
JSR CRLF |
||||
STRT10 LDA #'. ;TYPE A PROMPTING '.' |
||||
JSR WRT |
||||
LDA #0 ;ZERO WRAP FLAG |
||||
STA WRAP |
||||
STA RBUSY ;NOT BUST NOW |
||||
LDX #$FF ;RESET THE STACK |
||||
TXS |
||||
ST1 JSR RDOC ;READ COMMAND. CHARACTER |
||||
; IS RETURNED IN A |
||||
CMP #'. ;IGNORE PROMPTING '.' |
||||
BEQ ST1 |
||||
CMP #$20 ;IGNORE SPACES |
||||
BEQ ST1 |
||||
.SKIP 3 |
||||
; SEARCH FOR COMMANDS |
||||
; |
||||
NWCMD LDX #NCMDS-1 |
||||
NW10 CMP CMDS,X |
||||
BNE NW20 |
||||
STA SAVCMD |
||||
TXA ;MULT BY TWO |
||||
ASL A |
||||
TAX ;INDEX INTO DISPATCH TABLE |
||||
.SKIP 3 |
||||
; DISPATCH TO COMMAND |
||||
; |
||||
LDA ADRS,X ;FAKE INDEXED JMP |
||||
STA TMP0 |
||||
LDA ADRS+1,X ;PUSH ADR-1 AND RTS |
||||
STA TMP0+1 |
||||
JMP (TMP0) |
||||
; |
||||
NW20 DEX |
||||
BPL NW10 |
||||
BMI ERROPR ;CMD NOT FOUND ERROR |
||||
.SKIP 3 |
||||
; DEC TMP0 OR TMP2 |
||||
; |
||||
DECT2 LDX #2 ;DEC TMP2 WORD |
||||
BNE DEC30 ;ALWAYS |
||||
DECT0 LDX #0 ;DEC TMP0 WORD |
||||
DEC30 LDY TMP0,X ;A BORROW? |
||||
BNE DEC20 ;NO-SKIP |
||||
LDY TMP0+1,X ;A MEMORY WRAP |
||||
BNE DEC10 ;NO-SKIP |
||||
INC WRAP ;YES-SET FLAG |
||||
DEC10 DEC TMP0+1,X |
||||
DEC20 DEC TMP0,X |
||||
DRTS RTS |
||||
.SKIP 3 |
||||
;DISASSEMBLE ONE LINE PRINT 9 SPACES |
||||
; |
||||
DISSPC LDA #0 ;PRINT ALL CHARS |
||||
STA PTCH |
||||
JSR DIS300 ;DIS. ONE |
||||
LDX #9 ;SET FOR 9 SPACES |
||||
.SKIP 3 |
||||
;PRINT # OF SPACES=X |
||||
; |
||||
SPCX JSR SPACE |
||||
DEX |
||||
BNE SPCX |
||||
RTS |
||||
.SKIP 3 |
||||
; EXCHANGE TMP REGISTERS |
||||
; |
||||
T0T10 LDX #2 ;EXCHANGE TMP0 WITH |
||||
T0T100 LDA TMP0-1,X ; TMP10 |
||||
PHA |
||||
LDA TMP10-1,X |
||||
STA TMP0-1,X |
||||
PLA |
||||
STA TMP10-1,X |
||||
DEX |
||||
BNE T0T100 |
||||
RTS |
||||
.SKIP 3 |
||||
; DOUBLE SUBTRACT |
||||
; DIFF=LO DIFFERENCE |
||||
; Y=HI DIFFERENCE |
||||
; A=0 IF ZERO DIFFERENCE |
||||
; |
||||
DCT10 LDA TMP10 ;TMP10-TMP0 |
||||
LDY TMP10+1 |
||||
JMP DC10 ;SKIP OVER |
||||
DCMP LDA TMP2 ;TMP2-TMP0 |
||||
LDY TMP2+1 |
||||
DC10 SEC |
||||
SBC TMP0 |
||||
STA DIFF |
||||
TYA ;HI BYTE IN Y |
||||
SBC TMP0+1 |
||||
TAY ;SAVE HI RESULT IN Y |
||||
ORA DIFF ;OR LO FOR EQUAL TEST |
||||
RTS |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,352 @@
|
||||
.PAGE 'MANII4 11/03/80' |
||||
; ****** CONSTANTS ****** |
||||
; |
||||
CR = $0D ;ASCII RETURN CODE |
||||
SPERR = $10 ;TAPE ERROR |
||||
LLEN = 40 ;40 COLUMNS |
||||
NLINES = 25 ;25 DISPLAY LINES |
||||
WLKNUM = 9 ;WALK CLOCK COUNT |
||||
MSIZE = 8 ;# MEMORY BYTES TO DISPLAY |
||||
ISIZE = 8 ;# INTERROGATE BYTES TO SHOW |
||||
.SKIP 3 |
||||
; ****** Z-PAGE VARABLES ****** |
||||
; |
||||
MEMSIZ = $283 ;TOP OF MEMORY FOR BASIC |
||||
CINV = $314 ;INDIRECT VECTOR FOR IRQ |
||||
CBINV = $316 ;BRK RAM VECTOR |
||||
NMINV = $318 ;NMI RAM VECTOR |
||||
SATUS = $90 ;I/O OPERATION STATUS BYTE |
||||
LSTX = $C5 ;LAST KEY INDEX |
||||
STKEY = $91 ;STOP KEY FLAG |
||||
VERCK = $93 ;LOAD OR VERIFY FLAG |
||||
NDX = $C6 ;# CHARS IN KEYBUFFER |
||||
INDX = $C8 ;LENGTH OF CURENT LINE ON SCREEN |
||||
BLNSW = $CC ;BLINK CURSOR SWITCH |
||||
BLNCT = $CD ;CURSOR BLINK CTR |
||||
GDBLN = $CE ;BEFORE BLINK CHAR |
||||
BLNON = $CF ;CHAR IS REVERSE FLAG |
||||
DFLTN = $99 ;DEFAULT INPUT DEVICE # |
||||
DFLTO = $9A ;DEFAULT OUTPUT DEVICE # |
||||
PNT = $D1 ;LINE ADDRESS OF CURSOR |
||||
PNTR = $D3 ;COLUMN OF CURSOR |
||||
SAL = $AC ;POINTER USED IN SCROLL DOWN |
||||
EAL = $AE ;USE THIS FOR COLOR SCROLL DOWN |
||||
CMP0 = $B0 ;AND THIS TOO |
||||
FNLEN = $B7 ;LENGTH OF CURRENT FILE NAME |
||||
SA = $B9 ;SECONDARY ADDRESS FOR IEEE I/O |
||||
FA = $BA ;IEEE-488 FIRST ADDRESS |
||||
TBLX = $D6 ;ACTIVE CURSOR LINE |
||||
FNADR = $BB ;OFFSET FOR NEW LOCATER |
||||
TMP0 = $C1 ;INDIRECT 1 |
||||
TMP2 = $C3 ;INDIRECT 2 |
||||
ZPAGE = $F7 ;INDIRECT FOR ZERO PAGE SWAP |
||||
SPAGE = $F9 ;BASE ADDRESS OF SWAP PAGE |
||||
.SKIP 3 |
||||
*=$0000 ;ZERO PAGE VARIABLES ALL MY OWN |
||||
D6510 *=*+1 ;6510 DATA DIRECTION REGISTER |
||||
R6510 *=*+1 ;6510 DATA REGISTER |
||||
*=$0002 |
||||
PCH *=*+1 ;PROGRAM COUNTER AND REGISTERS |
||||
PCL *=*+1 |
||||
FLGS *=*+1 |
||||
ACC *=*+1 |
||||
XR *=*+1 |
||||
YR *=*+1 |
||||
SP *=*+1 |
||||
INVH *=*+1 |
||||
INVL *=*+1 |
||||
TEMPX *=*+1 ;TEMPORARY X INDEX REGISTER STORAGE |
||||
TEMPY *=*+1 ;TEMPORARY Y INDEX REGISTER STORAGE |
||||
R0 *=*+2 ;RESULTANT RELOCATION REGISTER |
||||
NORELO *=*+1 ;NO RELOCATION FLAG |
||||
WSW *=*+1 ;WALK STATUS WORD |
||||
OLDNMI *=*+2 ;SYSTEM'S NMI VECTOR |
||||
FULSPD *=*+1 ;WALK THEN GO FLAG |
||||
BRKADR *=*+2 ;ADDRESS OF BREAK POINT |
||||
BRKCNT *=*+2 ;# OF OCCURENCES BEFORE BREAK |
||||
KEYS *=*+2 ;INDIRECT JUMP FOR MY IRQ HANDLER |
||||
OPCODE *=*+1 ;OPCODE IS STORED HERE WHEN BREAKPOINT IS ON |
||||
; |
||||
; |
||||
SAVLS *=*+1 ;SAVE OF LAST KEY INDEX |
||||
DELAY *=*+1 ;DELAY BEFORE REPEATS |
||||
REPDY *=*+1 ;DELAY BETWEEN REPEATS |
||||
SAVCMD *=*+1 ;LAST COMMAND LETTER |
||||
SAVX *=*+1 ;PLACE TO SAVE X |
||||
TMPC *=*+1 |
||||
TMPC2 *=*+1 |
||||
LENGTH *=*+1 ;DIS INSTR LENGTH |
||||
PTCH *=*+1 ;TEMP FOR DISA |
||||
MSAL *=*+2 |
||||
DIFF *=*+1 |
||||
TMP10 *=*+2 |
||||
WRAP *=*+1 ;WRAP FFFF FLAG |
||||
TMPC4 *=*+1 |
||||
FORMAT *=*+1 |
||||
BAD *=*+1 |
||||
TMP12 *=*+2 ;OCCURENCE CTR FOR QUICK |
||||
NEWLC *=*+2 ;OFFSET FOR NEW LOCATER |
||||
RBUSY *=*+1 ;ROLL BUSY FLAG |
||||
OLDIER *=*+1 ;USER'S IRQ ENABLE REGISTER |
||||
MTCH *=*+64 ;64 CHAR MATCH BUFFER |
||||
.SKIP 2 |
||||
KEYD = $0277 ;KEYBOAD INPUT BUF |
||||
BEGIN = $8000 ;START VICMON HERE |
||||
.SKIP 3 |
||||
; ****** ROM ROUTINES ****** |
||||
.SKIP 3 |
||||
LD15B2 = $FFD5 ;MONITOR LOAD ENTRY |
||||
SV5B2 = $FFD8 ;MONITOR SAVE ENTRY |
||||
CLRCH = $FFCC ;CLEAR CHANNEL |
||||
BASIN = $FFCF ;INPUT A CHAR |
||||
GETIN = $FFE4 ;GET A CHAR |
||||
BSOUT = $FFD2 ;OUTPUT A CHAR |
||||
SETMSG = $FF90 ;ENABLE(.A=$80)/DISABLE(.A=0) KERNAL MESSAGES |
||||
NMI = $FE0C |
||||
IRQVEC = $FFFE |
||||
.SKIP 3 |
||||
; I/O DEVICES |
||||
; |
||||
VICSCN =$0400 ;SCREEN |
||||
* =$D000 |
||||
VICREG =* ;VIC REGISTERS |
||||
.SKI 2 |
||||
* =$D400 |
||||
SIDREG =* ;SID REGISTERS |
||||
.SKI 2 |
||||
* =$D800 |
||||
VICOL *=*+1024 ;VIC COLOR NYBBLES |
||||
.SKI 2 |
||||
* =$DC00 ;DEVICE1 6526 (PAGE1 IRQ) |
||||
ROWS ;KEYBOARD MATRIX |
||||
D1PRA *=*+1 |
||||
COLM ;KEYBOARD MATRIX |
||||
D1PRB *=*+1 |
||||
D1DDRA *=*+1 |
||||
D1DDRB *=*+1 |
||||
D1T1L *=*+1 |
||||
D1T1H *=*+1 |
||||
D1T2L *=*+1 |
||||
D1T2H *=*+1 |
||||
D1TOD1 *=*+1 |
||||
D1TODS *=*+1 |
||||
D1TODM *=*+1 |
||||
D1TODH *=*+1 |
||||
D1SDR *=*+1 |
||||
D1ICR *=*+1 |
||||
D1CRA *=*+1 |
||||
D1CRB *=*+1 |
||||
.SKI 2 |
||||
* =$DD00 ;DEVICE2 6526 (PAGE2 NMI) |
||||
D2PRA *=*+1 |
||||
D2PRB *=*+1 |
||||
D2DDRA *=*+1 |
||||
D2DDRB *=*+1 |
||||
D2T1L *=*+1 |
||||
D2T1H *=*+1 |
||||
D2T2L *=*+1 |
||||
D2T2H *=*+1 |
||||
D2TOD1 *=*+1 |
||||
D2TODS *=*+1 |
||||
D2TODM *=*+1 |
||||
D2TODH *=*+1 |
||||
D2SDR *=*+1 |
||||
D2ICR *=*+1 |
||||
D2CRA *=*+1 |
||||
D2CRB *=*+1 |
||||
.SKI 2 |
||||
TIMRB =$19 ;6526 CRB ENABLE ONE-SHOT TB |
||||
.SKIP 4 |
||||
*= BEGIN |
||||
; .BYT 0 |
||||
; .WOR COLDS-2 |
||||
; .WOR $10 |
||||
; .BYT 158 ;SYS TOKEN |
||||
; .BYT '(1039)',0,0,0 |
||||
COLDS JMP INIT ;COLD START MONITOR |
||||
WARMS JMP BRKE ;WARM START MONITOR |
||||
.SKIP 3 |
||||
RDT JMP BASIN ;ALL INPUT THRU HERE |
||||
WRT JMP BSOUT ;ALL OUTPUT THRU HERE |
||||
.SKIP 3 |
||||
; INSTALL EXTRA MONITOR COMMANDS |
||||
; |
||||
INIT SEI ;STOP IRQ'S |
||||
LDA NMINV ;SAVE HIS NMI |
||||
STA OLDNMI |
||||
LDA NMINV+1 |
||||
STA OLDNMI+1 |
||||
LDA BRKVEC ;INIT NEW BRK VECTOR |
||||
LDX BRKVEC+1 |
||||
STA CBINV |
||||
STX CBINV+1 |
||||
JSR REVECT ;KEYS=CINV:CINV=WINTR -- INTERCEPT KEYBOARD INPUT |
||||
LDA #0 |
||||
STA SPAGE ;INDICATE NO SWAP PAGE |
||||
STA SPAGE+1 |
||||
INIT30 |
||||
LDA #$80 ;ENABLE KERNAL MESSAGES |
||||
JSR SETMSG |
||||
LDA #$FF |
||||
STA OPCODE ;NO BREAK POINT OPCODES HAVE BEEN SAVED |
||||
LDA #0 |
||||
STA FULSPD ;NO BREAK POINT ACTIVE |
||||
STA WSW ;DO A BREAK |
||||
STA RBUSY ;NOT BUSY |
||||
CLI ;ALLOW IRQ'S |
||||
BRK |
||||
.SKIP 4 |
||||
BRKE |
||||
JSR SWAP ;DO A SWAP IF ITS NEEDED |
||||
PLA ;RETRIEVE REGISTERS FROM IRQ HANDLER IN ROM |
||||
STA YR |
||||
PLA |
||||
STA XR |
||||
PLA |
||||
STA ACC |
||||
PLA |
||||
STA FLGS |
||||
PLA |
||||
STA PCL |
||||
PLA |
||||
STA PCH |
||||
; |
||||
TSX |
||||
STX SP ;SAVE STACK POINTER |
||||
SEC |
||||
LDA PCL ;BACK UP ONE INSTRUCTION |
||||
SBC #2 ;2 BYTES IS ONE INSTRUCTION |
||||
STA PCL |
||||
LDA PCH |
||||
SBC #0 ;ADJUST WITH CARRY |
||||
STA PCH |
||||
; |
||||
JSR REVECT ;SO I CAN INTERCEPT KEYS FOR SCROLL CONTROL |
||||
LDA OPCODE ;WAS THIS MY BREAK POINT? |
||||
CMP #$FF |
||||
BEQ B5 ;BRANCH IF NOT |
||||
; |
||||
LDX BRKADR ;ELSE PUT INSTRUCTION BACK |
||||
STX TMP0 ;MAKE MEMORY LOOK RIGHT |
||||
LDX BRKADR+1 |
||||
STX TMP0+1 |
||||
LDY #0 |
||||
JSR PUTBYY ;PUT THE OPCODE BACK |
||||
; |
||||
LDA TMP12 ;BREAK ON N'TH OCCURENCE |
||||
BNE BRK500 ;BRANCH IF NOT AT N'TH OCCURENCE YET |
||||
LDA TMP12+1 |
||||
BNE BRK400 |
||||
BEQ B5 ;DO THE BREAK |
||||
; |
||||
BRK500 JMP TBR500 |
||||
BRK400 JMP TBR400 |
||||
; |
||||
B5 JSR CRLF |
||||
LDX #'B ;SET X EQUAL TO B |
||||
B567 LDA #'* |
||||
JSR WRTWO |
||||
JMP D1X ;DISPLAY REGISTERS |
||||
; PERMIT IMMEDIATE |
||||
; ALTER FOLLOWING |
||||
; BREAKPOINT |
||||
ERROPR LDA #$3F ;PRINT A "?" FOR AN ERROR |
||||
JSR WRT |
||||
STRT |
||||
JSR CRLF |
||||
STRT10 LDA #'. ;TYPE A PROMPTING '.' |
||||
JSR WRT |
||||
LDA #0 ;ZERO WRAP FLAG |
||||
STA NORELO ;TURN ON RELOCATION |
||||
STA WRAP |
||||
STA RBUSY ;NOT BUST NOW |
||||
ST1 JSR RDOC ;READ COMMAND. CHARACTER |
||||
; IS RETURNED IN A |
||||
CMP #'. ;IGNORE PROMPTING '.' |
||||
BEQ ST1 |
||||
CMP #$20 ;IGNORE SPACES |
||||
BEQ ST1 |
||||
.SKIP 3 |
||||
; SEARCH FOR COMMANDS |
||||
; |
||||
NWCMD LDX #NCMDS-1 |
||||
NW10 CMP CMDS,X |
||||
BNE NW20 |
||||
STA SAVCMD |
||||
TXA ;MULT BY TWO |
||||
ASL A |
||||
TAX ;INDEX INTO DISPATCH TABLE |
||||
.SKIP 3 |
||||
; DISPATCH TO COMMAND |
||||
; |
||||
LDA ADRS,X ;FAKE INDEXED JMP |
||||
STA TMP0 |
||||
LDA ADRS+1,X ;PUSH ADR-1 AND RTS |
||||
STA TMP0+1 |
||||
JMP (TMP0) |
||||
; |
||||
NW20 DEX |
||||
BPL NW10 |
||||
BMI ERROPR ;CMD NOT FOUND ERROR |
||||
.SKIP 3 |
||||
; DEC TMP0 OR TMP2 |
||||
; |
||||
DECT2 LDX #2 ;DEC TMP2 WORD |
||||
BNE DEC30 ;ALWAYS |
||||
DECT0 LDX #0 ;DEC TMP0 WORD |
||||
DEC30 LDY TMP0,X ;A BORROW? |
||||
BNE DEC20 ;NO-SKIP |
||||
LDY TMP0+1,X ;A MEMORY WRAP |
||||
BNE DEC10 ;NO-SKIP |
||||
INC WRAP ;YES-SET FLAG |
||||
DEC10 DEC TMP0+1,X |
||||
DEC20 DEC TMP0,X |
||||
DRTS RTS |
||||
.SKIP 3 |
||||
;DISASSEMBLE ONE LINE PRINT 2 SPACES |
||||
; |
||||
DISSPC LDA #0 ;PRINT ALL CHARS |
||||
STA PTCH |
||||
JSR DIS300 ;DIS. ONE |
||||
LDX #2 ;SET FOR 2 SPACES |
||||
.SKIP 3 |
||||
;PRINT # OF SPACES=X |
||||
; |
||||
SPCX JSR SPACE |
||||
DEX |
||||
BNE SPCX |
||||
RTS |
||||
.SKIP 3 |
||||
; EXCHANGE TMP REGISTERS |
||||
; |
||||
T0T10 LDX #2 ;EXCHANGE TMP0 WITH |
||||
T0T100 LDA TMP0-1,X ; TMP10 |
||||
PHA |
||||
LDA TMP10-1,X |
||||
STA TMP0-1,X |
||||
PLA |
||||
STA TMP10-1,X |
||||
DEX |
||||
BNE T0T100 |
||||
RTS |
||||
.SKIP 3 |
||||
; DOUBLE SUBTRACT |
||||
; DIFF=LO DIFFERENCE |
||||
; Y=HI DIFFERENCE |
||||
; A=0 IF ZERO DIFFERENCE |
||||
; |
||||
DCT10 LDA TMP10 ;TMP10-TMP0 |
||||
LDY TMP10+1 |
||||
JMP DC10 ;SKIP OVER |
||||
DCMP LDA TMP2 ;TMP2-TMP0 |
||||
LDY TMP2+1 |
||||
DC10 SEC |
||||
SBC TMP0 |
||||
STA DIFF |
||||
TYA ;HI BYTE IN Y |
||||
SBC TMP0+1 |
||||
TAY ;SAVE HI RESULT IN Y |
||||
ORA DIFF ;OR LO FOR EQUAL TEST |
||||
RTS |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,38 @@
|
||||
.PAGE 'MICII4 11/04/80' |
||||
;******************************************************* |
||||
;* |
||||
;* |
||||
;* VICMON V1.0 |
||||
;* |
||||
;* (C) COPYRIGHT 1980 |
||||
;* BY COMMODORE BUSINESS MACHINES |
||||
;* ALL RIGHTS RESERVED |
||||
;* |
||||
;* ORIGINALLY WRITTEN 1/10/79 BY BILL SEILER |
||||
;* |
||||
;* |
||||
;* CHANGED 7/26/79 |
||||
;* 8/27/79 |
||||
;* 10/20/79 |
||||
;* 12/ 1/79 |
||||
;* 5/19/80 |
||||
;* 10/15/80 |
||||
;* |
||||
;* ADAPTED 12/1/80 BY JACK MARTINELLI FOR VIC-1001 |
||||
;* |
||||
;* |
||||
;* |
||||
;******************************************************* |
||||
WALKON =0 ;NO I/O THRU 6526'S |
||||
.LIB MANII4 |
||||
.LIB TRNII4 |
||||
.LIB DISII4 |
||||
.LIB ALTII4 |
||||
.LIB ASMII4 |
||||
.LIB WLKII4 |
||||
.LIB NEWII4 |
||||
.LIB UTLII4 |
||||
.LIB ROLII4 |
||||
.LIB SWAPER |
||||
.LIB TABII4 |
||||
.END |
@ -0,0 +1,116 @@
|
||||
.PAGE 'NEWII4 11/03/80' |
||||
; NEW LOCATOR FOR MACHINE CODE |
||||
; SYNTAX |
||||
; N 1111 2222 3333 4444 5555 W |
||||
; 1111=START ADR |
||||
; 2222=END ADR |
||||
; 3333=OFFSET |
||||
; 4444=LOWER LIMIT |
||||
; 5555=UPPER LIMIT |
||||
; W=ADJUSTING A .WORD TABLE |
||||
; |
||||
NEWLOC JSR PARM3 ;TMP0=OFF,TMP2=SA,TMP10=EA |
||||
STA NEWLC ;SAVE OFFSET LO |
||||
STX NEWLC+1 ;SAVE OFFSET HI |
||||
JSR SRDAE ;GET LOWER LIMIT |
||||
STA MSAL ;SAVE IN MSAL |
||||
STX MSAL+1 |
||||
JSR SRDAE ;GET UPPER LIMIT |
||||
STA EAL ;SAVE IN EAL |
||||
STX EAL+1 |
||||
JSR RDT |
||||
CMP #$0D ;MORE COMMING |
||||
BEQ NEW050 ;NO |
||||
JSR RDT ;READ MORE |
||||
CMP #'W ;A .WORD TABLE ? |
||||
BNE NEW050 ;NO |
||||
INC PTCH ;YES SET .WORD TABLE FLAG |
||||
NEW050 JSR T2T2 ;TMP0=SA,TMP2=XX,TMP10=EA |
||||
NEW100 LDX WRAP ;WRAP $FFFF |
||||
BNE NEWSTR ;YES - GOTO START |
||||
JSR DCT10 ;SA>EA ? |
||||
BCC NEWSTR ;YES |
||||
NEW200 LDY PTCH ;DOING .WORD TABLE ? |
||||
BNE NEW500 ;YES |
||||
JSR R0BYY ;NO - GET OP CODE |
||||
JSR DSET ;DIGEST OP CODE |
||||
TAX |
||||
LDA MNEML,X ;A BAD OP CODE ? |
||||
BNE NEW300 ;NO |
||||
NEWERR JSR DISSPC ;YES - SHOW IT |
||||
NEWSTR JMP STRT |
||||
NEW300 LDY LENGTH |
||||
CPY #2 ;3 BYTE INSTRUCTION ? |
||||
BNE NEW900 ;NO |
||||
BEQ NEW600 ;ALWAYS |
||||
NEW500 STY LENGTH ;FIX FOR .WORD |
||||
NEW600 DEY ;INDEX TO LO BYTE |
||||
SEC ;DOUBLE BYTE CMP |
||||
JSR R0BYY |
||||
TAX ;SAVE IN X |
||||
SBC MSAL ;TEST LOWER LIMIT |
||||
INY ;HI BYTE |
||||
JSR R0BYY |
||||
SBC MSAL+1 |
||||
BCC NEW900 ;TO LOW SKIP |
||||
DEY ;TEST UPER LIMIT |
||||
JSR R0BYY |
||||
STA TEMPX |
||||
LDA EAL |
||||
SBC TEMPX |
||||
INY |
||||
JSR R0BYY |
||||
STA TEMPX |
||||
LDA EAL+1 |
||||
SBC TEMPX |
||||
BCC NEW900 ;TO HI SKIP |
||||
DEY ;LO BYTE AGAIN |
||||
CLC |
||||
TXA ;IN RANGE ADJUST |
||||
ADC NEWLC ;ADJUST LO |
||||
JSR PUTBYY ;SAVE LO |
||||
INY ;POINT TO HI BYTE |
||||
JSR R0BYY ;GET HI BYTE |
||||
ADC NEWLC+1 ;ADJUST HI BYTE |
||||
JSR PUTBYY ;SAVE ABS HI |
||||
NEW900 JSR INCTMP ;BUMP TMP0 |
||||
DEY ;MOVED TO NEXT INSTR ? |
||||
BPL NEW900 ;NO |
||||
BMI NEW100 ;YES - ADJUST ON |
||||
.SKIP 3 |
||||
; GET START ADR END ADR AND NEW ADR |
||||
; TMP0=NA,TMP2=SA,TMP10=EA |
||||
; |
||||
PARM3 JSR SKADR ;SKIP SPACES GET SA A AND X |
||||
STA TMP2 |
||||
STX TMP2+1 |
||||
JSR SRDAE |
||||
STA TMP10 |
||||
STX TMP10+1 |
||||
.SKIP 3 |
||||
; SKIP ONE CHAR READ ADR INTO TMP0 |
||||
; |
||||
SDTMP0 JSR RDOC ;SKIP A CHAR |
||||
RDTMP0 JSR RDOA ;READ ADR |
||||
RDT100 STA TMP0 |
||||
STX TMP0+1 |
||||
RTS |
||||
.SKIP 3 |
||||
; SKIP SPACES READ ADR INTO TMP0 |
||||
SKTMP0 JSR SKADR |
||||
BCS RDT100 ;ALWAYS |
||||
.SKIP 3 |
||||
; READ ADR INTO TMP2 |
||||
; |
||||
RDTMP2 JSR RDOA |
||||
BCS SKT111 ;ALWAYS |
||||
.SKIP 3 |
||||
; SKIP SPACE READ ADR INTO TMP2 |
||||
SKTMP2 JSR SRDAE ;SKIP SPACE READ ADR |
||||
SKT111 STA TMP2 |
||||
STX TMP2+1 |
||||
RTS |
||||
JSR T0T10 ;TMP0=XX,TMP2=SA,TMP10=EA |
||||
JMP SRDAE ;GET TMP0=NA,TMP2=SA,TMP10=EA |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,326 @@
|
||||
.PAGE 'ROLII4 04/30/82' |
||||
; ROLL SCREEN UP OR DOWN |
||||
; IF LAST CMD WAS MEMORY DISPLAY |
||||
; OR DISASSEMBLE. |
||||
; |
||||
ROLLS |
||||
LDA RBUSY ;DOING A ROLL |
||||
BNE REXIT ;YES - DO NOTHING |
||||
LDA NDX ;ANY CHARS IN QUE ? |
||||
BNE ROL400 ;YES |
||||
.SKIP 3 |
||||
REXIT PLA ;RESTORE REGS |
||||
TAY |
||||
PLA |
||||
TAX |
||||
PLA |
||||
RTI |
||||
.SKIP 3 |
||||
ROL400 |
||||
LDA KEYD ;GET NEW CHAR |
||||
CMP #$11 ;A CURSOR DOWN ? |
||||
BEQ XOL600 ;NO |
||||
JMP ROL600 |
||||
XOL600 |
||||
LDA TBLX ;CURSOR ON BOTTOM OF SCREEN |
||||
CMP #NLINES-1 |
||||
BNE REXIT ;NO - EXIT |
||||
LDA PNT ;COPY PNT TO TMP2 |
||||
STA TMP2 |
||||
LDA PNT+1 |
||||
STA TMP2+1 |
||||
LDA #NLINES ;CHECK 25 LINES |
||||
STA TMP12 |
||||
ROL440 LDY #1 ;LOOK IN COLUMN TWO |
||||
JSR GSCRN ;GET A SCREEN CHAR |
||||
CMP #': ;A MEMORY DISPLAY ? |
||||
BEQ ROL500 ;YES |
||||
CMP #', ;A DISASSEMBLEY DISPLAY ? |
||||
BEQ ROL500 ;YES |
||||
CMP #'' ;AN INTEROGATE? |
||||
BEQ ROL500 ;BRANCH IF SO |
||||
DEC TMP12 ;NO - NEXT LINE UP |
||||
BEQ REXIT ;CHECKED WHOLE SCREEN |
||||
; |
||||
SEC ;BACKUP ONE LINE |
||||
LDA TMP2 |
||||
SBC #LLEN |
||||
STA TMP2 |
||||
BCS ROL440 |
||||
DEC TMP2+1 |
||||
BNE ROL440 ;ALWAYS |
||||
; |
||||
ROL500 STA SAVCMD ;SAVE DISPLAY TYPE |
||||
JSR GADR ;READ ADDRESS |
||||
BCS REXIT ;EXIT IF BAD ADR READ |
||||
LDA SAVCMD |
||||
CMP #': ;A MEMORY DISPLAY ? |
||||
BEQ ROL551 ;BRANCH IF SO |
||||
CMP #'' ;IS IT AN INTEROGATE? |
||||
BNE ROL550 ;BRANCH IF NOT |
||||
CLC ;BACKUP ISIZE # BYTES |
||||
LDA #ISIZE |
||||
ADC TMP0 |
||||
STA TMP0 |
||||
BCC INTUP |
||||
INC TMP0+1 |
||||
INTUP |
||||
JSR INTONE ;ELSE PRINT AN ASCII LINE |
||||
JMP ROL580 |
||||
ROL551 |
||||
CLC ;MOVE DOWN MSIZE # BYTES |
||||
LDA TMP0 |
||||
ADC #MSIZE |
||||
STA TMP0 |
||||
BCC ROL510 |
||||
INC TMP0+1 |
||||
ROL510 |
||||
JSR CRLF |
||||
LDX #'. |
||||
LDA #': |
||||
JSR WRTWO ;PRINT".:" |
||||
JSR WROA ;AND THE ADDRESS |
||||
LDA #MSIZE |
||||
JSR DM ;DISPLAY MEMORY |
||||
JMP ROL580 |
||||
ROL550 |
||||
JSR GDSET ;GET INSTR AND DIGEST IT |
||||
JSR TMPADJ ;MOVE TO NEXT INSTRUCTION |
||||
LDA #0 ;PRINT A CHAR IN DISASSEMBLE |
||||
STA PTCH |
||||
LDY #', ;PRINT "., " |
||||
JSR DIS300 ;DISASSEMBLE ONE LINE |
||||
ROL580 LDA #0 |
||||
STA NDX ;EMPTY QUE |
||||
STA RBUSY ;SCROLL IS NO LONGER BUSY |
||||
STA WRAP |
||||
JSR CURUP ;CURSOR UP |
||||
JSR CRLF ; AND BACK TO THE BEGINING. |
||||
JMP REXIT ;AND EXIT |
||||
.SKIP 3 |
||||
ROL600 CMP #$91 ;A CURSOR UP ? |
||||
BEQ NXEXIT ;NO |
||||
JMP REXIT |
||||
NXEXIT |
||||
LDA TBLX ;A TOP OF SCREEN ? |
||||
BEQ NOXIT ;NO |
||||
JMP REXIT |
||||
NOXIT |
||||
LDA PNT ;COPY SCREEN PTR |
||||
STA TMP2 |
||||
LDA PNT+1 |
||||
STA TMP2+1 |
||||
LDA #NLINES ;23 LINE ON SCREEN |
||||
STA TMP12 |
||||
; |
||||
ROL700 LDY #1 ;LOOK IN COLUMN TWO |
||||
JSR GSCRN |
||||
CMP #': ;A MEMORY DISPLAY ? |
||||
BEQ ROL800 ;YES |
||||
CMP #', ;A DISASSEMBLEY DISPLAY ? |
||||
BEQ ROL800 ;YES |
||||
CMP #'' ;AN INTEROGATE? |
||||
BEQ ROL800 ;BRANCH IF SO |
||||
DEC TMP12 ;DONE ALL 25 LINES ? |
||||
BEQ JREX |
||||
CLC ;DOWN TO NEXT LINE |
||||
LDA TMP2 |
||||
ADC #LLEN |
||||
STA TMP2 |
||||
BCC ROL700 |
||||
INC TMP2+1 |
||||
BNE ROL700 ;ALWAYS |
||||
; |
||||
ROL800 STA SAVCMD |
||||
JSR GADR ;READ ADR |
||||
BCC ROL820 ;READ OK |
||||
JREX JMP REXIT |
||||
; |
||||
ROL820 |
||||
LDA SAVCMD |
||||
CMP #': ;A MEMORY DISPLAY |
||||
BEQ MDWN |
||||
CMP #'' ;AN INTEROGATE? |
||||
BNE DDWN ;BRANCH IF NOT |
||||
JSR SCRD ;SCROLL DOWN AND HOME |
||||
SEC ;BACKUP ISIZE # BYTES |
||||
LDA TMP0 |
||||
SBC #ISIZE |
||||
STA TMP0 |
||||
BCS MD10A ;NO BORROW |
||||
DEC TMP0+1 |
||||
MD10A JSR INTO10 ;DISPLAY ONE LINE AT TOP OF SCREEN |
||||
JMP MD200 |
||||
.SKIP 3 |
||||
; MEMORY DISPLAY ROLL DOWN |
||||
; |
||||
MDWN |
||||
JSR SCRD ;SCROLL DOWN AND HOME |
||||
SEC ;BACKUP ISIZE # BYTES |
||||
LDA TMP0 |
||||
SBC #ISIZE |
||||
STA TMP0 |
||||
BCS MD100 ;NO BORROW |
||||
DEC TMP0+1 |
||||
MD100 |
||||
JSR HEXDM2 ;DISPLAY ONE LINE OF MEMORY |
||||
MD200 LDA #0 ;CLEAR BUSY FLAG AND QUE |
||||
STA NDX |
||||
STA RBUSY |
||||
STA WRAP |
||||
JSR HOME |
||||
JMP REXIT |
||||
.SKIP 3 |
||||
; DISASSEMBLE ROLL DOWN |
||||
; |
||||
DDWN |
||||
JSR SCRD |
||||
LDA TMP0 ;SAVE TMP0 IN TMP2 |
||||
LDX TMP0+1 |
||||
STA TMP2 |
||||
STX TMP2+1 |
||||
LDA #$10 ;START BACKUP 16 BYTES |
||||
STA TMP12 |
||||
DD200 SEC ;BACKUP |
||||
LDA TMP2 |
||||
SBC TMP12 |
||||
STA TMP0 |
||||
LDA TMP2+1 |
||||
SBC #0 |
||||
STA TMP0+1 |
||||
DD300 |
||||
JSR GDSET ;GET INSTR AND DIGEST IT |
||||
JSR TMPADJ ;MOVE TO NEXT INSTR |
||||
JSR DCMP ;SAME AS TMP2 ? |
||||
BEQ DD400 ;YES - OK ! |
||||
BCS DD300 ;NOT THERE YET |
||||
DEC TMP12 ;TRY STARTING ONE LESS BACK |
||||
BNE DD200 |
||||
; |
||||
; |
||||
DD400 |
||||
INC LENGTH ;1=1 BYTE, 2=2 BYTES ETC. |
||||
LDA LENGTH ;GOT IT NOW BACK UP |
||||
JSR BY200 |
||||
LDX #0 ;GET BACKUP INSTR |
||||
STX PTCH ;DISPLAY ALL CHARS |
||||
LDA #', |
||||
JSR ALTR2 ;PRINT "., " |
||||
JSR DIS400 ;DISASSEMBLE ONE LINE |
||||
JMP MD200 |
||||
.SKIP 3 |
||||
; GET AN INSTRUCTION AND DIGEST IT |
||||
; |
||||
GDSET |
||||
LDX #0 |
||||
JSR FROMR0 ;GET A BYTE IN .A |
||||
JMP DSET |
||||
.SKIP 3 |
||||
; SCROLL DOWN SET TO PRINT ON LINE 1 |
||||
; |
||||
SCRD |
||||
VICQTR =VICSCN+768 ;3/4 POINT IN SCREEN |
||||
VICCLR =VICOL+768 ;3/4 POINT IN COLOR NIBBLES |
||||
LDA #<VICCLR ;POINT TO COLOR NIBBLES |
||||
STA EAL ;EAL IS 'FROM' ADDRESS |
||||
LDA #>VICCLR |
||||
STA EAL+1 |
||||
STA CMP0+1 ;CMP0 IS 'TO' ADDRESS |
||||
LDA #>VICQTR ;POINT TO SCREEN HALFWAY POINT |
||||
STA SAL+1 |
||||
STA TMP2+1 |
||||
LDA #<VICQTR |
||||
STA SAL |
||||
LDA #LLEN ;OFFSET TO NEXT LINE |
||||
STA TMP2 |
||||
STA CMP0 ;OFFSET TO NEXT LINE OF COLOR NIBBLES |
||||
LDY #231-LLEN ;NOTE, 40*25 = 400H - 24 BYTES FOR SCREEN |
||||
LDX #4 |
||||
; |
||||
SCD10 |
||||
LDA (SAL),Y |
||||
STA (TMP2),Y |
||||
LDA (EAL),Y |
||||
STA (CMP0),Y ;AND COLOR NIBBLE |
||||
DEY |
||||
BNE SCD10 |
||||
; |
||||
LDA (SAL)Y ;DO ;THE ZERO CASE |
||||
STA (TMP2)Y |
||||
LDA (EAL),Y |
||||
STA (CMP0),Y |
||||
DEY ;SET Y TO $FF |
||||
DEC SAL+1 |
||||
DEC TMP2+1 |
||||
DEC EAL+1 |
||||
DEC CMP0+1 |
||||
DEX |
||||
BNE SCD10 |
||||
; |
||||
CLR40 |
||||
LDX #LLEN-1 ;ERASE TOP LINE |
||||
LDA #$20 |
||||
SCD20 STA VICSCN,X |
||||
DEX |
||||
BPL SCD20 |
||||
.SKIP 3 |
||||
; HOME TO TOP LEFT |
||||
; |
||||
HOME LDA #$13 ;HOME TO LINE 1 |
||||
JMP WRT |
||||
.SKIP 3 |
||||
; GET ADDRESS FROM SCREEN INTO TMP0 AND TMP2 |
||||
; |
||||
GADR |
||||
CPY #LLEN ;GONE OFF END |
||||
BNE GAD100 ;NO |
||||
SEC |
||||
RTS |
||||
; |
||||
GAD100 JSR GSCRN ;GET A CHAR FROM SCREEN |
||||
CMP #$20 ;SKIP SPACES |
||||
BEQ GADR |
||||
DEY ;BACKUP FOR NEXT GSCRN |
||||
JSR GBYT |
||||
TAX ;SAVE HI IN X |
||||
JSR GBYT ;GET LO BYTE |
||||
STA TMP0 |
||||
STX TMP0+1 |
||||
LDA #$FF ;SET FLAGS |
||||
STA RBUSY ;NO CURSOR UP/DOWN BUSY |
||||
STA BLNSW ;STOP BLINK OF CURSOR |
||||
LDA BLNON ;CURSOR IN REVERSE ? |
||||
BEQ GAD200 ;NO |
||||
LDA GDBLN ;YES - GET GOOD CHAR |
||||
LDY PNTR ;COLUMN OF CURSOR |
||||
STA (PNT),Y ;RESTORE SCREEN CHAR |
||||
LDA #0 ;SAY GOOD |
||||
STA BLNON |
||||
GAD200 CLC |
||||
RTS |
||||
; |
||||
GBYT |
||||
JSR GSCRN |
||||
JSR HEXIT ;HEX TO BINARY |
||||
ASL A ;IN HI NYBBLE |
||||
ASL A |
||||
ASL A |
||||
ASL A |
||||
STA BAD |
||||
JSR GSCRN |
||||
JSR HEXIT |
||||
ORA BAD |
||||
RTS |
||||
.SKIP 3 |
||||
; GET A CHAR FROM SCREEN |
||||
; |
||||
GSCRN |
||||
LDA (TMP2),Y |
||||
INY |
||||
AND #$7F ;NO RVS FIELD |
||||
CMP #$20 ;ADJUST TO ASCII |
||||
BCS GSC100 |
||||
ORA #$40 |
||||
GSC100 RTS |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,241 @@
|
||||
.PAG 'SWAP ROUTINES' |
||||
;*********************************************************************** |
||||
; |
||||
; TRANSPARENT SYSTEM PAGE ROUTINES |
||||
; |
||||
; SWAP ------ SWAPS SYSTEM PAGE WITH USER DEFINED SWAP PAGE (1K) |
||||
; FROMR0 ---- GETS A BYTE POINTED TO BY TMP0 AND RELOCATED IF |
||||
; NECESSARY BY SPAGE |
||||
; FROMR2 ---- SAME AS ABOVE FOR TMP2 |
||||
; |
||||
; TOR0 ---- PUTS A BYTE AT THE RELOCATED ADDRESS FROM TMP0 |
||||
; TOR2 ---- SAME AS ABOVE FOR TMP2 |
||||
; |
||||
; SETPAG -- SETS BASE ADDRESS FOR SWAP SPACE OF 1K |
||||
; |
||||
;********************************************************************* |
||||
; |
||||
SETPAG |
||||
JSR SKADR ;READ ADDRESS ARGUMENT. |
||||
CPX #$04 ;IN CASE HE MADE A MISTAKE |
||||
BCC ERROP3 |
||||
STA SPAGE ;SAVE IT HERE |
||||
STX SPAGE+1 ; |
||||
STA MEMSIZ |
||||
STX MEMSIZ+1 |
||||
STA TMP2 |
||||
STX TMP2+1 ;AND HERE FOR VERIFICATION THERE'S RAM HERE |
||||
; |
||||
; CHECK FOR VALIDITY AND DO THE COPY |
||||
; |
||||
LDY #0 |
||||
CKLOOP |
||||
LDA #$55 |
||||
STA (TMP2),Y ;PUT A PATTERN IN RAM |
||||
CMP (TMP2),Y ;DID IT GET STORED? |
||||
BNE ERROP3 ;BRANCH IF NOT |
||||
LDA $00,Y ;GET A ZERO PAGE BYTE TO SWAP |
||||
STA (TMP2),Y ;COPY ZERO PAGE TO SWAP SPACE |
||||
INY ;NEXT BYTE |
||||
BNE CKLOOP ;REPEAT UNTILL ZERO PAGE COPIED |
||||
; |
||||
JMP STRT |
||||
ERROP3 |
||||
STX TMP2 ;MAYBE HE ONLY WANTS TO DEACTIVATE SWAP PAGE |
||||
ORA TMP2 ;SEE IF HI AND LO BYTES ARE ZERO |
||||
BNE DOANER ;BRANCH IF NOT - IE DO AN ERROR |
||||
STA SPAGE ;DEACTIVATE SWAP PAGE |
||||
STX SPAGE+1 |
||||
JMP STRT ;GO BACK FOR MORE COMMANDS |
||||
DOANER |
||||
JMP ERROPR ;ERROR |
||||
.PAG |
||||
;********************************************************************* |
||||
; |
||||
; SWAP |
||||
; |
||||
; EXCHANGE THE DATA POINTED TO BY SPAGE WITH THE SEGMENT 0000-0400 |
||||
; |
||||
;********************************************************************* |
||||
; |
||||
SWAP |
||||
PHA ;SAVE ALL REGISTERS |
||||
TXA |
||||
PHA |
||||
TYA |
||||
PHA |
||||
LDA SPAGE+1 |
||||
BEQ SWPRTS ;IF NO SWAP PAGE THEN GETOUT |
||||
; |
||||
; |
||||
LDY #0 |
||||
MORSWP ;DO THE SWAP |
||||
LDA $00,Y ;GET ZERO PAGE BYTE |
||||
TAX ;SAVE IT HERE |
||||
LDA (SPAGE),Y ;GET A BYTE FROM THE SWAP PAGE |
||||
STA $00,Y ;PUT IT IN ZERO PAGE |
||||
TXA ;GET THE ZERO PAGE BYTE |
||||
STA (SPAGE),Y ;PUT IT IN THE SWAP PAGE |
||||
INY |
||||
BNE MORSWP |
||||
; |
||||
SWPRTS |
||||
PLA ;RESTORE REGISTERS |
||||
TAY |
||||
PLA |
||||
TAX |
||||
PLA |
||||
RTS |
||||
.PAG |
||||
;***************************************************************** |
||||
; |
||||
; REVECT --- SETUP IRQ VECTOR TO POINT TO ME |
||||
; SO I CAN INTERCEPT THE CURSOR |
||||
; CONTROL KEYS |
||||
; |
||||
;***************************************************************** |
||||
; |
||||
REVECT |
||||
LDA CINV ;GET ORIGINAL IRQ VECTOR |
||||
LDX CINV+1 |
||||
CMP WINTR ;DID I CHANGE IT ALREADY? |
||||
BNE REVE10 ;BRANCH IF NOT |
||||
CPX WINTR+1 ;HALF IS RIGHT - IS THE HI-ORDER RIGHT? |
||||
BEQ REVE20 ;BRANCH IF ALREADY CHANGE - KEEP KEYS AS IS |
||||
; |
||||
REVE10 |
||||
STA KEYS |
||||
STX KEYS+1 ;SAVE HIS IRQ VECTOR |
||||
LDA WINTR ;GET MY IRQ VECTOR |
||||
LDX WINTR+1 |
||||
STA CINV ;PUT IT HERE FOR JMP(CINV) |
||||
STX CINV+1 |
||||
REVE20 |
||||
RTS |
||||
.SKI 3 |
||||
; |
||||
; RESTIRQ --- RESTORE IRQ VECTOR TO ORIGINAL STATE |
||||
; |
||||
RESIRQ |
||||
LDA KEYS |
||||
STA CINV ;REPLACE KEYBOARD IRQ |
||||
LDA KEYS+1 |
||||
STA CINV+1 |
||||
RTS |
||||
.PAG |
||||
;******************************************************************* |
||||
; |
||||
; RELOCATION ROUTINES |
||||
; |
||||
; TMP0 AND TMP2 ARE RELOCATED IN R0 FOR SOURCE OR DESTINATION |
||||
; .X IS RETURNED AS ZERO |
||||
; .Y IS PRESERVED |
||||
; .A CONTAINS BYTE |
||||
; |
||||
;******************************************************************* |
||||
; |
||||
FROMR2 |
||||
LDX #2 ;INDEX TO TMP2 (BASE ADDR IS TMP0) |
||||
BNE FROM ;BRANCH ALWAYS |
||||
; |
||||
FROMR0 |
||||
LDX #0 ;NO OFFSET |
||||
; |
||||
FROM |
||||
JSR RELOR0 |
||||
LDX #0 |
||||
LDA (R0,X) ;GET THE BYTE AND LEAVE |
||||
RTS |
||||
; |
||||
; |
||||
TOR2 |
||||
LDX #2 ;OFFSET FROM TMP0 TO TMP2 |
||||
BNE TO |
||||
; |
||||
TOR0 |
||||
LDX #0 |
||||
; |
||||
TO |
||||
PHA ;SAVE THE BYTE WE'LL STORE |
||||
JSR RELOR0 ;DO THE RELOCATION IF NEEDED |
||||
PLA ;GET THE BYTE TO BE STORED |
||||
LDX #0 ; |
||||
STA (R0,X) ;PUT THE BYTE |
||||
RTS |
||||
.PAG |
||||
; |
||||
;----- DO THE RELOCATION OF TMP0 OR TMP2 |
||||
; |
||||
; RETURNS: |
||||
; |
||||
; R0 -- THE INDIRECT OR BASE ADDRESS OF THE DATA |
||||
; |
||||
RELOR0 |
||||
LDA TMP0+1,X ;DO WE NEED TO RELOCATE? |
||||
BNE NOCATE ;THEN BRANCH - DON'T RELOCATE |
||||
; |
||||
CLC |
||||
LDA SPAGE ;PUT THIS AS BASE ADDRESS |
||||
ADC TMP0,X ;ADD IN THE OFFSET |
||||
STA R0 ;AND PUT IT IN R0 |
||||
LDA SPAGE+1 |
||||
ADC TMP0+1,X |
||||
STA R0+1 |
||||
RTS |
||||
; |
||||
NOCATE |
||||
STA R0+1 ;NO RELOCATION - SO R0=TMP0,X |
||||
LDA TMP0,X |
||||
STA R0 |
||||
RTS |
||||
.PAG |
||||
;******************************************************************** |
||||
; |
||||
; GET A BYTE AT RELOCATED ADDRESS INDEXED BY .Y |
||||
; |
||||
;******************************************************************** |
||||
; |
||||
R0BYY |
||||
PHP |
||||
PLA ;CLEAR THE GOD DAMN BREAK FLAG!!! |
||||
AND #$EF ;MASK OUT THE BREAK FLAG |
||||
PHA ;PUT BACK ON THE STACK |
||||
STY TEMPY |
||||
TYA |
||||
CLC |
||||
ADC TMP0 |
||||
STA R0 |
||||
LDA #0 |
||||
ADC TMP0+1 |
||||
STA R0+1 |
||||
CMP #01 ;IF RESULT IS IN ZERO PAGE THEN RELOCATE IT |
||||
BCS R0OK ;BRANCH IF OUTSIDE SYSTEMPAGE |
||||
; |
||||
LDA NORELO ;IS RELOCATION OFF? |
||||
BNE R0OK ;BRANCH IF SO |
||||
LDA R0 ; HAVE TO RELOCATE IT |
||||
ADC SPAGE |
||||
STA R0 |
||||
LDA R0+1 |
||||
ADC SPAGE+1 |
||||
STA R0+1 |
||||
; |
||||
R0OK |
||||
LDY #0 |
||||
LDA (R0),Y |
||||
LDY TEMPY |
||||
PLP |
||||
RTS |
||||
; |
||||
;----- PUT A BYTE INDEXED BY Y AND TMP0 |
||||
; |
||||
PUTBYY |
||||
PHA |
||||
JSR R0BYY ;SET UP R0 |
||||
STY TEMPY |
||||
LDY #0 |
||||
PLA ;GET THE BYTE I'M SUPPOSED TO STORE |
||||
STA (R0),Y |
||||
LDY TEMPY |
||||
RTS |
||||
.END |
@ -0,0 +1,115 @@
|
||||
.PAGE 'TABII4 11/02/80' |
||||
MODE .BYT $40,2,$45,3 |
||||
.BYT $D0,8,$40,9 |
||||
.BYT $30,$22,$45,$33 |
||||
.BYT $D0,8,$40,9 |
||||
.BYT $40,2,$45,$33 |
||||
.BYT $D0,8,$40,9 |
||||
.BYT $40,$02,$45,$B3 |
||||
.BYT $D0,$08,$40,$09 |
||||
.BYT 0,$22,$44,$33 |
||||
.BYT $D0,$8C,$44,0 |
||||
.BYT $11,$22,$44,$33 |
||||
.BYT $D0,$8C,$44,$9A |
||||
.BYT $10,$22,$44,$33 |
||||
.BYT $D0,8,$40,9 |
||||
.BYT $10,$22,$44,$33 |
||||
.BYT $D0,8,$40,9 |
||||
.BYT $62,$13,$78,$A9 |
||||
MODE2 .BYT 0,$21,$81,$82 |
||||
.BYT 0,0,$59,$4D |
||||
.BYT $91,$92,$86,$4A |
||||
.BYT $85,$9D |
||||
CHAR1 .BYT ',),#($' |
||||
CHAR2 .BYT 'Y',0,'X$$',0 |
||||
MNEML .BYT $1C,$8A,$1C,$23 |
||||
.BYT $5D,$8B,$1B,$A1 |
||||
.BYT $9D,$8A,$1D,$23 |
||||
.BYT $9D,$8B,$1D,$A1 |
||||
.BYT 0,$29,$19,$AE |
||||
.BYT $69,$A8,$19,$23 |
||||
.BYT $24,$53,$1B,$23 |
||||
.BYT $24,$53,$19,$A1 |
||||
.BYT 0,$1A,$5B,$5B |
||||
.BYT $A5,$69,$24,$24 |
||||
.BYT $AE,$AE,$A8,$AD |
||||
.BYT $29,0,$7C,0 |
||||
.BYT $15,$9C,$6D,$9C |
||||
.BYT $A5,$69,$29,$53 |
||||
.BYT $84,$13,$34,$11 |
||||
.BYT $A5,$69,$23,$A0 |
||||
MNEMR .BYT $D8,$62,$5A,$48 |
||||
.BYT $26,$62,$94,$88 |
||||
.BYT $54,$44,$C8,$54 |
||||
.BYT $68,$44,$E8,$94 |
||||
.BYT 0,$B4,8,$84 |
||||
.BYT $74,$B4,$28,$6E |
||||
.BYT $74,$F4,$CC,$4A |
||||
.BYT $72,$F2,$A4,$8A |
||||
.BYT 0,$AA,$A2,$A2 |
||||
.BYT $74,$74,$74,$72 |
||||
.BYT $44,$68,$B2,$32 |
||||
.BYT $B2,0,$22,0 |
||||
.BYT $1A,$1A,$26,$26 |
||||
.BYT $72,$72,$88,$C8 |
||||
.BYT $C4,$CA,$26,$48 |
||||
.BYT $44,$44,$A2,$C8 |
||||
.SKIP 3 |
||||
REGK .BYTE CR,$20,$20,$20 ;4 SPACES |
||||
.BYTE 'PC ','SR AC XR YR SP' |
||||
.SKIP 4 |
||||
CMDS .BYTE 'A' ;SIMPLE ASSEMBLE |
||||
.BYTE 'B' ;SET BREAK FOR QUICK TRACE |
||||
.BYTE 'C' ;COMPARE MEMORY |
||||
.BYTE 'D' ;DISASSEMBLE |
||||
.BYTE 'F' ;FILL MEMORY |
||||
.BYTE 'G' ;GO COMMAND |
||||
.BYTE 'H' ;HUNT |
||||
.BYTE 'I' ;INTEROGATE MEMORY |
||||
.BYTE 'L' ;LOAD MEMORY |
||||
.BYTE 'M' ;DISPLAY MEMORY |
||||
.BYTE 'N' ;NEW LOCATER |
||||
.BYTE 'Q' ;QUICK TRACE |
||||
.BYTE 'R' ;DISPLAY REGS |
||||
.BYTE 'S' ;SAVE MEMORY |
||||
.BYTE 'T' ;TRANSFER MEMORY |
||||
.BYTE 'W' ;WALK THRU MEMORY |
||||
.BYTE 'X' ;EXIT TO BASIC |
||||
.BYTE ',' ;MODIFY DISASSEMBLY |
||||
.BYTE ':' ;MODIFY MEMORY |
||||
.BYTE ';' ;ALTER REGS |
||||
.BYTE 'E' ;ENABLE SWAP PAGE |
||||
ADRS .WORD ASSM ;THE FOLLOWING .WORD TABLE IS RELOCATABLE |
||||
.WORD BREAK |
||||
.WORD COMPAR |
||||
.WORD DISA |
||||
.WORD FILL |
||||
.WORD GO |
||||
.WORD HUNT |
||||
.WORD INTGRT ;INTEROGATE MEMORY |
||||
.WORD LD |
||||
.WORD DSPLYM |
||||
.WORD NEWLOC |
||||
.WORD QUICK |
||||
.WORD DSPLYR |
||||
.WORD LD |
||||
.WORD TRANS |
||||
.WORD WALK |
||||
.WORD EXIT |
||||
.WORD ASSM ;MODIFY DISASSEMBLY |
||||
.WORD ALTMEM |
||||
.WORD ALTR |
||||
.WORD SETPAG ;SET ADDRESS OF SWAP PAGE |
||||
.SKIP3 |
||||
WCOLDS .WORD COLDS |
||||
WINTR .WORD REPET |
||||
WWLK .WORD WLKBRK |
||||
BRKVEC .WORD BRKE ;BREAK VECTOR |
||||
ROLVEC .WORD ROLLS ;ADDRESS OF SCREEN SCROLL CONTROL |
||||
JSRVEC .WORD JSSS ;ADDRESS OF JSR CONTROLLER FOR WALK MODE |
||||
NCMDS=ADRS-CMDS |
||||
.SKIP 5 |
||||
EOM |
||||
*=$8FFF |
||||
M8FFF .BYT 0 ;CHECK SUM BYTE |
||||
.END |
@ -0,0 +1,154 @@
|
||||
.PAGE 'TRNII4 10/23/80' |
||||
; COMPARE MEMORY |
||||
; SYNTAX C 0000 1111 2222 |
||||
; |
||||
COMPAR LDA #0 ;SET FLAG FOR COMPARE |
||||
BEQ TR10 ;ALWAYS |
||||
.SKIP 2 |
||||
; TRANSFER MEMORY |
||||
; SYNTAX T 0000 1111 2222 |
||||
; |
||||
TRANS LDA #1 ;SET FLAG FOR TRANSFER |
||||
TR10 STA TMPC4 |
||||
JSR PARM3 ;GET TMP0=NA,TMP2=SA,TMP10=EA |
||||
JSR CRLF ;START ON NEW LINE |
||||
JSR DCMP ;C=0 FOR TRANSFER UP |
||||
JSR T2T2 ;TMP0=SA,TMP2=NA,TMP10=EA |
||||
BCC TRUP ;TRANSFER UP |
||||
TRDWN JSR DCT10 ;SUB SA FROM EA |
||||
BCS TTTDDD |
||||
JMP FSTR ;STOP IF EA<SA |
||||
; |
||||
TTTDDD JSR TRNCMP ;DO TRANSFER OR COMPAIR |
||||
INC TMP2 ;INC TMP2 |
||||
BNE TTT10 ;NO CARRY |
||||
INC TMP2+1 |
||||
TTT10 JSR INCTMP ;INC TMP0 |
||||
LDY WRAP ;OVERFLOW $FFFF ? |
||||
BNE FIXSTK ;YES THEN DONE |
||||
BEQ TRDWN ;BRANCH ALWAYS |
||||
.SKIP 2 |
||||
TRUP JSR DCT10 ;EA-SA |
||||
CLC ;CALC NEW END ADR |
||||
LDA DIFF ;LO DIFF |
||||
ADC TMP2 ;ADD LO NEW ADR |
||||
STA TMP2 |
||||
TYA ;GET HI DIFF |
||||
ADC TMP2+1 ;ADD HI NEW ADR |
||||
STA TMP2+1 |
||||
JSR T0T10 ;TMP0=EA,TMP2=NEW EA |
||||
; TMP10=SA |
||||
TR40 JSR TRNCMP ;DO TRANSFER OR COMPARE |
||||
JSR DCT10 ;IS EA=SA |
||||
BCS FSTR ;YES-DONE |
||||
JSR DECT2 ;DEC TMP2 |
||||
JSR DECT0 ;DEC TMP0 |
||||
LDY WRAP ;OVER $FFFF ? |
||||
BNE FIXSTK ;YES - END |
||||
BEQ TR40 |
||||
.SKIP 3 |
||||
TRNCMP LDX #0 |
||||
JSR FROMR0 ;GET BYTE |
||||
PHA ;SAVE IT TO SETUP OTHER ADDRESS |
||||
JSR FROMR2 ;INCASE WE DO A COMPARE |
||||
PLA ;RESTORE SOURCE BYTE |
||||
LDY TMPC4 ;A TRANSFER ? |
||||
BEQ TRC10 ;NO |
||||
JSR TOR2 ;YES - TRANSFER IT |
||||
TRC10 CMP (R0,X) ;DID IT STICK ? |
||||
BEQ TRTS ;YES |
||||
PRTADR JSR WROA ;NO - PRINT BAD ADDRESS |
||||
JSR SPACE |
||||
JSR STOP1 ;STOP KEY ? |
||||
BEQ FIXSTK ;YES |
||||
TRTS RTS ;NO - RETURN |
||||
FIXSTK |
||||
JMP STRT |
||||
.SKIP 3 |
||||
; FILL MEMORY |
||||
; SYNTAX F 0000 1111 22 |
||||
; |
||||
FILL JSR SKTMP0 ;SKIP SP'S READ SA TO TMP2 |
||||
JSR SKTMP2 ;SKIP 1 READ EA |
||||
JSR RDOC ;SKIP 1 ,CHECK FOR ERROR |
||||
JSR RDOB ;READ FILL BYTE |
||||
BCC ERRF2 |
||||
STA TMPC ;SAVE IT |
||||
FL10 LDX WRAP ;STOP IF WRAP |
||||
BNE FSTR |
||||
JSR DCMP ;STOP IF EA<SA |
||||
BCC FSTR |
||||
LDA TMPC ;GET FILL BYTE |
||||
JSR TOR0 ;PUT IN MEMORY |
||||
JSR INCTMP ;INC TMP0 |
||||
BNE FL10 ;BRANCH ALWAYS |
||||
ERRF2 JMP ERROPR |
||||
FSTR JMP STRT |
||||
.SKIP 3 |
||||
; HUNT FOR BYTES OR STRING |
||||
; SYNTAX H 0000 1111 'AF... |
||||
; OR H 0000 1111 22 33 44 ... |
||||
; |
||||
HUNT JSR SKTMP0 ;SKIP SP'S READ SA TO TMP2 |
||||
JSR SKTMP2 ;SKIP 1 READ A |
||||
JSR RDOC ;SKIP 1 DELIMITER |
||||
LDX #0 |
||||
JSR RDOC ;GET FIRST CHAR |
||||
CMP #$27 ;IS IT A ' |
||||
BNE HT50 ;NO-MUST BE HEX |
||||
JSR RDOC ;YES-GET FIRST STRING CHR |
||||
HT30 STA MTCH,X ;SAVE IN BUF |
||||
INX |
||||
JSR RDT ;GET NEXT |
||||
CMP #$0D ;A CR? |
||||
BEQ HT80 ;YES-END OF STRING |
||||
CPX #$20 ;NO-32 CHAR YET? |
||||
BNE HT30 ;NO-GET MORE |
||||
BEQ HT80 ;YES-GO LOOK FOR IT |
||||
HT50 STX BAD ;ZERO FOR RDOB |
||||
JSR RDOB1 ;FINISH HEX READ |
||||
BCC ERRF2 |
||||
HT60 STA MTCH,X ;SAVE IN BUF |
||||
INX |
||||
JSR RDT ;GET DELIMITER |
||||
CMP #$0D ;IS IT A CR? |
||||
BEQ HT80 ;YES-GO LOOK FOR BYTES |
||||
JSR RDOB ;NO-GET THE BYTE |
||||
BCC ERRF2 |
||||
CPX #$20 ;32 BYTES YET? |
||||
BNE HT60 ;NO-GET MORE |
||||
HT80 STX SAVX ;YES-START SEARCH |
||||
JSR CRLF ;NEXT LINE |
||||
HT85 LDX #0 |
||||
LDY #0 |
||||
LDA TMP0 ;SAVE START ADDRESS ON STACK |
||||
PHA |
||||
LDA TMP0+1 |
||||
PHA |
||||
HT90 JSR R0BYY ;GET BYTE |
||||
CMP MTCH,X ;SAME? |
||||
BNE HT100 ;NO-MOVE ON |
||||
JSR INCTMP ;YES-TRY NEXT IN BUF - BUMP TMP0 |
||||
INX |
||||
CPX SAVX ;CHECKED FULL STRING? |
||||
BNE HT90 ;NO-CHECK ON |
||||
; |
||||
PLA |
||||
STA TMP0+1 |
||||
PLA |
||||
STA TMP0 |
||||
JSR PRTADR ;YES - PRINT ADDRESS FOUND |
||||
BNE NXT1 |
||||
HT100 |
||||
PLA |
||||
STA TMP0+1 |
||||
PLA |
||||
STA TMP0 |
||||
NXT1 JSR INCTMP ;TRY NEXT ADR |
||||
LDY WRAP ;OVER $FFFF ? |
||||
BNE SSTR ;YES |
||||
JSR DCMP ;IS EA<SA ? |
||||
BCS HT85 ;NO-LOOP |
||||
SSTR JMP STRT ;YES - STOP |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,379 @@
|
||||
.PAG 'UTLII4 04/30/82' |
||||
;WRITE ADR FROM TMP0 STORES |
||||
WROA |
||||
LDA TMP0+1 |
||||
JSR WROB |
||||
LDA TMP0 |
||||
.SKIP 3 |
||||
;WRITE BYTE --- A = BYTE |
||||
;UNPACK BYTE DATA INTO TWO ASCII |
||||
;CHARACTERS. A=BYTE; X,A=CHARS |
||||
WROB PHA |
||||
LSR A |
||||
LSR A |
||||
LSR A |
||||
LSR A |
||||
JSR ASCII ;CONVERT TO ASCII |
||||
TAX |
||||
PLA |
||||
AND #$0F |
||||
JSR ASCII |
||||
.SKIP 3 |
||||
;WRITE 2 CHARS--X,A=CHARS |
||||
WRTWO PHA |
||||
TXA |
||||
JSR WRT |
||||
PLA |
||||
JMP WRT |
||||
.SKIP 3 |
||||
; BINARY TO ASCII |
||||
; |
||||
ASCII CLC |
||||
ADC #$F6 |
||||
BCC ASC1 |
||||
ADC #$06 |
||||
ASC1 ADC #$3A |
||||
RTS |
||||
.SKIP 3 |
||||
T2T2 LDX #2 |
||||
T2T21 LDA TMP0-1,X |
||||
PHA |
||||
LDA TMP2-1,X |
||||
STA TMP0-1,X |
||||
PLA |
||||
STA TMP2-1,X |
||||
DEX |
||||
BNE T2T21 |
||||
RTS |
||||
.SKIP 3 |
||||
; SKIP SPACES READ ADR |
||||
; A=LO,X=HI |
||||
; |
||||
SKADR LDA #0 |
||||
STA BAD |
||||
SKA10 JSR RDOC |
||||
CMP #$20 |
||||
BEQ SKA10 |
||||
JSR RDOB2 |
||||
BCS RDOA3 ;ALWAYS |
||||
.SKIP 3 |
||||
; SKIP 1 CHAR READ ADR |
||||
; A=LO,X=HI |
||||
; |
||||
SRDAE JSR RDOC ;SKIP THE CHAR |
||||
.SKIP 3 |
||||
;READ HEX ADR,RETURN HI IN TMP0, |
||||
;LO IN TMP0+1,AND CY=1 |
||||
;IF SP CY=0 |
||||
RDOA JSR RDOB ;READ 2-CHAR BYTE |
||||
BCC RDERR ;IF SPACE ERROR |
||||
RDOA3 TAX ;SAVE HI IN X |
||||
JSR RDOB |
||||
BCC RDERR ;IF SPACE ERROR |
||||
RTS |
||||
RDERR JMP ERROPR |
||||
.SKIP 3 |
||||
;READ HEX BYTE AND RETURN IN A |
||||
;AND CY=1 IF SP CY=0 |
||||
RDOB LDA #0 ;SPACE |
||||
STA BAD ;READ NEXT CHAR |
||||
JSR RDOC |
||||
RDOB1 CMP #$20 |
||||
BNE RDOB2 |
||||
JSR RDOC ;READ NEXT CHAR |
||||
CMP #$20 |
||||
BNE RDOB3 |
||||
CLC ;CY=0 |
||||
RTS |
||||
RDOB2 JSR HEXIT ;TO HEX |
||||
ASL A |
||||
ASL A |
||||
ASL A |
||||
ASL A |
||||
STA BAD |
||||
JSR RDOC ;2ND CHAR ASSUMED HEX |
||||
RDOB3 JSR HEXIT |
||||
ORA BAD |
||||
SEC ;CY=1 |
||||
RTS |
||||
.SKIP 3 |
||||
HEXIT CMP #$3A |
||||
PHP ;SAVE FLAGS |
||||
AND #$0F |
||||
PLP |
||||
BCC HEX09 ;0-9 |
||||
ADC #8 ;ALPHA ADD 8+CY=9 |
||||
HEX09 RTS |
||||
.SKIP 3 |
||||
RDOC JSR RDT ;READ CHAR |
||||
CMP #$0D ;IS IT A CR |
||||
BNE HEX09 ;NO,RTS |
||||
JMP STRT |
||||
.SKIP 3 |
||||
STOP1 LDA STKEY |
||||
CMP #$FE |
||||
BNE STOP2 |
||||
PHP |
||||
JSR CLRCH |
||||
STA NDX |
||||
PLP |
||||
STOP2 RTS |
||||
.SKIP 3 |
||||
; TWAIT WAIT FOR KEYBOARD IRQ |
||||
; |
||||
TWAIT |
||||
.IFE WALKON < |
||||
LDX #$FF |
||||
LDY #$80 |
||||
TWAIT5 DEX ;KILL TIME |
||||
BNE TWAIT5 |
||||
DEY |
||||
BNE TWAIT5 |
||||
RTS |
||||
> |
||||
.IFN WALKON < |
||||
JSR TSTOP ;CHECK STOP KEY |
||||
BIT D1IFR ;GET INTERUPT BIT |
||||
BMI TWAIT ;BRANCH IF 60 HZ IRQ ON ? |
||||
RTS |
||||
.SKIP 3 |
||||
; TEST FOR STOP KEY |
||||
; |
||||
TSTOP |
||||
JSR STOP1 |
||||
BNE STOP3 |
||||
JSR TNIF ;RESET I/O |
||||
LDA #3 |
||||
STA DFLTO ;RESET DEFAULT OUTPUT |
||||
LDA #0 |
||||
STA DFLTN ;RESET DEFAULT INPUT |
||||
STOP3 RTS |
||||
.SKIP 3 |
||||
; RESET I/O RESTORE 60 HZ IRQ |
||||
; |
||||
TNIF |
||||
PHP |
||||
SEI |
||||
LDA D2PCR ;TURN OFF CASS #2 |
||||
ORA #$02 |
||||
STA D2PCR |
||||
LDA WINTR |
||||
STA CINV ;RE-ENABLE REPEAT KEYS |
||||
LDA WINTR+1 |
||||
STA CINV+1 |
||||
PLP |
||||
RTS |
||||
> |
||||
.SKIP 3 |
||||
; PUT A INTO PCH AND X INTO PCL |
||||
; |
||||
PUTP |
||||
STA PCL |
||||
STX PCH |
||||
RTS |
||||
.SKIP 3 |
||||
; |
||||
;DISPLAY MEM SUBR. SET AR=NUMBER |
||||
;OF MEMORY BYTES DISPLAYED. |
||||
;TMP0=ADR OF MEM DISPLAYED |
||||
; |
||||
DM STA TMPC2 |
||||
LDY #0 |
||||
DM1 JSR SPACE ;WR N BYTES |
||||
JSR R0BYY ;(TMP0)=ADR |
||||
JSR WROB |
||||
JSR INCTMP |
||||
DEC TMPC2 |
||||
BNE DM1 |
||||
RTS |
||||
.SKIP 3 |
||||
;READ AND STORE BYTE. |
||||
;NO STORE IF SPACE OR TMPC = 0. |
||||
BYTE JSR RDOB ;CHAR IN A, CY=0 IF SP |
||||
BCC BY3 ;SPACE |
||||
LDX #0 ;STORE BYTE |
||||
JSR TOR0 ;DO THE STORE |
||||
CMP (R0,X) ;TEST FOR VALID WRITE (RAM) |
||||
BEQ BY3 |
||||
JMP ERROPR |
||||
BY3 JSR INCTMP ;GO INC TMP0 ADR |
||||
DEC TMPC |
||||
RTS |
||||
.SKIP 3 |
||||
SETR LDA #<FLGS ;SET TO ACCESS REGS |
||||
STA TMP0 |
||||
LDA #>FLGS |
||||
STA TMP0+1 |
||||
LDA #5 |
||||
INC NORELO ;TURN OFF RELOCATION |
||||
RTS |
||||
.SKIP 3 |
||||
;INCREMENT (TMP0,TMP0+1) BY 1 |
||||
INCTMP INC TMP0 ;LOW BYTE |
||||
BNE SETWR |
||||
INC TMP0+1 ;HIGH BYTE |
||||
BNE SETWR |
||||
INC WRAP |
||||
SETWR RTS |
||||
.SKIP 3 |
||||
ALTRIT TYA |
||||
PHA |
||||
JSR CRLF |
||||
PLA |
||||
ALTR2 LDX #'. |
||||
JSR WRTWO |
||||
.SKIP 3 |
||||
SPACE LDA #$20 |
||||
.BYT $2C |
||||
CRLF LDA #$D |
||||
JMP WRT |
||||
.SKIP 3 |
||||
; |
||||
DSPLYR |
||||
LDA INDX ;IS THIS A 2 CHARACTER COMMAND? |
||||
CMP #2 |
||||
BCC D1X ;IF NOT THEN JUST DISPLAY REGISTERS |
||||
JSR RDT ;CHECK FOR REMOVE BREAK POINT COMMAND |
||||
CMP #'B |
||||
BNE D1X ;IF NOT A REMOVE BREAK THEN DISPLAY REGISTERS |
||||
LDA OPCODE |
||||
CMP #$FF |
||||
BEQ D1X ;IF NO BREAK POINT THEN DISPLAY REGISTERS |
||||
; |
||||
LDX BRKADR ;PUT INSTRUCTION BACK |
||||
LDY BRKADR+1 |
||||
STX TMP0 |
||||
STY TMP0+1 |
||||
LDY #0 |
||||
JSR PUTBYY ;PUT OPCODE BACK WHERE IT BELONGS |
||||
LDA #$FF |
||||
STA OPCODE |
||||
JMP STRT ;GO BACK AND LOOK FOR MORE COMMANDS |
||||
; |
||||
D1X LDX #0 |
||||
D2 LDA REGK,X |
||||
JSR WRT |
||||
INX |
||||
CPX #22 |
||||
BNE D2 |
||||
JSR CRLF ;START ON NEXT LINE |
||||
LDX #'. |
||||
LDA #'; |
||||
JSR WRTWO |
||||
LDA PCH |
||||
JSR WROB |
||||
LDA PCL |
||||
JSR WROB |
||||
JSR SETR |
||||
JSR DM ;USE DM SUBR. |
||||
DEC NORELO ;TURN ON RELOCATION |
||||
BEQS1 JMP STRT |
||||
ERRS1 JMP ERROPR |
||||
.SKIP 3 |
||||
;ALTER REGISTERS |
||||
; |
||||
ALTR JSR SKADR ;SKIP SPACES READ ADR |
||||
JSR PUTP ;ALTER PC |
||||
JSR SETR ;SET TO ALTER R'S - TURN OFF RELOCATION |
||||
STA TMPC |
||||
A5 JSR RDOC |
||||
JSR BYTE |
||||
BNE A5 |
||||
DEC NORELO ;TURN RELOCATION BACK ON |
||||
BEQ BEQS1 |
||||
.SKIP 3 |
||||
EXIT |
||||
SEI ;DON'T ALLOW INTERUPTS WHILE I ... |
||||
JSR RESIRQ ;RESTORE HIS IRQ VECTOR |
||||
LDX SP |
||||
TXS |
||||
JSR SWAP |
||||
JMP ($A002) ;WARM START BASIC |
||||
.SKIP 3 |
||||
ERRL JMP ERROPR |
||||
.SKIP 3 |
||||
; LOAD/SAVE |
||||
; |
||||
LD |
||||
LDY #1 |
||||
STY FA ;DEFAULT DEVICE #1 |
||||
STY SA ;DEFAULT SA IS 1 FOR LOAD ONLY |
||||
DEY |
||||
STY FNLEN |
||||
STY SATUS ;CLEAR STATUS ON LOAD |
||||
STY VERCK |
||||
LDA #>MTCH ;PLACE TO STORE NAME |
||||
STA FNADR+1 |
||||
LDA #<MTCH |
||||
STA FNADR |
||||
L1 JSR RDT |
||||
CMP #$20 |
||||
BEQ L1 ;SPAN BLANKS |
||||
CMP #CR |
||||
BEQ L5 ;DEFAULT TO LOAD |
||||
CMP #'" |
||||
L2 BNE ERRL ;FILE NAME MUST BE NEXT |
||||
L3 JSR RDT |
||||
CMP #'" |
||||
BEQ L8 ;END OF NAME |
||||
CMP #CR ;DEFAULT A LOAD |
||||
BEQ L5 |
||||
STA (FNADR)Y |
||||
INC FNLEN |
||||
INY |
||||
CPY #16 |
||||
L4 BEQ ERRL ;FILE NAME TOO LONG |
||||
BNE L3 |
||||
L5 LDA SAVCMD |
||||
CMP #'L ;REALLY A LOAD CMD ? |
||||
L6 BNE L2 ;NOT A LOAD |
||||
LDA #0 ;NO VERIFY FLAG |
||||
JSR LD15B2 ;YES |
||||
; |
||||
LL77 JSR TWAIT |
||||
LDA SATUS |
||||
AND #SPERR |
||||
L7 BNE L6 ;LOAD ERROR |
||||
JMP STRT |
||||
L8 JSR RDT |
||||
CMP #CR |
||||
BEQ L5 ;DEFUALT LOAD |
||||
CMP #', |
||||
L9 BNE L7 ;BAD SYNTAX |
||||
JSR RDOB |
||||
AND #$F |
||||
L10 BEQ L4 ;DEVICE 0 |
||||
CMP #3 |
||||
L11 BEQ L10 ;DEVICE 3 |
||||
STA FA |
||||
JSR RDT |
||||
CMP #CR |
||||
BEQ L5 ;DEFAULT LOAD |
||||
CMP #', |
||||
L12 BNE L9 ;BAD SYNTAX |
||||
JSR RDTMP0 ;READ ADR INTO TMP0 |
||||
JSR RDT |
||||
CMP #', |
||||
L13 BNE L12 ;MISSING END ADDR |
||||
JSR RDOA |
||||
STA EAL |
||||
STX EAL+1 |
||||
L20 JSR RDT |
||||
CMP #$20 |
||||
BEQ L20 |
||||
CMP #CR |
||||
L14 BNE L13 ;MISSING CR AT END |
||||
LDA SAVCMD |
||||
CMP #'S ;REALLY A SAVE CMD ? |
||||
BNE L14 |
||||
JSR CRLF ;START 'SAVING...' MSG ON NEXT LINE |
||||
LDA #0 |
||||
STA SA |
||||
LDX EAL |
||||
LDY EAL+1 |
||||
LDA #<TMP0 |
||||
JSR SV5B2 ;YES |
||||
JMP STRT |
||||
; |
||||
.SKIP 5 |
||||
.END |
@ -0,0 +1,330 @@
|
||||
.PAGE 'WLKII4 11/04/80' |
||||
; WALK SUBROUTINE CALL |
||||
; |
||||
JRTS |
||||
JSSS=JRTS-1 |
||||
STA ACC |
||||
PHP |
||||
PLA ;CLEAR BRK FLAG (6502 BUG - PHP SETS BREAK FLAG) |
||||
AND #$EF |
||||
STA FLGS |
||||
STX XR |
||||
STY YR |
||||
PLA ;PC LO |
||||
CLC |
||||
ADC #1 |
||||
STA PCL |
||||
PLA |
||||
ADC #0 |
||||
STA PCH |
||||
LDA #$80 |
||||
STA WSW ;NOW DO A WALK |
||||
BNE WLK010 ;ALWAYS |
||||
.SKIP 3 |
||||
; WALK IRQ HANDLER ROUTINE |
||||
; |
||||
WLKBRK |
||||
PHA ;I HAVE TO SAVE REGISTERS TO ACCESS MY PAGE |
||||
TXA |
||||
PHA |
||||
TYA |
||||
PHA |
||||
TSX ;USE STACK OPOINTER TO GET HIS PSW |
||||
LDA $104,X ;CHECK FOR INTERUPT FLAG SET |
||||
AND #$04 ;IF THE INTERUPT FLAG IS SET DON'T CLI |
||||
BNE NOCLI ;BRANCH IF INTERUPTS DISABLED |
||||
CLI ;ELSE ALLOW INTERUPTS IN HIS PAGE |
||||
NOCLI |
||||
LDY #<OLDIER ;GET OFFSET INTO MY PAGE |
||||
LDA (SPAGE),Y ;TO GET HIS IER |
||||
.IFN WALKON < |
||||
STA D1IER ;RESTORE HIS ENABLED INTERUPTS |
||||
> |
||||
; |
||||
NOP ;IF AN IRQ IS POSTED IT WILL HAPPEN |
||||
SEI ;NOW DISSALLOW IRQ'S |
||||
JSR SWAP ;MAKE MY ZERO PAGE ACTIVE |
||||
PLA |
||||
STA YR ;SAVE HIS Y REGISTER |
||||
PLA |
||||
STA XR ;SAVE HIS X REGISTER |
||||
PLA |
||||
STA ACC ;AND HIS ACCUMULATOR |
||||
CLD |
||||
PLA |
||||
STA FLGS ;HIS PROGRAM STATUS BYTE |
||||
PLA |
||||
STA PCL ;AND PROGRAM COUNTER |
||||
PLA |
||||
STA PCH |
||||
LDA OLDNMI ;RESTORE HIS NMI VECTOR |
||||
STA NMINV |
||||
LDA OLDNMI+1 |
||||
STA NMINV+1 |
||||
JSR REVECT ;INTERCEPT KEY INPUT |
||||
LDA #$20 |
||||
.IFN WALKON < |
||||
STA D2IER ;CLEAR MY TIMMER INTERUPT ENABLE FLAG |
||||
> |
||||
WLK010 |
||||
TSX |
||||
STX SP ;SAVE STACK |
||||
.IFN WALKON < |
||||
LDA D2IFR ;CLEAR LAST NMI TOO! |
||||
STA D2IFR |
||||
> |
||||
CLI |
||||
; |
||||
; CHECK TO SEE IF WE NEED TO PUT A BRK INSTRUCTION BACK |
||||
; |
||||
BIT FULSPD ;IF BIT 7 IS SET PUT A BRK AT BRKADR |
||||
BPL NOTFUL ;BRANCH IF BIT 7 IS CLEAR |
||||
; |
||||
LDA BRKADR ;SET UP TO PUT BRK BACK WHERE HE SAID |
||||
STA TMP0 |
||||
LDA BRKADR+1 |
||||
STA TMP0+1 |
||||
LDY #0 |
||||
JSR R0BYY ;GET THE OPCODE AT BRKADR |
||||
; |
||||
STA OPCODE ;SAVE IT HERE SO WE CAN PUT IT BACK LATER |
||||
LDA #0 |
||||
JSR PUTBYY ;PUT A BREAK INSTRUCTION HERE INSTEAD |
||||
BIT FULSPD ;WAS IT A GO COMMAND? |
||||
BVC ITSAWK ;BRANCH IF NOT |
||||
; |
||||
STA FULSPD ;TURN OFF FULL SPEED FLAG |
||||
JMP WLK200 ;AND GO FULL SPEED |
||||
; |
||||
ITSAWK STA FULSPD ;CLEAR THE FLAG AND CONT WALK OR TRACE |
||||
; |
||||
NOTFUL |
||||
; |
||||
BIT WSW ;QUICK TRACE ENABLED ? |
||||
BVC TBR050 ;NO |
||||
LDA PCH ;YES - IS THIS BREAK ADR ? |
||||
CMP BRKADR+1 |
||||
BNE TBR600 ;NO - WALK ON |
||||
LDA PCL ;MAYBE - CHECK LO PC |
||||
CMP BRKADR |
||||
BNE TBR600 ;NO |
||||
LDA TMP12 ;A LAST OCCURENCE ? |
||||
BNE TBR500 ;NO |
||||
LDA TMP12+1 ;MAYBE |
||||
BNE TBR400 ;NO |
||||
LDA #$80 ;ENABLE WALK |
||||
STA WSW |
||||
TBR050 |
||||
BMI TBR055 ;IF A WALK |
||||
LSR WSW ;INTO A JSR WALK |
||||
BCS WSWX1 ;NO THEN A BREAK |
||||
JMP B5 |
||||
WSWX1 |
||||
LDX SP ;SET TO USER STACK |
||||
TXS |
||||
LDA JSRVEC+1 ;NOW PUSH A FAKE RETURN ADR |
||||
PHA |
||||
LDA JSRVEC |
||||
PHA |
||||
JMP WLK330 ;GO DO THE REST OF THE SUBROUTINE |
||||
TBR055 JSR CRLF ;START WITH RETURN |
||||
LDA PCL ;COPY PC TO TMP0 |
||||
LDX PCH |
||||
STA TMP0 |
||||
STX TMP0+1 |
||||
JSR SPACE |
||||
LDA #'$ ;DON'T PRINT "$"'S |
||||
STA PTCH |
||||
JSR DIS400 ;DISASSEMBLE ONE LINE |
||||
TBR100 JSR GETIN ;GET KEYS |
||||
BEQ TBR100 ;WAIT FOR A KEY |
||||
CMP #$03 ;STOP KEY ? |
||||
BNE TBR200 ;NO |
||||
TBRSTR JMP STRT ;YES - STOP |
||||
TBR200 CMP #'J ;A SUBROUTINE EXEC |
||||
BNE WLK200 ;NO - WALK AGAIN |
||||
LDA #1 ;QUICK TRACE ONE STEP ONLY |
||||
STA WSW ;TO GET A RETURN ADR ON STACK |
||||
BNE WLK200 ;ALWAYS |
||||
.SKIP 3 |
||||
TBR400 DEC TMP12+1 ;DEC HI OCCURENCE CTR |
||||
TBR500 DEC TMP12 ;DEC LO CTR |
||||
TBR600 LDA ROWS ;CHECK FOR STOP AND "=" KEYS |
||||
CMP #$FA |
||||
BNE WLK200 ;NO - TRACE ON |
||||
LDX #'S ;YES - S FOR STOP |
||||
JMP B567 ;FINISH A BREAK |
||||
.SKIP 3 |
||||
; GO COMMAND |
||||
; SYNTAX G |
||||
; SYNTAX G 1111 |
||||
; |
||||
GO |
||||
LDA #0 |
||||
BEQ WLK050 ;ALWAYS |
||||
.SKIP 3 |
||||
; QUICK TRACE |
||||
; SYNTAX Q |
||||
; SYNTAX Q 0000 |
||||
; 0000=ADR TO START FROM |
||||
QUICK |
||||
LDA #$40 ;ENABLE QUICK TRACE |
||||
BNE WLK050 ;ALWAYS |
||||
.SKIP 3 |
||||
; WALK THRU MACHINE CODE |
||||
; SYNTAX W |
||||
; SYNTAX W 0000 |
||||
; 0000=ADR TO START FROM |
||||
; |
||||
WALK LDA #$80 ;CLEAR QUICK TRACE |
||||
WLK050 STA WSW |
||||
STA RBUSY ;DISABLE SCROLL CONTROL UNTIL STOP |
||||
LDY BRKCNT ;SET NUMBER OF OCCURENCES BEFORE BREAK |
||||
STY TMP12 |
||||
LDY BRKCNT+1 |
||||
STY TMP12+1 |
||||
JSR RDT ;GET NEXT CHAR |
||||
CMP #$0D ;A RETURN ? |
||||
BEQ WLK100 ;YES - USE OLD PC |
||||
CMP #$20 ;A SPACE ? |
||||
BEQ NOERR1 ;NO - BAD SYNTAX |
||||
JMP WLKERR ;DO ERROR MSG |
||||
; |
||||
NOERR1 |
||||
JSR RDOA ;YES - READ WALK ADR |
||||
JSR PUTP ;PUT IN PCL AND PCH |
||||
JSR RDT ;GET END RETURN OUT OF BUFFER |
||||
CMP #$0D |
||||
BEQ NOERR2 ;NONE ERROR |
||||
JMP WLKERR ;DO THE ERROR |
||||
; |
||||
NOERR2 |
||||
WLK100 JSR CRLF ;START NEW LINE |
||||
WLK200 |
||||
LDA OPCODE |
||||
CMP #$FF ;IS THERE AN ACTIVE BREAK POINT? |
||||
BEQ NOPE ;BRANCH IF NOT |
||||
; |
||||
LDX BRKADR ;SETUP TO PUT CORECT OPCODE AT BREAK ADR |
||||
CPX PCL ;ARE WE AT A BREAK POINT? |
||||
BNE BRELSE ;BRANCH IF NOT |
||||
LDY BRKADR+1 |
||||
CPY PCH |
||||
BNE BRELSE ;BRANCH IF NOT AT A BREAK POINT |
||||
; |
||||
STY TMP0+1 ;SETUP TO PUT OPCODE BACK |
||||
STX TMP0 |
||||
LDX WSW |
||||
BNE DOWALK ;BRANCH IF ITS NOT A GO INSTRUCTION |
||||
; |
||||
LDY #0 |
||||
JSR PUTBYY ;PUT CORECT OPCODE AT BRKADR (.A=OPCODE) |
||||
; |
||||
LDA #$80 |
||||
STA FULSPD ;SET REPLACE BREAKPOINT FLAG |
||||
; |
||||
; |
||||
LDA #$C0 ;INDICATE REPLACE BREAKPOINT AND GO AFTER - DO 1 INS |
||||
STA FULSPD |
||||
BNE DOWALK ;GO DO ONE INSTRUCTION UNDER MY CONTROL |
||||
; |
||||
BRELSE |
||||
; |
||||
; THERE'S AN ACTIVE BREAK POINT -- MAKE SURE IT'S SET |
||||
; |
||||
LDA WSW ;SEE IF ITS A GO COMMAND |
||||
BNE DOWALK ;IF NOT DON'T WORRY ABOUT A BRK INSTRUCTION |
||||
STX TMP0 ;SET UP TO PUT A BRK INSTRUCTION |
||||
LDY BRKADR+1 |
||||
STY TMP0+1 |
||||
LDY #0 |
||||
LDA #0 ;PUT A BRK INSTRUCTION AT THE BRKADR |
||||
TAY ;ZERO INDEX |
||||
JSR PUTBYY |
||||
; |
||||
NOPE |
||||
; |
||||
; THERE IS NO BREAK POINT ACTIVE |
||||
; |
||||
LDA WSW ;IS IT A SIMPLE GO COMMAND |
||||
BEQ SETSTK ;BRANCH IF SO - GIVE HIM BACK HIS REGISTERS |
||||
; |
||||
DOWALK |
||||
.IFN WALKON < |
||||
SEI |
||||
LDA #$A0 ;ENABLE NMI FROM TIMMER2 |
||||
STA D2IER |
||||
LDA #$00 |
||||
STA D2ACR |
||||
> |
||||
WLK300 |
||||
.IFN WALKON < |
||||
LDA WWLK+1 ;SET UP NMI VECTOR |
||||
STA NMINV+1 |
||||
LDA WWLK |
||||
STA NMINV |
||||
> |
||||
SETSTK |
||||
SEI ;DISALLOW INTERUPTS FOR IRQ VECTOR AND ZERO PAGE SWAP |
||||
LDX SP ;GIVE BACK HIS STACK POINTER |
||||
TXS |
||||
WLK330 |
||||
LDA PCH ;GIVE BACK HIS PROGRAM COUNTER |
||||
PHA |
||||
LDA PCL |
||||
PHA |
||||
LDA FLGS ;HIS STATUS BYTE |
||||
PHA |
||||
LDA ACC |
||||
PHA ;SAVE FOR THE LAST |
||||
LDX XR |
||||
LDY YR |
||||
LDA WSW |
||||
ORA FULSPD ;IS IT A GO AND NO BRK ACTIVE? |
||||
PHP ;SAVE FOR AFTER THE SWAP |
||||
.IFN WALKON < |
||||
LDA D1IER ;DISABLE IRQ'S DURING THIS INSTRUCTION |
||||
> |
||||
STA OLDIER ;SAVE WHAT EVER INTERUPTS ARE ENABLED IN MY PAGE |
||||
JSR RESIRQ ;GIVE BACK HIS IRQ VECTOR |
||||
JSR SWAP ;GIVE HIM BACK HIS ZERO PAGE |
||||
PLP |
||||
BEQ LETRIP ;IF STRAIGHT GO THEN LET IT RIP |
||||
; |
||||
.IFN WALKON < |
||||
LDA #$7F ;DISABLE ALL INTERUPTS |
||||
STA D1IER ;VIA INTERUPT ENABLE REGISTER |
||||
LDA #<WLKNUM ;MAKE T2 TIMEOUT AT INST |
||||
STA D2T2L |
||||
LDA #>WLKNUM ;START THE CLOCK |
||||
STA D2T2H ;START THE CLOCK |
||||
> |
||||
LETRIP |
||||
PLA ;RETURN HIS ACCUMULATER |
||||
RTI |
||||
; |
||||
WLKERR JMP ERROPR |
||||
.SKIP 3 |
||||
; SET QUICK TRACE BREAK POINT |
||||
; SYNTAX B 0000 1111 |
||||
; 0000=STOP ADR |
||||
; 1111=OCCURENCE # |
||||
; |
||||
BREAK JSR SKADR ;STOP ADR AND MAYBE # |
||||
STA TMP0 |
||||
STX TMP0+1 ;USE TMP TO CHECK FOR PRESENCE OF RAM |
||||
STA BRKADR |
||||
STX BRKADR+1 |
||||
LDY #0 |
||||
JSR R0BYY ;GET THE OPCODE TO FLAG ACTIVE BREAKPOINT |
||||
STA OPCODE |
||||
TYA ;ZERO BREAK ON N'TH OCCURENCE FLAG |
||||
LDA #0 |
||||
STA BRKCNT |
||||
STA BRKCNT+1 |
||||
JSR SRDAE ;READ BREAK COUNT |
||||
STA BRKCNT |
||||
STX BRKCNT+1 |
||||
JMP STRT |
||||
.SKIP 5 |
||||
.END |
Loading…
Reference in new issue