goapple2/source/progaid/renumapp.asm
2014-08-05 22:19:14 -07:00

81 lines
2.3 KiB
NASM

**************************************************
* *
* APPLE-][ BASIC RENUMBER / APPEND SUBROUTINES *
* *
* VERSION TWO *
* RENUMBER *
* >CLR *
* >START= *
* >STEP= *
* >CALL -10531 *
* *
* OPTIONAL *
* >FROM= *
* >TO= *
* >CALL -10521 *
* *
* USE RENX ENTRY *
* FOR RENUMBER ALL *
* *
* WOZ APRIL 12, 1978 *
* APPLE COMPUTER INC. *
**************************************************
*
*
*
*
ROL EQU $0 LOW-ORDER SW16 R0 BYTE.
ROH EQU $1 HI-ORDER.
ONE EQU $01
R11L EQU $16 LOW-ORDER SW16 R11 BYTE.
R11H EQU $17 HI-ORDER.
HIMEM EQU $4C BASIC HIMEM POINTER.
PPL EQU $CA BASIC PROG POINTER.
PVL EQU $CC BASIC VAR POINTER.
MEMFULL EQU $E36B BASIC MEM FULL ERROR.
PRDEC EQU $E51B BASIC DECIMAL PRINT SUBR.
RANGERR EQU $EE68 BASIC RANGE ERROR.
LOAD EQU $F0DF BASIC LOAD SUBR.
SW16 EQU $F689 SWEET 16 ENTRY.
CROUT EQU $FD8E CAR RET SUBR.
COUT EQU $FDED CHAR OUT SUBR.
*
* SWEET 16 EQUATES
*
ACC EQU $0 SWEET 16 ACCUMULATOR.
NEWLOW EQU $1 NEW INITIAL LNO.
NEWINCR EQU $2 NEW LNO INCR.
LNLOW EQU $3 LOW LNO OF RENUM RANGE.
LNHI EQU $4 HI LNO OF RENUM RANGE.
TBLSTRT EQU $5 LNO TABLE START.
TBLNDX1 EQU $6 PASS 1 LNO TBL INDEX.
TBLIM EQU $7 LNO TABLE LIMIT.
SCR8 EQU $8 SCRATCH REG.
HMEM EQU $8 HIMEM (END OF PRGM).
SCR9 EQU $9 SCRATCH REG.
PRGNDX EQU $9 PASS 1 PROG INDEX.
PRGNDX1 EQU $A ALSO PROG INDEX.
NEWLN EQU $B NEXT "NEW LNO".
NEWLN1 EQU $C PRIOR "NEW LNO" ASSIGN.
TBLND EQU $6 PASS 2 LNO TABLE END.
PRGNDX2 EQU $7 PASS 2 PROG INDEX.
CHR0 EQU $9 ASCII "0".
CHRA EQU $A ASCII "A".
MODE EQU $C CONST/LNO MODE.
TBLNDX2 EQU $B LNO TBL IDX FOR UPDATE.
OLDLN EQU $D OLD LNO FOR UPDATE.
STRCON EQU $B BASIC STR CON TOKEN.
REM EQU $C BASIC REM TOKEN
R13 EQU $D SWEET 16 REG 13 (CPR REG).
THEN EQU $D BASIC THEN TOKEN
LIST EQU $D BASIC LIST TOKEN
DEL EQU $D
SCRC EQU $C SCRATCH REG FOR APPEND.
*
* APPLE-11 BASIC RENUMBER SUBROUTINE - PASS 1
ORG $D400
OBJ $A400