03 C128ram
03 C128ram
C128 RAM
All Banks
; I/O Vectors
Bank 0
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
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
Bank 14
The same as Bank 15, except:
Bank 15
*****
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.
See Appendix K for the Z80 memory map for CP/M on the Commodore 128.
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
DORES
SUBFLG 0012 18 Flag: Subscript Ref. / User Func. Call
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
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
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
KERNAL/EDITOR STORAGE
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
VICSCN 0400 1024 VIDEO MATRIX #1: VIC 40‐Column Text Screen
$0400‐$07FF
CURBNK 0AC0 2752 Current Function Key ROM Bank Being Polled
DOS/VSP AREA
DOSSTR 1100 4352 DOS OUTPUT STR. BUF
48 Bytes to Build DOS String
DOS/VSP AREA
BOX‐DRAWING VARIABLES
XCORD1 1150 4432 POINT 1 X‐Coord.
YCORD1 1152 4434 POINT 1 Y‐Coord.
BOXANG 1154 4436 Rotation Angle
XCOUNT 1156 4438
YCOUNT 1158 4440
BXLENG 115A 4442 Length of a side
XCORD2 115C 4444
YCORD2 115E 4446
CHRPAG 1168 4456 HIGH BYTE: ADDR OF CHARROM For 'CHAR' CMD.
VIC_SAVE 11D6 4566 Copy of VIC Reg's, Used to update chip during
retrace (21 bytes, $11D6‐EA)
INTERRUPT VECTORS
BASIC ENTRY
FORMAT CONVERSIONS
MATH FUNCTIONS
MOVEMENT
MEMORY
ADDRESS HEXADECIMAL DECIMAL
LABEL ADDRESS ADDRESS DESCRIPTION
MONITOR ENTRY
JMP SPIN SPOUT FF47 65351 Set up Fast Serial Port for I/O
JMP CLOSE ALL FF4A 65354 Close All Logical Files for a device
JMP C64MODE FF4D 65357 Reconfigure System as a C64 (no return)
JMP DMA CALL FF50 65360 Initiate DMA Request to External RAM
Expansion, Send command to DMA Device
JMP BOOT CALL FF53 65363 Boot Load Program From Disk
JMP PHOENIX FF56 65366 Call All Function Cards' Cold Start
Routines, Initialize
The following symbols are used by the C128 Editor. Note that the Editor IRQ
VIC screen handler depends upon them. In most cases the contents of these
locations will be placed directly into the appropriate register and should be
used instead of the actual register. For example, to change the location of the
character set used by VIC, use VM1 ($0A2C) instead of VIC register 24 ($D018).
VM1 will be used by the editor to update VIC register 24.
7 6 5 4 3 2 1 0
00F9 BEEPER ON ‐ ‐ ‐ ‐ ‐ ‐ ‐
Init_Status. See also above. Lets system know what has been initialized and
what hasn't. Set to $00 by a reset but untouched by NMI.
System_Vector. Where the Kernal goes when it has to go somewhere. It's set
to BASIC cold at reset. BASIC itself sets it to BASIC warm after it has
initialized. The monitor respects it too.
System. Vector in RAM1 at $FFF8. Set at power‐up to C128MODE, user may redirect
it to his code. Taken at reset always providing user with control (protection)
from reset.
<end>