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 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) 000a Scan-quotes flag 000b TAB column save 000c 0 = LOAD, 1 = VERIFY 000d Input buffer pointer / number of subscripts 000e default DIM flag 000f Type: FF = string, 00 = numeric 0010 Type: 80 = integer, 00 = floating point 0011 DATA scan / LIST quote / memory flag 0012 Subscript / FNxx flag 0013 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) 002f-0030 Pointer: Start-of-variables (bank 1) 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) 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 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 / Seris pointer 0074-0075 Auto line number increment 0076 Graphics flag: FF = Graphics 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 Scratch registers. (don't use) 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 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 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 0125-0138 PRINT / USING work area 0200-03ff Vectors, buffers, Kernal RAM 0200-02a1 BASIC input buffer 512-673 BASIC & Monitor Input Buffer (161 bytes) 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] 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) 0a0c CIA 1 Interrupt Log 0a0d CIA 1 Timer Ensbled 0a0f-0a17 RS-232 Work Values 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 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...
Amiga7878