
 1000  *SAVE S.ERASE (JEFF CREAMER)
 1010  *--------------------------------
 1020  *                               *
 1030  *        ERASE ROUTINE          *
 1040  *                               *
 1050  *        Jeff Creamer           *
 1060  *                               *
 1070  *   CALL 768,(WIDTH),(DEPTH)    *
 1080  *                               *
 1090  *--------------------------------
 1100  *      PAGE ZERO VARIABLES
 1110  *--------------------------------
 1120  MON.CH     .EQ $24
 1130  MON.CV     .EQ $25
 1140  *--------------------------------
 1150  *      APPLESOFT ROUTINES USED
 1160  *--------------------------------
 1170  AS.CHKCOM  .EQ $DEBE
 1180  AS.GETBYT  .EQ $E6F8
 1190  AS.IQERR   .EQ $E199
 1200  *--------------------------------
 1210  *      MONITOR ROUTINES USED
 1220  *--------------------------------
 1230  MON.VTAB   .EQ $FC22
 1240  MON.PRBL2  .EQ $F94A
 1250  *--------------------------------
 1260         .OR $300
 1270         .TF ERASE
 1280  *--------------------------------
 1290  *      JEFF'S ERASE ROUTINE
 1300  *--------------------------------
 1310  ERASE  LDA MON.CV    GET VERTICAL COORD
 1320         PHA           SAVE ON STACK
 1330         LDA MON.CH    AND HORIZ COORD
 1340         PHA           SAVE IT ON STACK, TOO
 1350         JSR AS.CHKCOM    COMMA?
 1360         JSR AS.GETBYT    YES, GET WIDTH TO ERASE
 1370         TXA           INTO ACC
 1380         BEQ .4        WIDTH MUST BE NON-ZERO
 1390         PHA           PUSH WIDTH ON STACK
 1400         JSR AS.CHKCOM    COMMA NEXT?
 1410         JSR AS.GETBYT    YES, GET DEPTH
 1420         TXA           AND TRANSFER TO ACC
 1430         BEQ .4        DEPTH MUST BE NON-ZERO
 1440         TAY           DEPTH INTO Y REGISTER
 1450         PLA           WIDTH BACK OFF STACK
 1460         PHA           BUT KEEP IT THERE ALSO
 1470         TAX           AND INTO X-REG
 1480  .1     LDA MON.CV    REMEMBER CV ON STACK
 1490         PHA
 1500         JSR MON.PRBL2     PRINT WIDTH # OF BLANKS
 1510         PLA           GET OLD CV OFF STACK
 1520         DEY           DECREMENT DEPTH
 1530         BEQ .3        ZERO LINES LEFT?
 1540         TAX           OLD CV INTO X-REGISTER
 1550         INX           NEXT LINE
 1560         CPX #24       OFF THE BOTTOM?
 1570         BCC .2        NO, USE THIS ONE
 1580         LDX #0        YES, WRAP BACK TO TOP
 1590  .2     STX MON.CV
 1600         JSR MON.VTAB      ADJUST BASE ADDRESS
 1610         PLA           WIDTH OFF STACK
 1620         TAX           TO SET UP X AGAIN
 1630         PLA           HORIZ COORD OFF STACK
 1640         PHA           BUT MAINTAIN IT THERE ALSO
 1650         STA MON.CH        AND RESTORE HCURSOR
 1660         TXA           PUSH WIDTH BACK ON STACK
 1670         PHA           FOR NEXT TIME AROUND
 1680         BNE .1        LOOP ALWAYS
 1690  .3     PLA           POP WIDTH OFF
 1700         PLA           GET HORIZ COORDINATE
 1710         STA MON.CH        AND RESTORE IT
 1720         PLA           GET VERTICAL COOORDINATE
 1730         STA MON.CV        RESTORE IT, TOO
 1740         JSR MON.VTAB      ADJUST BASE ADDRESS
 1750         RTS           DONE
 1760  .4     JMP AS.IQERR  ILLEGAL QUANTITY ERROR

