You are on page 1of 62
10 ORG SEe00 20 LST OFF 30 XC OFF ;6502 only 40 EXP ON ;print only macro call 58 LSTDO OFF ;don't list conditional code 66 TR OFF ;don't truncate listing to 3 bytes 78 CYC OFF’ ;don't print cycle times 88 USE MACROS 90 LST ON 199 Sh t Adobe soone spoon Soon E DOES CORES HCO REECE ie * * 120 * INTEGER BASIC * 130 * * ao * woz * 150 * * 169 eb eeoodearaodr soda nEdSdr USS EE SOO BEE ACOBEEaCEE ve * * 180 * "That BASIC, which we shipped with the first * 190 * Apple IT's, was never assembled -- ever * 200 * There was one handwritten copy, all * 219 * handwritten, all hand assembled." * 220 * * 230 * Steve Wozniak * 240 + Call-A.P.P.L.E., October 1986 = * 250 + * Pe eet eter terran reer tereetetiensetTeteenteetrenss 270 280 * Computer Apple II family 290 * O/S none needed, but usually DOS 3.3 300 * Language 6502 assembly -- Nerlin assembler 310 * Disassembled by: 320 + Paul R. Santa-Maria 330 + P.0. Box 924 340 + Monroe MI 48161 350 * Revised 1 May 2000 360 * Reference "What's Where in the Apple"; William F. Luebbert 370 * Peeking at Call-A.P.P.L.E. Vol 2 1979; pp44-61 380 phy peeeeenacesenacecnetereecacenecereetcrrcaccertsse’ 400 410 * zero-page 420 430 LOMEM = $004 ;ptr: start of vars 440 HIMEM = $004C jptr: end of BASIC program 450 NOUNSTKL jun stack low bytes (80-87) 460 SYNSTKH = $0058 ; syntax stack high byte 470 NOUNSTKH = $0078’ ;noun stack high bytes (78-97) 480 SYNSTKL = $0080 ; syntax stack low bytes (80-9F) 490 NOUNSTKC = $00A0\ ;noun stack counter (AQ-BF) 500 TXTNDXSTK = $00A8’;text index stack (A8-C7) 510 TXTNDX = $00C8 ;text index val (OUTVAL) 520 LEADBL = $0@C9 ;leading blanks index (YTEMP) 530 PP = SOOCA ;ptr: start of program 540 PV = SOecC ;ptr: end of vars 550 ACC = $00CE ;word: main accumulator 560 SRCH = $0000 ;ptr to search var tbl 570 TOKNDXSTK = $00D1 ;token index stack (D1-F0) 580 SRCH2 = $0002 ;second var search ptr 590 600 610 620 630 640 650 660 670 680 690 790 710 720 730 740 750 760 778 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 949 950 960 970 980 990 1000 1010 1020 1030 1049 1050 1060 1070 1080 1090 1190 1116 1126 1130 1140 1150 1160 IFFLAG = $0004 ;IF/THEN fail flag CRFLAG = $00D5 ;carriage return flag VERBNOW = $00D6 ;verb currently in use PRFLAG = $0007 ;print it now flag XSAVE = $00D8 ;temp Xreg save RUNFLAG = $009 ; run mode flag AUX = $00DA ;word: aux ctr PR = $08DC ;word: current Line value *PN = SOODE ;ptr to current noun PX = $00EO ;ptr to current verb Pl = $00E2 ;aux ptr 1 (delete Line ptr) P2 = SO0E4 jaux ptr 2 * (Line num adr) (next Line num) (general flag) P3 = S$O0E6 ;aux ptr 3 (next ptr) TOKNDX = $00F1 ;token index val PCON = $00F2 ;continue ptr (PRDEC low/high) AUTOINC = $00F4 ;auto Line increment AUTOLN = $00F6 ;current auto Line AUTOFLAG = $OOF8 ;auto Line mode flag ($FF = on) CHAR = $00F9 ;current char LEADZR = $00FA ;leading zeros index ($00, $A0,$B9) FORNDX = $00FB ;FOR-NEXT loop index GOSUBNDX = $OOFC ;GOSUB index SYNSTKDX = $O0FD ;syntax stack index val SYNPAG = $00FE ;ptr: syntax page ‘if SYNPAG+1 <> 6 then error condition exists STACK = $0100 ;6502 STACK * — GOSUB/RETURN usage STK_00 = STACK+$00 STK 10 = STACK+$10 STK_20 = STACK#+$26 STK_30 = STACK#+$30 * — FOR/NEXT/STEP usage STK_49 = STACK+$40 STK 50 = STACK+$50 STK_60 = STACK+$60 STK_70 = STACK+$70 STK_80 = STACK#+$80 STK 90 STK_AO STACK+$90 STACK+SAQ STK BO = STACK+$B0 STK_CO = STACK+SCO STK DO = STACK+$09 * 1/0 addresses KBD = $co00 KBDSTRB = §CO10 * Monitor zero page and low memory WNDWDTH = $0021 H = $0024 1176 1180 1190 1290 1210 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 1350 1360 1370 1380 1390 1490 1410 1420 1430 1440 1450 1460 1470 1480 1490 1500 1510 1520 1530 1540 1550 1560 1570 1580 1590 1600 1618 1620 1630 1640 1650 1660 1670 1680 1690 1700 1710 1720 1730 1749 cv = $0025 GBAS = $0026 H2 = $002C v2 = $0020 Al = $003C A2 = $003E PROMPT = $0033 RNDL = $004E RNDH = $004F N = $0200 * Monitor routines PLOT $F800 HLINE = $F819 VLINE = $F828 GBASCALC = $F847 SETCOL = $F864 PREAD = SFB1E SETTXT = $FB39 SETGR = $FB40 VTAB = $FC22 SFECD SFECF READ = $FEFD NXTCHAR = $FD75, CROUT = SFD8E COUT = $FDED INPORT = $FE8B OUTPORT = $FE9S BELL = $FF3A * ASCII (excess $8000 for xref Listing) ETX = $8003 ;CTRL-C LF = $800A CR = $8000 BLANK = $8620 DQT = $8022 Sat = $8027 * jZ = unreferenced area * |V_ = referenced in verb table * ;VO = referenced in verb table only * jsolo = one reference only (could be in-line) PUT PARTI. BASIC JSR COLD BASIC2 JMP WARM SetPrompt ;solo STA PROMPT IMP COUT RTS ;Z

You might also like