; Commodore 128 RAM Memory Map ; V1.3b 18 Nov 1994 C128 Memory Map This is as complete as possible compilation of two separate memory maps, and a few random sources which naturally do differ from each other. C128 RAM All Banks 0000 I/O direction register 0001 I/O port, similar to C64 0002 Token 'SEARCH' looks for, Bank Number, Jump to SYS Address 0003-0004 SYS address, MLM register PC 0005-0009 SYS and MLM register save (SR, A, X, Y, SP) 0005 SR Temp 0006 AC Temp 0007 XR Temp 0008 YR Temp 0009 SP Temp, Integer 000a Scan-quotes flag 000b TAB column save 000c Flag: 0 = LOAD, 1 = VERIFY 000d Input buffer pointer / number of subscripts 000e Default DIM flag 000f Data Type: FF = string, 00 = numeric 0010 Data Type: 80 = integer, 00 = floating point 0011 DATA scan / LIST quote / memory flag 0012 Subscript / FNxx flag 0013 Flag: 0 = INPUT, $40 = GET, $98 = READ 0014 ATN sign / Comparison evaluation flag 0015 Current I/O prompt flag 0016-0017 Integer value 0018 Pointer: temporary string stack 0019-0023 Stack for temporary strings 0024-0027 Utility pointer area 0028-002c Product area for multiplication 002d-002e Pointer: Start-of-BASIC (bank 0) [1C01] 002f-0030 Pointer: Start-of-variables (bank 1) [0400] 0031-0032 Pointer: Start-of-arrays 0033-0034 Pointer: End-of-arrays 0035-0036 Pointer string-storage (moving down) 0037-0038 Utility string pointer 0039-003a Pointer: Limit-of-memory (bank 1) [FF00] 003b-003c Current BASIC line number 003d-003e Textpointer: BASIC work point (chrget) 003f-0040 Utility Pointer 0041-0042 Current DATA line number 0043-0044 Current DATA address 0045-0046 Input vector 0047-0048 Current variable name 0049-004a Current variable address 004b-004c Variable pointer for FOR/NEXT 004d-004e Y-save, op-save, BASIC pointer save 004f Comparison symbol accumulator 0050-0055 Miscellaneous work area, pointers, and so on 0056-0058 Jump vector for functions 0059-0062 Miscellaneous numeric work area 0060-0062 MLM Address 0 0063-0065 MLM Address 1 0066-0068 MLM Address 2 0063 Accum #1 exponent 0064-0067 Accum #1 mantissa 0068 Accum #1 sign 0069 Series evaluation constant pointer 006a-006f Accum #2 exponent, and so on 0070 Sign comparison Acc #1 versus #2 0071 Accum #1 lo-order (rounding) 0072-0073 Cassette buffer len / Series pointer 0074-0075 Auto line number increment 0076 Graphics flag: FF = Graphics allocated, 00 = Not allocated 0077 Color source number 0078-0079 Temporary counters 007a-007c DS$ descriptor 007d-007e BASIC pseudo-stack pointer 007f Flag: 0 = direct mode 0080-0081 DOS, USING work flags 0082 Stack pointer save for errors 0083 Graphic color source 0084 Multicolor 1 (1) 0085 Multicolor 2 (2) 0086 Graphic foreground color (13) 0087-008a Graphic scale factors, X & Y 008b-008f Graphic work values 0090 Status word ST 0091 Keyswitch 1A: STOP and RVS flags 7 STOP 6 Q 5 C= 4 Space 3 2 2 CTRL 1 <- 0 1 0092 Timing constant for tape ($80) 0093 Work value, monitor, LOAD / SAVE: 0 = LOAD, 1 = VERIFY 0094 Serial output, deferred character flag 0095 Serial deferred character 0096 Cassette work value 0097 Register save 0098 How many open files 0099 Input device, normally 0 009a Output CMD device, normally 3 009b-009c Tape parity, output-received flag 009d I/O messages: 192 = all, 128 = commands, 64 = errors, 0 = nil 009e-009f Tape error pointers 00a0-00a2 Jiffy clock HML 00a3-00a4 Temp data area 00a5-00a6 I/O work bytes (tape) 00a7-00ab RS-232C Receive, Misc Work Values 00a7 RS-232 Input Bit Storage, Cassette Short Count 00a8 RS-232 Bit Count In, Cassette Read Error 00a9 RS-232 Flag For Start Bit Check, Cassette Reading Zeroes 00aa RS-232 Byte Buffer, Cassette Read Mode 00ab RS-232 Parity Storage, Cassette Short Cnt 00ac-00ad Pointer for tape buffer and screen scrolling 00ae-00af Tape end address / End of program 00b0-00b1 Tape timing constants 00b2-00b3 Pointer: Start of tape buffer 00b4-00b6 RS-232 Send, Misc work values 00b4 RS-232 Bit Count 00b5 RS-232 Next Bit To Be Sent 00b6 RS-232 Byte Buffer 00b7 Number of characters in file name 00b8 Current logical file 00b9 Current secondary address 00ba Current device 00bb-00bc Pointer to file name 00bd RS-232 TRNS Parity Buffer 00be Cassette Read Block Count 00bf Serial Word Buffer 00c0 Cassette Manual/Cntrolled Switch (Updated during IRQ) 00c1-00c2 I/O Start Address 00c3-00c4 Cassette LOAD Temps (2 bytes) 00c5 Tape Read/Write Data 00c6-00c7 BANKS: I/O data, filename 00c8-00c9 RS-232 input buffer addresses [0c00] 00ca-00cb RS-232 output buffer addresses [0d00] 00cc-00cd Keyboard decode pointer (bank 15) [fa80] 00ce-00cf Print string work pointer 00d0 Number of characters in keyboard buffer 00d1 Number of programmed chars waiting 00d2 Programmed key character index 00d3 Key shift flag: 0 No shift 1 Shift 2 C= 4 Control 8 Alt 15 Caps Lock 00d4 Current key code: 88 = no key 00d5 Previous key code: 88 = no key 00d6 Input from screen / from keyboard 00d7 40 / 80 columns: 0 = 40 column screen 00d8 Graphics mode code 000 0 Graphic 0 001 1 1 011 2 2 101 3 3 111 4 4 00d9 Character base: 0 = ROM, 4 = RAM 00da-00df Misc Editor work area 00e0-00e1 Pointer to screen line / cursor 00e2-00e3 Color line pointer 00e4 Current screen bottom margin 00e5 Current screen top margin 00e6 Current screen left margin 00e7 Current screen right margin 00e8-00e9 Input cursor log (row, column) 00ea End-of-line for input pointer 00eb Row where cursor lives 00ec Position of cursor on screen line 00ed Maximum screen lines (24) 00ee Maximum screen columns (39) 00ef Current I/O character 00f0 Previous character printed 00f1 Character color 00f2 Temporary color save 00f3 Screen reverse flag 00f4 Quotes flag (Editor) ; 0 = direct cursor, else programmed 00f5 Number of INSERTs outstanding 00f6 255 = Auto Insert enabled 00f7 Text mode lockout (SHFT-C=): 0 = enabled, 128 = disabled 00f8 Scrolling: 0 = enabled, 128 = disabled 00f9 Bell (CTRL-G): 0= enable, 128 = disable 00fa-00fe Not used 00ff Basic Scratch 0100-01ff Processor Stack Area 0100-013e Tape error log 0100-0124 DOS work area 0100 Tape Read Errors, Area to build filename in (16 bytes) 0110 DOS Loop Counter 0111 DOS Filename 1 Len 0112 DOS Disk Drive 1 0113 DOS Filename 2 Len 0114 DOS Disk Drive 2 0115 DOS Filename 2 Addr 0117 BLOAD/BSAVE Starting Address 0119 BLOAD/BSAVE Ending Address 011B DOS Logical Addr [00] 011C DOS Phys Addr [08] 011D DOS Sec. Addr [6F] 011E DOS Record Length 0120 DOS Disk ID 0122 DOS DSK ID FLG SPACE Used by PRINT USING 0123 Pointer to Begin. NO. 0124 Pointer to End NO. 0125-0138 PRINT / USING work area 0125 Dollar Flag 0126 Comma Flag, PLAY: VOXTUM flag 0127 Counter 0128 Sign Exponent 0129 Pointer to Exponent 012A # Of Digits Before Decimal Point 012B Justify Flag 012C # Of Pos Before Decimal Point (Field) 012D # Of Pos After Decimal Point (Field) 012E +/- Flag (Field) 012F Exponent Flag (Field) 0130 Switch 0131 Char Counter (Field) 0132 Sign No 0133 Blank/Star Flag 0134 Pointer to Begin of Field 0135 Length of Format 0136 Pointer to End Of Field 0137 System Stack ($0137-$01FF) 0200-03ff Vectors, buffers, Kernal RAM 0200-02a1 BASIC & Monitor input buffer 02a2-02ae 674-686 Kernal RAM 02a2-02ae Bank Peek Subroutine 02af-02bd Bank Poke Subroutine 02be-02cc Bank Compare Subroutine 02cd-02e2 JSR to Another Bank 02e3-02fb JMP to Another Bank 02fc-02fd Function Execute Hook [4c78] 0300-0301 Error Message Link [4D3F] 0302-0303 BASIC Warm Start Link [4DC6] 0304-0305 Crunch BASIC Tokens Link [430D] 0306-0307 Print Tokens Link [5151] 0308-0309 Start New BASIC Code Link [4AA2] 030a-030b Get Arithmetic Element Link [78DA] 030c-030d Crunch FE Hook [4321] 030e-030f List FE Hook [51CD] 0310-0311 Execute FE Hook [4BA9] 0312-0313 Unused 0314-0315 IRQ Vector [FA65] 0316-0317 Break Interrupt Vector [B003] 0318-0319 NMI Interrupt Vector [FA40] 031a-031b OPEN Vector [EFBD] 031c-031d CLOSE Vector [F188] 031e-031f Set Input Vector [F106] 0320-0321 Set Output Vector [F14C] 0322-0323 Restore I/O Vector [F226] 0324-0325 Input Vector [EF06] 0326-0327 Output Vector [EF79] 0328-0329 Test STOP Key [F66E] 032a-03ab GET Vector [EEEB] 032c-032d Abort I/O Vector [F222] 032e-032f Machine Lang Monitor Link [B006] 0330-0331 LOAD Link [F26C] 0332-0333 SAVE Link [F54E] ; I/O Vectors 0334-0335 Print Control Code Link [C7B9] 0336-0337 Print High ASCII Code Link [C805] 0338-0339 Print ESC Sequence Link [C9C1] 033a-033b Keyscan Link [C5E1] 033c-033d Store Key [C6AD] 033e-033f Pointer to KBD Decoding Table: Unshifted [FA80 / FD29] 0340-0341 Pointer to KBD Decoding Table: Shifted [FAD9 / FD82] 0342-0343 Pointer to KBD Decoding Table: Commodore [FB32 / FDDB] 0344-0345 Pointer to KBD Decoding Table: Control [FB8B / FE34] 1) 0346-0347 Pointer to KBD Decoding Table: Alt [FA80 / FD29] 0348-0349 Pointer to KBD Decoding Table: Ascii/DIN [FB4E / FD29] 1) The value FE34 is used in German version, it doesn't change in others. 034a-0353 IRQ Keyboard Buffer (10 Bytes) FF = No key 0354-035d Bitmap Of TAB Stops (10 Bytes) 035e-0361 Bitmap Of Line Wraps 0362-036b Logical File Number Table 036c-0375 Device Number Table 0376-037f Secondary Addresse Table 0380-039e CHRGET Subroutine 0386 CHRGOT Entry 039f-03aa Fetch From RAM Bank 0 03ab-03b6 Fetch From RAM Bank 1 03b7-03bf Index1 Indirect Fetch From RAM Bank 1 03c0-03c8 Index2 Indirect Fetch From RAM Bank 0 03c9-03d1 Txtptr Fetch From RAM Bank 0 03d2-03d4 Numeric Constant For BASIC 03d5 Current Bank For SYS, POKE, PEEK 03d6-03d9 INSTR Work Values 03da Bank Pointer For String/Number CONVERT RTN 03db-03dd Sprite: Work bytes for SSHAPE 03df FAC#1 Overflow 03e0-03e1 Sprite: Work bytes for SPRSAV 03e2 Graphic Foreground/ Background Color Nybbles 03e3 Graphic Foreground/ Multicolor 1 Color Nybbles 03f0-03f6 DMA Link Code ff00 MMU Configuration Register ff01 MMU LCR: Bank 0 ff02 MMU LCR: Bank 1 ff03 MMU LCR: Bank 14 ff04 MMU LCR: Bank 14 Over RAM 1 Page Four & Higher Declarations (Beginning Of Bankable RAM) Bank 0 0400-07e7 VIC 40-Column Text Screen 07e8-07ff Sprite Identity Pointers For Text Mode 0800-09ff BASIC Pseudo Stack (gosub and loop addresses and commands) 0a00-0a01 Vector to Restart System (BASIC Warm) [4003] 0a02 KERNAL Warm/Cold Init'n Status Byte 0a03 PAL/NTSC System Flag 0a04 Flags RESET vs. NMI Status for init'n rtns 0a05-0a06 Ptr to Bottom of Avail. Memory in System Bank 0a07-0a08 Ptr to Top of Available Memory in System Bank 0a09 Tape Handler preserves IRQ Indirect here 0a0b TOD Sense during tape operations 0a0c CIA 1 Interrupt Log 0a0d CIA 1 Timer Enabled 0a0f-0a17 RS-232 Work Values 0a0f RS-232 Enables 0a10 RS-232 Control Register 0a11 RS-232 Command Register 0a12 RS-232 User Baud Rate 0a14 RS-232 Status Register 0a15 RS-232 Number of Bits To Send 0a16 RS-232 Baud Rate Full Bit Time (Created by OPEN) 0a18 RS-232 Receive Pointer 0a19 RS-232 Input Pointer 0a1a RS-232 Transmit Pointer 0a1b RS-232 Send Pointer 0a1d-0a1f Sleep Countdown, FFFF = disable 0a20 Keyboard Buffer Size (10) 0a21 Screen Freeze Flag 0a22 Key Repeat: 128 = all, 64 = none 0a23 Key Repeat Timing 0a24 Key Repeat Pause 0a25 Graphics / Text Toggle Latch 0a26 40-Col Cursor Mode 0a27-0a2a 40-Col Blink Values 0a2b 80-Col Cursor Mode 0a2c 40-Col Video $D018 Image 0a2d VIC Bit-Map Base Pointer 0a2e-0a2f 80-Col Pages-Screen, Color 0a40-0a5a 40/80 Pointer Swap (to E0-FA) 0a60-0a6d 40/80 Data Swap (0354-0361) 0a80 Compare Buffer (32 bytes) 0aa0-0aa1 MLM 0aab ASM/DIS 0aac For Assembler 0aaf Byte Temp used all over 0ab0 Byte Temp used all over 0ab1 Byte Temp for Assembler 0ab2 Save .X here during Indirect Subroutine Calls 0ab3 Direction Indicator For 'TRANSFER' 0ab4 Parse Number Conversion 0ab5 Parse Number Conversion 0ab7 Parse Number Conversion 0ac0 PAT Counter 0ac1-0ac4 ROM Physical Address Table 0ac5 Flag: KBD 0b00-0bbf Cassette Buffer 0bc0-0bff ? 0c00-0dff RS-232 Input, Output Buffers 0e00-0fff System Sprites (56-63) 1000-1009 Programmed Key Lenghts 100a-10ff Programmed Key Definitions 1100-1130 DOS Command Staging Area 1131-116e Graphics Work Area 1131 Current X Position 1133 Current Y Position 1135 X-Coordinate Destination 1137 Y-Coordinate Destination 1139 Line Drawing Variables 1149 Sign Of Angle 114a Sine Of Value Of Angle 114c Cosine of Value of Angle 114e Temps For Angle Distance Routines 1150 CIRCLE Center, X Coordinate, BOX POINT 1 X-Coord. 1152 CIRCLE Center, Y Coordinate, BOX POINT 1 Y-Coord. 1154 X Radius, BOX Rotation Angle 1156 Y Radius 1158 CIRCLE Rotation Angle 115a BOX: Length of a side 115c Arc Angle Start 115e Arc Angle End, Char's Col. Counter 1160 X Radius * COS(Rotation Angle) 1162 Y Radius * SIN(Rotation Angle) 1164 X Radius * SIN(Rotation Angle) 1166 Y Radius * COS(Rotation Angle) 1168 HIGH BYTE: ADDR OF CHARROM For 'CHAR' CMD. 1169 Temp For GSHAPE 116a SCALE Mode Flag 116b Double Width Flag 116c Box Fill Flag 116d Temp For Bit Mask 116f Trace Mode: FF = on 1170-1173 Renumbering Pointers 1174-1177 Directory Work Pointers 1178-1197 Graphics Index 117a-117b Float-fixed Vector [849F] 117c-117d Fixed-float Vector [793C] 117e-11d5 Sprite Motion Tables (8 x 11 bytes) 11d6-11e5 Sprite X/Y Positions 11e6 Sprite X-High Positions 11e7-11e8 Sprite Bumb Masks (sprite - backgnd) 11e9-11ea Light Pen Values, X and Y 11eb CHRGEN ROM Page, Text Mode [D8] 11ec CHRGEN ROM Page, Graphics Mode [D0] 11ed Secondary Address For RECORD 11ee-11ff Unused 1200-1201 Previous BASIC Line 1202-1203 Pointer: BASIC Statement for CONTINUE 1204 PRINT USING Fill Symbol 1205 PRINT USING Comma Symbol 1206 PRINT USING D.P. Symbol 1207 Print Using Monetary Symbol 1208 Used by Error Trapping Routine - Last Err No 1209-120a Line # of Last Error. FFFF if No Error 120b-120c TRAP Address, FFFF = none 120d Hold Trap # of Tempor. 1210-1211 End of Basic, Bank 0 1212-1213 Basic Program Limit [FF00] 1214-1217 DO Work Pointers 1218-121a USR Program Jump [7D28] 121b-121f RND Seed Value 1220 Degrees Per CIRCLE Segment 1221 'Cold' or 'Warm' Reset Status 1222 Sound Tempo 1223-1224 Remaining Note Length LO/HI, Voice 1 1225-1226 Remaining Note Length LO/HI, Voice 2 1227-1228 Remaining Note Length LO/HI, Voice 3 1229-122a Note Length LO/HI 122b Octave 122c Flag: 01 = Sharp, FF = Flat 122d-122e Pitch 122f Music Sequencer (Voice Number) 1230 Wave 1233 Flag: Play Dotted Note 1234-1237 Note Image 1239-123e Current Envelope Pattern 123f-1270 Envelope Tables 123f-1248 AD(SR) Pattern 1249-1252 (AD)SR Pattern 1253-125c Waveform Pattern 125d-1266 Pulse Width Lo Pattern 1267-1270 Pulse Width Hi Pattern 1271-1274 Note: xx, xx, volume 1275 Previous Volume Image 1276-1278 Collision IRQ Task Table 1279-127e Collision IRQ Address Tables 127f Collision Mask 1280 Collision Work Value 1281 SOUND Voice 1282 SOUND Time LO 1285-1287 SOUND Time HI 1288-128a SOUND Max LO 128b SOUND Max HI 128e SOUND Min LO 1291 SOUND Min HI 1294 SOUND Direction 1297 SOUND Step LO 129a SOUND Step HI 129d SOUND Freq LO 12a0 SOUND Freq HI 12a3 Temp Time LO 12a4 Temp Time HI 12a5 Temp Max LO 12a6 Temp Max HI 12a7 Temp Min LO 12a8 Temp Min HI 12a9 Temp Direction 12aa Temp Step LO 12ab Temp Step HI 12ac Temp Freq LO 12ad Temp Freq HI 12ae Temp Pulse LO 12af Temp Pulse HI 12b0 Temp Waveform 12b1-12b2 PEN/POT Work Values 12b7 Used BY SPRDEF & SAVSPR 12fa Used BY SPRDEF & SAVSPR 12fb Used BY SPRDEF & SAVSPR 12fc Sprite Number. Used BY SPRDEF & SAVSPR 12fd Used by BASIC IRQ to block all but one IRQ call 12ff ? 1300-17ff Unused 1800-1bff Reserved for Key Functions 1c00-fbff BASIC RAM Memory (Text) 1c00-1ff7 Video Color Matrix For Graphics Mode 1ff8-1fff Sprite Identity Pointers For Graphics Mode 2000-3fff Screen Memory For Graphics Mode 4000-fbff BASIC RAM Memory (with graphics enabled) Bank 1 0400-fbff BASIC Variables, Arrays, And Strings Bank 14 The same as Bank 15, except: d000-dfff Character Generator ROM Bank 15 4000-cfff BASIC ROM d000-d030 VIC, 40 Col Video Chip 8564 (NTSC) or 8566 (PAL) d400-d41c SID Sound Chip 6581 d500-d50b MMU, Memory Management Unit 8722 d600-d601 VDC, 80 Col Video Controller 8563 d800-d8e7 Color Nybbles For VIC Text Screen dc00-dc0f CIA 1 (IRQ), 6526 dd00-dd0f CIA 2 (NMI), 6526 df00-df0a DMA Slot e000-ffff KERNAL ROM ff00-ff04 MMU ff05-ffff Transfer, Jump Table ***** 502 COMMODORE 128 This chapter provides the memory maps for both C128 and C64 modes. A memory map tells you exactly how memory is laid out internally in both RAM and ROM. It tells you exactly what resides in each memory location. The memory map directs you in finding address vectors for routines and entry points and provi- des information about the general layout of the computer. The memory map is probably the most vital programming tool. Refer to the memory map whenever you need directions throughout the memory of your Commodore 128. Addresses listed with more than one address label are used for more than one purpose. To BASIC, the variable has one purpose; to the Mac- hine Language Monitor, it may have another. The conventions used for the memory maps are as follows: Column 1 Column 2 Column3 Column 4 MEMORY ADDRESS HEXADECIMAL DECIMAL LABEL ADDRESS ADDRESS DESCRIPTION See Appendix K for the Z80 memory map for CP/M on the Commodore 128. C128 MEMORY MAP MEMORY ADDRESS ADDRESS LABEL HEX DEC DESCRIPTION D6510 0000 0 6510 Data Direction Register R6S10 0001 1 6510 Data Register BANK 0002 2 Token 'SEARCH' looks for, or Bank # PC_HI 0003 3 Address for BASIC SYS command or MONITOR and LONG CALL/JUMP Routines PC_LO 0004 4 Address S_REG 0005 5 STATUS REG Temp A_REG 0006 6 .A REG Temp X_REG 0007 7 .X REG Temp Y_REG 0008 8 .Y REG Temp STKPTR 0009 9 Stack Pointer Temp BASIC ZERO PAGE STORAGE INTEGR 0009 9 CHARAC Search Character ENDCHR 000A 10 Flag: Scan For Quote at End Of String TRMPOS 000B 11 Screen Column from Last Tab VERCIC 000C 12 Flag: 0 = LOAD, 1 = VERIFY COUNT 000D 13 Input Buf.ptr / # of Subscripts DIMFLG 000E 14 Flag: Default Array Dimension VALTYP 000F 15 DATA Type: $FF=String, $00 = Numeric INTFLG 0010 16 DATA Type: $00=Float.Pt, $80 = Integer GARBFL 0011 17 Flag: DATA Scan/ LIST Quote/ Garbage Collection DORES SUBFLG 0012 18 Flag: Subscript Ref. / User Func. Call INPFLG 0013 19 Flag: $00=INPUT, $40=GET, $98 = READ DOMASK 0014 20 TANSGN Flag: TAN Sign / Comparison Result CHANNL 0015 21 POKER 0016 22 LINNUM Temp Integer Value TEMPPT 0018 24 Pointer: Temp String Stack LASTPT 0019 25 Last Temp String Address TEMPST 001B 27 Stack For Temp Strings INDEX 0024 36 Utility Pointer Area INDEX1 INDEX2 0026 38 RESHO 0028 40 Floating Pt. Product of Multiply RESMOH 0029 41 ADDEND 002A 42 RESMO RESLO 002B 43 TXTTAB 002D 45 Pointer: Start Of BASIC Text VARTAB 002F 47 Pointer: Start Of BASIC Variables ARYTAB 0031 49 Pointer: Start Of BASIC Arrays STREND 0033 51 Pointer: End Of BASIC Arrays + 1 FRETOP 0035 53 Pointer: Bottom of String Storage FRESPC 0037 55 Utility String Pointer MAX_MEM_1 0039 57 Top of String/Variable Bank (Bank 1) CURLIN 003B 59 Current BASIC Line Number TXTPTR 003D 61 Pointer to BASIC Text used by CHRGET,etc. FORM 003F 63 Used by PRINT USING FNDPNT Pointer to Item Found By Search DATLIN 0041 65 Current DATA Line Number DATPTR 0043 67 Current DATA Item Address INPPTR 0045 69 Vector: INPUT Routine VARNAM 0047 71 Current BASIC Variable Name FDECPT 0049 73 VARPNT Pointer: Current BASIC Variable DATA LSTPNT 004B 75 FORPNT Pointer: Index Variable For FOR/NEXT ANDMSK EORMSK 004C 76 VARTXT 004D 77 OPPTR OPMASK 004F 79 GRBPNT 0050 80 TEMPF3 DEFPNT DSCPNT 0052 82 0054 84 HELPER 0055 85 Flags 'HELP' or 'LIST' JMPER 0056 86 0057 87 OLDOV 0058 88 TEMPF1 0059 89 PTARG1 Multiply defined for INSTR PTARG2 005B 91 STRl 005D 93 STR2 0060 96 POSITN 0063 99 MATCH 0064 100 ARYPNT 005A 90 HIGHDS HIGHTR 005C 92 TEMPF2 005E 94 DECCNT 005F 95 Number of Digits after the Decimal Point TENEXP 0060 96 T0 ML MONITOR Z.P. Storage in FAC GRBTOP 0061 97 DPTFLG Decimal Point Flag LOWTR EXPSGN 0062 98 FAC 0063 99 DSCTMP LEFT_FLAG Paint-Left Flag FACEXP FAC#1 Exponent Tl MONITOR Z.P. Storage in FAC RIGHT_FLAG 0064 100 Paint-Right Flag FACHO FAC#1 Mantissa FACMOH 0065 101 INDICE 0066 102 FACMO T2 MONITOR Z.P. Storage in FAC FACLO 0067 103 FACSGN 0068 104 FAC#1 Sign DEGREE 0069 105 SGNFLG Pointer: Series-Eval. Constant ARGEXP 006A 106 FAC#2 Exponent ARGHO 006B 107 FAC#2 Mantissa ARGMOH 006C 108 INIT_AS_0 Just a count for INIT ARGMO 006D 109 ARGLO 006E 110 ARGSGN 006F 111 FAC#2 Sign STRNGI 0070 112 ARISGN Sign Comparison Result: FAC#1 vs #2 FACOV 0071 113 FAC#1 Low-Order (Rounding) STRNG2 0072 114 POLYPT CURTOL FBUFPT Pointer: Cassette Buffer AUTINC 0074 116 Inc. Val for AUTO (0 = Off) MVDFLG 0076 118 Flag If 10K HIRES Allocated Z_P_TEMP_1 0077 119 PRINT USING's Leading Zero Counter MOVSPR & Sprite Temporary MID$ Temporary HULP 0078 120 Counter KEYSIZ SYNTMP 0079 121 Used as Temp For Indirect DSDESC 007A 122 Descriptor for DS$ TXTPTR MONITOR Z.P. Storage TOS 007D 125 Top of Run Time Stack RUNMOD 007F 127 Flags Run/Direct Mode PARSTS 0080 128 DOS Parser Status Word POINT USING's Pointer to Dec.Pt PARSTX 0081 129 OLDSTK 0082 130 BASIC Z-P STORAGE FOR GRAPHIC COMMANDS COLSEL 0083 131 Current COLOR Selected MULTICOLOR 0084 132 MULTICOLOR_2 0085 133 FOREGROUND 0086 134 SCALE_X 0087 135 Scale Factor In X SCALE_Y 0089 137 Scale Factor In Y STOPNB 008B 139 Stoppaint if not Background/Not same color GRAPNT 008C 140 VTEMPI 008E 142 VTEMP2 008F 143 KERNAL/EDITOR STORAGE STATUS 0090 144 I/O Operation Status Byte STKEY 0091 145 STOP KEY Flag SVXT 0092 146 Tape Temporary VERCK 0093 147 LOAD or VERIFY Flag C3P0 0094 148 Serial Buffered Char Flag BSOUR 0095 149 Char Buffer For Serial SYNO 0096 150 Cassette Sync # XSAV 0097 151 Temp For BASIN LDTND 0098 152 Index to Logical File DFLTN 0099 153 Default Input Device # DFLTO 009A 154 Default Output Device # PRTY 009B 155 Cassette Parity DPSW 009C 156 Cassette Dipole Switch MSGFLG 009D 157 OS Message Flag PTR1 009E 158 Cassette Error Pass1 T1 Temporary 1 PTR2 009F 159 Cassette Error Pass2 T2 Temporary 2 TIME 00A0 160 24 Hour Clock In 1/60th Seconds R2D2 00A3 163 Serial Bus Usage PCNTR Cassette BSOUR1 00A4 164 Temp used by Serial Routine FIRT COUNT 00A5 165 Temp used by Serial Routine CNTDN Cassette Sync Countdown BUFPT 00A6 166 Cassette Buffer Pointer INBIT 00A7 167 RS-232 RCVR Input Bit Storage SHCNL Cassette Short Count BITCI 00A8 168 RS-232 RCVR Bit Count In RER Cassette Read Error RINONE 00A9 169 RS-232 RCVR Flag For Start Bit Check REZ Cassette Reading Zeroes RIDATA 00AA 170 RS-232 RCVR Byte Buffer RDFLG Cassette Read Mode RIPRTY 00AB 171 RS-232 RCVR Parity Storage SHCNH Cassette Short Cnt SAL 00AC 172 Pointer: Tape Buffer / Screen Scrolling SAH 00AD 173 EAL 00AE 174 Tape End Addresses / End of Program EAH 00AF 175 CMP0 00B0 176 Tape Timing Constants TEMP 00B1 177 TAPE1 00B2 178 Address of Tape Buffer BITTS 00B4 180 RS-232 TRNS Bit Count SNSW1 NXTBIT 00B5 181 RS-232 TRNS Next Bit To Be Sent DIFF RODATA 00B6 182 RS-232 TRNS Byte Buffer PRP FNLEN 00B7 183 LENGTH Current File N Str LA 00B8 184 Current File Logical Addr SA 00B9 185 Current File 2nd Addr FA 00BA 186 Current File Primary Addr FNADR 00BB 187 Addr Current File Name Str ROPRTY 00BD 189 RS-232 TRNS Parity Buffer OCHAR FSBLK 00BE 190 Cassette Read Block Count DRIVE 00BF 191 MYCH Serial Word Buffer CAS1 00C0 192 Cassette Manual/Cntrled Switch (Updated during IRQ) TRACK 00C1 193 STAL I/O Start Address (LO) SECTOR 00C2 194 STAH I/O Start Address (HI) MEMUSS 00C3 195 Cassette LOAD Temps (2 bytes) DATA 00C5 197 Tape Read/Write Data BA 00C6 198 Bank For Current LOAD/SAVE/VERIFY Operation FNBANK 00C7 199 Bank Where Current FN is found (at 'FNADR') RIBUF 00C8 200 RS-232 Input Buffer Pointer ROBUF 00CA 202 RS-232 Output Buffer Pointer GLOBAL SCREEN EDITOR VARIABLES KEYTAB 00CC 204 Keyscan Table Pointer IMPARM 00CE 206 PRIMM Utility String Pointer NDX 00D0 208 Index to Keyboard Queue KYNDX 00D1 209 Pending Function Key Flag KEYIDX 00D2 210 Index Into Pending Function Key String SHFLAG 00D3 211 Keyscan Shift Key Status SFDX 00D4 212 Keyscan Current Key Index LSTX 00D5 213 Keyscan Last Key Index CRSW 00D6 214 Input Flag MODE 00D7 215 40/80 Column Mode Flag GRAPHM 00D8 216 Text/Graphic Mode Flag CHAREN 00D9 217 RAM/ROM VIC Character Fetch Flag (Bit-2) THE FOLLOWING LOCATIONS ARE SHARED BY SEVERAL EDITOR ROUTINES. SEDSAL 00DA 218 Pointers For MOVLIN BITMSK 00DA 218 Temporary For TAB & LINE WRAP Routines SAVER 00DB 219 Another Temporary Place To Save A Reg. SEDEAL 00DC 220 SEDT1 00DE 222 SAVPOS SEDT2 00DF 223 KEYSIZ 00DA 218 Programmable Key Variables KEYLEN 00DB 219 KEYNUM 00DC 220 KEYNXT 00DD 221 KEYBNK 00DE 222 KEYTMP 00DF 223 LOCAL SCREEN EDITOR VARIABLES. These are swapped out to $0a40 when screen (40/80) mode changes. PNT 00E0 224 Pointer to Current Line (Text) USER 00E2 226 Pointer to Current Line (Attribute) SCBOT 00E4 228 Window Lower Limit SCTOP 00E5 229 Window Upper Limit SCLF 00E6 230 Window Left Margin SCRT 00E7 231 Window Right Margin LSXP 00E8 232 Current Input Column Start LSTP 00E9 233 Current Input Line Start INDX 00EA 234 Current Input Line End TBLX 00EB 235 Current Cursor Line PNTR 00EC 236 Current Cursor Column LINES 00ED 237 Maximum Number of Screen Lines COLUMNS 00EE 238 Maximum Number of Screen Columns DATAX 00EF 239 Current Character to Print LSTCHR 00F0 240 Previous Char Printed (For Test) COLOR 00F1 241 Curr Attribute to Print (Default FGND Color) TCOLOR 00F2 242 Saved Attrib to Print ('INSERT' & 'DELETE') RVS 00F3 243 Reverse Mode Flag QTSW 00F4 244 Quote Mode Flag INSRT 00F5 245 Insert Mode Flag INSFLG 00F6 246 Auto-Insert Mode Flag LOCKS 00F7 247 Disables , S SCROLL 00F8 248 Disables Screen Scroll, Line Linker BEEPER 00F9 249 Disables G FREKZP 00FA 250 Free Zero Page reserved for applications software ($FA-$FE) LOFBUF 00FF 255 BASIC/DOS INTERFACE VARS BAD 0100 256 Tape Read Errors FBUFFR Area to build filename in (16 bytes) XCNT 0110 272 DOS Loop Counter DOSF1L 0111 273 DOS Filename 1 Len DOSDS1 0112 274 DOS Disk Drive 1 DOSF2L 0113 275 DOS Filename 2 Len DOSDS2 0114 276 DOS Disk Drive 2 DOSF2A 0115 277 DOS Filename 2 Addr DOSOFL 0117 279 BLOAD/BSAVE Starting Address DOSOFH 0119 281 .... and Ending Address DOSLA 011B 283 DOS Logical Addr DOSFA 011C 284 DOS Phys Addr DOSSA 011D 285 DOS Sec. Addr DOSRCL 011E 286 DOS Record Length DOSBNK 011F 287 DOSDID 0120 288 DOS Disk ID DIDCHK 0122 290 DOS DSK ID FLG SPACE Used by PRINT USING BNR 0123 291 Pointer to Begin. NO. ENR 0124 292 Pointer to End NO. DOLR 0125 293 Dollar Flag FLAG 0126 294 Comma Flag SWE 0127 295 Counter USGN 0128 296 Sign Exponent UEXP 0129 297 Pointer to Exponent VN 012A 298 # Of Digits Before Decimal Point CHSN 012B 299 Justify Flag VF 012C 300 # Of Pos Before Decimal Point (Field) NF 012D 301 # Of Pos After Decimal Point (Field) POSP 012E 302 +/- Flag (Field) FESP 012F 303 Exponent Flag (Field) ETOF 0130 304 Switch CFORM 0131 305 Char Counter (Field) SNO 0132 306 Sign No BLFD 0133 307 Blank/Star Flag BEGFD 0134 308 Pointer to Begin of Field LFOR 0135 309 Length of Format ENDFD 0136 310 Pointer to End Of Field SYSTK 0137 311 System Stack ($0137-$01FF) BUF 0200 512 Input Buffer: BASIC & MONITOR FETCH 02A2 674 LDA(-),Y From Any Bank FETCHVEC 02AA 682 STASH 02AF 687 STA(-),Y to Any Bank STAVEC 02B9 697 CMPARE 02C8 702 CMP(-),Y to Any Bank CMPVEC 02C8 712 JSRFAR 02CD 716 JSR XXXX to Any Bank & Return JMPFAR 02E3 739 JMP XXXX to Any Bank VECTORS ESC_FN_VEC 02FC 764 Vector For Additional Function Routines K EC 02FE 766 Vector For Function Cart. IERROR 0300 Users 0302 (ERR IN .X) ICRNCH 0304 772 Vector to Crunch 774 Vector to List BASIC Text 776 Vector to Gone (BASIC Char 778 Vector to BASIC Token 780 Vector to Escape-Token 030E 782 LIST IESCEX 0310 784 ... And Execute. IIRO 0314 788 IRQ RAM Vector IBRK 0316 790 BRK INSTR RAM Vector INMI 0318 792 NMI Vector IOPEN 031A 794 KERNAL OPEN Routine Vector 796 KERNAL CLOSE Routine Vector 798 KERNAL CHKIN Routine Vector 800 KERNAL CHKOUT Routine CLRCH 0322 Vector VECTOR IBASIN 0324 804 KERNAL CHRIN Routine Vector IBSOUT 0326 806 KERNAL CHROUT Routine Vector ISTOP 0328 808 KERNAL STOP Routine Vector IGETIN 032A 810 KERNAL GETIN Routine Vector ICLALL 032C 812 KERNAL CLALL Routine Vector EXMON 032E 814 Monitor Command Vector ILOAD 0330 816 KERNAL LOAD Routine Vector ISAVE 0332 818 KERNAL SAVE Routine Vector EDITOR INDIRECT VECTORS CTLVEC 0334 820 Editor: PRINT 'CONTRL' Indirect SHFVEC 0336 822 Editor: PRINT 'SHIFTD' Indirect ESCVEC 0338 824 Editor: PRINT 'ESCAPE' Indirect KEYVEC 033A 826 Editor: Keyscan Logic Indirect KEYCHK 033C 828 Editor: Store Key Indirect DECODE 033E 830 Vectors to Keyboard Matrix Decode Tables KEYD 034A 842 IRQ Keyboard Buffer (10 Bytes) TABMAP 0354 852 Bitmap Of TAB Stops (10 Bytes, $0354-D) BITABL 035E 862 Bitmap Of Line Wraps TABMAP and BITABL get swapped to $0A60 when screen 40/80 mode is changed. LAT 0362 866 Logical File Numbers FAT 036C 876 Primary Device Numbers SAT 0376 886 Secondary Addresses CHRGET 0380 896 CHRGOT 0386 902 QNUM 0390 912 INDIRECT LOAD SUBROUTINE AREA INDSUB_RAM0 039F 927 Shared ROM Fetch Sub INDSUB_RAM1 03AB 939 Shared ROM Fetch Sub INDIN1_RAM1 03B7 950 Index1 Indirect Fetch INDIN2 03C0 959 Index2 Indirect Fetch INDIXT 03C9 968 Txtptr ZERO 03D2 977 Numeric Constant For BASIC CURRENT_BANK 03D5 979 Context For SYS,POKE,PEEK From Bank Cmmd TMPDES 03D6 980 Temp For INSTR FIN_BANK 03DA 984 Bank Pointer For String/Number CONVERT RTN SAVSIZ 03DB 985 Temp Work Locations for SSHAPE BITS 03DF 989 FAC#1 OVERFLOW DIGIT SPRTMP_1 03E0 990 Temp For SPRSAV SPRTMP_2 03E1 991 FG_BG 03E2 992 Packed Foreground/ Background Color Nybbles FG_MC1 03E3 993 Packed Foreground/ Multicolor 1 Color Nybbles Page Four & Higher Declarations (Beginning Of Bankable RAM) VICSCN 0400 1024 VIDEO MATRIX #1: VIC 40-Column Text Screen $0400-$07FF 0800 2048 BASIC RUN-TIME STACK (512 BYTES) $0800-$09FF ABSOLUTE KERNAL VARIABLES SYSTEM_VECTOR 0A00 2560 Vector to Restart System (BASIC Warm) DEJAVU 0A02 2562 KERNAL Warm/Cold Init'n Status Byte PALNTS 0A03 2563 PAL/NTSC System Flag INIT_STATUS 0A04 2564 Flags RESET vs. NMI Status for init'n rtns MEMSTR 0A05 2565 Ptr to Bottom of Avail. Memory in System Bank MEMSIZ 0A07 2567 Ptr to Top of Available Memory in System Bank IRQTMP 0A09 2569 Tape Handler preserves IRQ Indirect here CASTON 0AOB 2571 TOD Sense during tape operations KIKA26 0AOC 2572 Tape Read Temporary STUPID 0AOD 2573 Tape Read D1IRQ Indicator TIMOUT 0AOE 2574 Fast Serial Timeout Flag ENABL 0A0F 2575 RS-232 Enables M51CTR 0A10 2576 RS-232 Control Register MSICDR 0A11 2577 RS-232 Command Register MSIAJB 0A12 2578 RS-232 User Baud Rate RSSTAT 0A14 2580 RS-232 Status Register BITNUM 0A15 2581 RS-232 Number of Bits To Send BAUDOF 0A16 2582 RS-232 Baud Rate Full Bit Time (Created by OPEN) RIDBE 0A18 2584 RS-232 Input Buffer Index to End RIDBS 0A19 2585 RS-232 Input Buffer Index to Start RODBS 0A1A 2586 RS-232 Output Buffer Index to Start RODBE 0A1B 2587 RS-232 Output Buffer Index to End SERIAL 0A1C 2588 Fast Serial Internal/External Flag TIMER 0A1D 2589 Decrementing Jiffie Register GLOBAL ABSOLUTE SCREEN EDITOR DECLARATIONS XMAX 0A20 2592 Keyboard Queue Maximum Size PAUSE 0A21 2593 CTRL-S Flag RPTFLG 0A22 2594 Enable Key Repeats KOUNT 0A23 2595 Delay Between Key Repeats DELAY 0A24 2596 Delay Before a Key Starts Repeating LSTSHF 0A25 2597 Delay Between Toggles BLNON 0A26 2598 VIC Cursor Mode (Blinking, Solid) BLNSW 0A27 2599 VIC Cursor Disable BLNCT 0A28 2600 VIC Cursor Blink Counter GDBLN 0A29 2601 VIC Cursor Character Before Blink GDCOL 0A2A 2602 VIC Cursor Color Before Blink CURMOD 0A2B 2603 VDC Cursor Mode (when enabled) VM1 0A2C 2604 VIC Text Screen/Character Base Pointer VM2 0A2D 2605 VIC Bit-Map Base Point