Here is an OCR of some of the many tables from the Plus/4 Programmer's Reference Guide by Scott Foresmann & Co. Besides all these great tables is a wealth of examples on how to program the Plus/4 in basic AND machine language. :) Note: I did not proof this OCR except for formatting, the original douments were very clean and clear so much of the descrepencies will be with numeric 0 being o's and 1s being i's. Summary of Memory Map Considerations This section is organized by each type of graphics mode and details the use of memory. It is intended for quick reference. The previous section explains the actual operation of each mode. High-Resolution Characters $FF07 Bit 7 determines hardware reverse on and 128 characters (0), or reverse off and 256 characters (1). $FF12 Bit 2 determines RAM (0) or ROM (1). $FF13 Bits 7-2 determine location of character set (bits 15-10). $FF14 Bits 7-3 determine location of color/screen memory (bits IS-I I). $FFI5 Background luminance and color. $FFI9 Border luminance and color. Character color, luminance, and flashing are determined by color memory (normally $0800-$0BE7). Characters displayed are determined by screen memory (normally $0C00-$0FE7). Extended Color Characters $FF06 Set bit 6 for extended color mode. $FF07 Bit 7 determines 128 characters (0), or 256 characters (1). $FF12 Bit 2 determines RAM (0) or ROM (1). $FF13 Bits 7-2 determine location of character set (bits 15-10). $FF14 Bits 7-3 determine location of color/screen memory (bits 15-11). $FFI5 Background 0 luminance and color. $FF16 Background I luminance and color. $FF17 Background 2 luminance and color. $FF18 Background 3 luminance and color. $FF19 Border luminance and color. Character color and luminance are determined by color memory (normally $0800-$0BE7). Characters displayed and their background color are determined by screen memory (normally $0C00-$0FE7). Multicolor Characters $FF07 Set bit 4 for multicolor mode. Bit 7 determines 128 characters (0) or 256 characters (1). $FF12 Bit 2 determines RAM (0) or ROM (1). $FF13 Bits 7-2 determine location of character set (bits 15 10). $FF14 Bits 7-3 determine location of color/screen memory (bits 15-11). $FFI5 Background 0 luminance and color. $FF16 Background I luminance and color. $FF17 Background 2 luminance and color. $FFI9 Border luminance and color. Character color, luminance, and high-resolution or multicolor status are determined by color memory (normally $0800-$0BE7). Characters displayed are determined by screen memory (normally $0C00-$0FE7). High-Resolution Bit Map $FF06 Set bit 5 for bit-map mode. $FF12 Bit 2 determines RAM (0) or ROM (1). Bits 5-3 determine location of bit map (bits 15 13) $FF14 Bits 7-3 determine location of luminance/color memory (bits 15-11). $FFI9 Border luminance and color. The bit map displayed is determined by bit-map memory. The luminances of both colors are determined by color memory (normally $0800-$0BE7). Color for both colors is determined by screen memory (normally $0C00 $0FE7). Multicolor Bit Map $FF06 Set bit 5 for bit-map mode. $FF07 Set bit 4 for multicolor mode. $FF12 Bit 2 determines RAM (0) or ROM (1). Bits 5-3 determine location of bit map (bits 15-13). $FF14 Bits 7-3 determine location of luminance/color memory (bits 15-11). $FFI5 Background 0 luminance and color. $FF16 Background 1 luminance and color. $FFl9 Border luminance and color. The bit map displayed is determined by bit-map memory. The luminances of both colors are determined by color memory (normally $0800-$0BE7). Color for both local colors is determined by screen memory (normally $0C00-$0FE7). Note Tables The decimal values used in the SOUND command to get five octaves of musical notes are displayed in this table. Octave I Octave 2 Octave 3 Octave 4 Octave 5 Note Frequency Frequency Frequency Frequency Frequency A 7 516 770 897 960 A# 64 544 784 904 964 B 118 571 798 911 967 C 169 596* 810 917 971 C# 217 620 822 923 974 D 262 643 834 929 976 D# 305 664 844 934 979 E 345 685 854 939 982 F 383 704 864 944 984 F# 419 722 873 948 986 G 453 739 881 953 988 G# 485 755 889 957 990 *The setting for middle C. Note: Use the following formula to calculate a note value for some other output frequency (FO): Frequency = 1024 - INT(111860.781/FO) The hexadecimal values for sound and music programming in machine language are displayed in this table: Octave 1 Octave 2 Octave 3 Octave 4 Octave 5 Note Frequency Frequency Frequency Frequency Frequency A 7 204 302 381 3CO A# 40 220 310 388 3C4 B 76 23B 31E 38F 3C7 C A9 254 32A 395 3CB C# D9 26C 336 39B 3CE D 106 283 342 3A1 3DO D# 131 298 346 3A6 3D3 E 159 2AD 356 3AB 3D6 F 17F 2C0 360 3B0 3D8 F# 1A3 2D2 369 3B4 3DA G lC5 2E3 371 3B9 3DC G# 1E5 2F3 379 3BD 3DE Plus/4 Memory Maps Three different maps are presented. The first describes each of the registers of the graphics chip. The second gives an overview of the Plus/4's memory usage. The third gives as much detail as possible about each location in the Plus/4. Graphics Chip Register Map The graphics chip is located at $FFOO-$FFlF (65280-65311). The usage of each register is described as completely as possible. Hexadecimal Decimal Bits Function $FF00 65280 0-7 Low byte of reload value for timer 1 $FF01 65281 0-7 High byte of reload value for timer 1 $FF02 65282 0-7 Low byte of start value for timer 2 $FF03 65283 0-7 High byte of start value for timer 2 $FF04 65284 0-7 Low byte of start value for timer 3 $FF05 65285 0-7 High byte of start value for timer 3 $FF06 65286 0-2 Vertical screen scroll position 3 0 = 24 rows, 1 = 25 rows 4 0 = blank screen, 1 = display screen 5 Bit map mode: 0 = off, 1 = on 6 Extended color mode: 0 = off, 1 = on 7 TEST (should always be cleared to O) $FF07 65287 0-2 Horizontal screen scroll position 3 0 = 38 columns, 1 = 40 columns 4 Multicolor mode: 0 = off, 1 = on 5 Flashing: 0 = yes, 1 = no 6 TV standard: 0 = PAL, 1 = NTSC 7 Reverse characters through hardware: O=yes, 1 =no $FF08 65288 0-7 Latch register for keyboard $FF09 65289 0 Not connected 1 Raster interrupt flag 2 Light pen interrupt flag 3 Timer 1 interrupt flag 4 Timer 2 interrupt flag 5 Not connected 6 Timer 3 interrupt flag 7 Interrupt occurred flag $FFOA 65290 0 High bit for raster interrupt value 1 Raster interrupt enable 2 Light pen interrupt enable 3 Timer 1 interrupt enable 4 Timer 2 interrupt enable 5 Not connected 6 Timer 3 interrupt enable 7 Not connected $FFOB 65291 0-7 Low byte for raster interrupt value $FFOC 65292 0-1 High bits for hardware cursor position 2-7 Not connected $FFOD 65293 0-7 Low byte for hardware cursor position $FFOE 65294 0-7 Low byte of frequency for voice 1 $FFOF 65295 0-7 Low byte of frequency for voice 2 $FF10 65296 0-1 High bits of frequency for voice 2 2-7 Not connected $FF11 65297 0-3 Volume: 0 = off, F = highest 4 Select voice 1 5 Select tone generator for voice 2 6 Select noise generator for voice 2 7 Sound reload switch: 0 = on, 1 = off $FF12 65298 O-1 High bits of frequency for voice 1 2 0 = get data from RAM, 1 = get data from ROM 3-5 Base address for bit map 6-7 Not connected $FF13 65299 0 Status of clock 1 Single clock set 2-7 Base address for character data $FF14 65300 0-2 Not connected 3-7 Base address for color and screen memory $FF15 65301 0-3 Background color 4-6 Background luminance 7 Not connected $FF16 65302 0-3 Color for color 1 4-6 Luminance for color 1 7 Not connected $FF17 65303 0-3 Color for color 2 4-6 Luminance for color 2 7 Not connected $FF18 65304 0-3 Color for color 3 4-6 Luminance for color 3 7 Not connected $FF19 65305 0-3 Border color 4-6 Border luminance 7 Not connected $FFIA 65306 0-1 High bits for bit map reload 2-7 Not connected $FF1B 65307 0-7 Low byte for bit map reload $FF1C 65308 0 High bit of current vertical raster position 1-7 Not connected $FF1D 65309 0-7 Low byte of current vertical raster position $FF1E 65310 0-7 Current horizontal raster position $FF1F 65311 0-2 Vertical sub address 3-6 Blink address 7 Not connected Memory Usage on the Plus/4 MEMORY RANGE Hexadecimal Decimal Usage $0000-$0001 0-1 Processor on-chip data registers $0002-$00CF 2-207 System zero page storage $00DO-$00D7 208-215 Zero page area reserved for speech software $00D8-$00E8 216-232 Free zero page area for applications $00E9-$00FF 233-255 System zero page storage $0100-$0122 256-290 System storage $0123-$01FF 291-511 Processor stack $0200-$0258 512-600 Input buffer for BASIC and the monitor $0259-$025C 601-604 BASIC storage $025D-$02AC 605-684 Storage for DOS information $02AD-$02CB 685-715 BASIC graphics storage $02CC-$02E3 716-739 BASIC work area $02E4-$02F1 740-753 BASIC graphics storage $02F2-$02F5 754-757 BASIC pointers $02F6-$02FD 758-765 Free $02FE-$0331 766-817 System vectors $0332-$03F2 818-1010 Cassette buffer $03F3-$03F6 1011-1014 Storage for cassette information $03F7-$0436 1015-1078 RS232 buffer $0437-$0472 1079-1138 Storage for cassette information $0473-$04E6 1139-1254 BASIC RAM subroutines $04E7-$0508 1255-1288 BASIC storage $0509-$054A 1289-1354 System storage $054B-$055C 1355-1372 Monitor storage $055D-$05E6 1373-1510 Function key area $05E7-$05EB 1511-1515 Storage for DMA information $05EC-$05EF 1516-1519 Cartridge address table $05F0-$05F4 1520-1524 Long jump routine and storage $05F5-$06EB 1525-1771 RAM for speech and cartridges $06EC-$07AF 1772-1967 BASIC stack $07B0-$07F1 1968-2033 System I/O storage $07F2-$07FF 2034-2047 System storage $0800-$0BE7 2048-3047 Color memory $0BE8-$0BFF 3048-3071 Free $0C00-$0FE7 3072-4071 Screen memory $0FE8 $0FFF 4072-4095 Free $1000-$3FFF 4096-16383 RAM used by BASIC (in text mode) $1000-$17FF 4096-6143 Free (in BASIC graphics mode) $1800-$1BE7 6144-7143 Luminance memory (in BASIC graphics mode) $1BE8-$1BFF 7144-7167 Free (in BASIC graphics mode) $1C00-$1FE7 7168-8167 Color memory (in BASIC graphics mode) $1FE8-$1FFF 8168-8191 Free (in BASIC graphics mode) $2000-$3F3F 8192-16191 Graphics screen (in BASIC graphics mode) $3F40-$3FFF 16192-16383 Free (in BASIC graphics mode) $4000-$7FFF 16384-32767 RAM used by BASIC $8000-$FCFF 32768-64767 RAM used by BASIC (under ROM) $8000-$CDFF 32768-52735 BASIC and monitor ROM $CE00-$CFFF 52735-53247 Operating system ROM $D000-$D7FF 53248-55295 Character ROM $D800-$FBFF 55296-64511 Operating system ROM $FC00-$FCFF 64512-64767 Banking routines ROM (in all ROM maps) $FD00-$FDOF 64768-64783 ACIA chip (used for RS232, in all maps) $FD10-$FDIF 64784-64799 Parallel port (6529, in all maps) $FD20-$FDCF 64800-64975 Unknown (in all maps) $FDD0-$FDDF 64976-64991 Cartridge banking port (in all maps) $FDE0-$FEFF 64992-65279 Direct Memory Access disk (in all maps) $FF00-$FF3F 65280-65343 Graphics chip (in all maps) $FF40-$FFFF 65344-65535 RAM (under ROM) $FF40-$FFFF 65344-65535 Operating system ROM Detailed Memory Map of the Plus/4 MEMORY LOCATION(S) Hexadecimal Decimal Usage $0000 0 Processor on-chip data direction register $0001 1 Processor on-chip data register $0002 2 BASIC token to search for in BASIC stack $0003-$0006 3-6 Storage for RENUMBER $0007 7 Start character to search for in BASIC text $0008 8 End character to search for in BASIC text $0009 9 Save last TAB column $000A 10 Flag for load ($00) or verify ($01) $000B 11 Buffer pointer for input/ number of subscripts $000C 12 Flag for default array dimension $000D 13 Flag for data type ($00=numeric, $FF=string) $000E 14 Flag for data type ($00=floating, $80=integer) $000F 15 Flag for garbage collect/ DATA scan/ LIST quote $0010 16 Flag for subscript/FNx function $0011 17 Flag for input ($00=INPUT, $40=GET, $98=READ) $0012 18 Sign of TAN/comparison flag $0013 19 Flag for I/O prompt $0014-$0015 20-21 Integer value $0016 22 Pointer to temporary string stack $0017 $0018 23-24 Address of last temporary string $0019-$0021 25-33 Stack for temporary strings $0022-$0025 34-37 Utility pointers $0026-$002A 38-42 Floating point result of multiply $002B-$002C 43-44 Pointer to start of BASIC text $002D-$002E 45-46 Pointer to start of variables in BASIC RAM $002F-$0030 47-48 Pointer to start of arrays in BASIC RAM $0031-$0032 49-50 Pointer to end of arrays in BASIC RAM (+1) $0033-$0034 51-52 Pointer to bottom of strings in BASIC RAM $0035-$0036 53-54 Pointer to current string $0037-$0038 55-56 Pointer to top of BASIC RAM (+1) $0039-$003A 57-58 Current BASICline number $003B-$003C 59-60 Pointer to current BASIC text $003D-$003E 61-62 Pointer to BASIC stack for CONT $003F-$0040 63-64 Current line number in DATA $0041-$0042 65-66 Current address of DATA item $0043-$0044 67-68 Vector to INPUT $0045-$0046 69-70 Name of current variable $0047-$0048 71-72 Address of current variable $0049-$004A 73-74 Pointer to FOR/NEXT index $004B-$0060 75-96 Temporary storage area $0061 97 Floating point accumulator 1, exponent $0062-$0065 98-101 Floating point accumulator I, mantissa $0066 102 Floating point accumulator 1, sign $0067 103 Series evaluation constant pointer $0068 104 Floating point accumulator 1, overflow $0069 105 Floating point accumulator 2, exponent $006A-$006D 106-109 Floating point accumulator 2, mantissa $006E 110 Floating point accumulator 2, sign $006F 111 Sign comparison of FPA 1 and FPA 2/pointer $0070 112 Floating point accumulator 2, overflow $0071-$0072 113-114 Cassette buffer/series pointer $0073-$0074 115-116 Increment for AUTO ($00=none) $0075 117 Flag for graphics area ($00=no, $FF=yes) $0076-$0077 118-119 Key work area $0078 120 Temporary storage for indirect load $0079-$007B 121 123 Disk error message descriptor $007C-$007D 124-125 BASIC stack pointer $007E-$007F 126-127 Temporary storage for sounds $0080 128 Temporary parameter storage $0081 129 Flag for RUNning ($00=no, $80=yes) $0082 130 Flag used for DOS commands $0083 131 Graphic mode ($00=text, $20=high-res, $60=split high-reg, $A0=multicolor, $E0=split multicolor) $0084 132 Current color source for drawing $0085 133 Current color/luminance for COLOR 2 $0086 134 Current color/luminance for COLOR 1 $0087 135 Maximum number of screen columns $0088 136 Maximum number of screen rows $0089 137 Flag for PAINT (left) $008A 138 Flag for PAINT (right) $008B 139 Flag for PAINT border ($00=same color, $80=nonbackground color) $008C-$008D 140-141 Pointer to bit map color information $008E 142 Temporary storage $008F 143 Temporary storage $0090 144 I/O status word (ST) $0091 145 STOP key flag $0092 146 Temporary storage $0093 147 Flag for load ($00) or verify ($01) $0094 148 Flag for buffered serial output ($00=no, $80=yes) $0095 149 Buffered serial output byte $0096 150 Save .X for BASIN $0097 151 Count of open logical files $0098 152 Current input device $0099 153 Current output device $009A 154 Flag for message output ($00=program, $80=BASIC direct mode, $C0=monitor) $009B-$009C 155-156 Current SAVE address $009D-$009E 157-158 End SAVE address (+1)/LOAD address $009F-$00A0 159-160 Temporary storage $00A1-$00A2 161-162 Vector for monitor $00A3 $00A5 163-165 System clock $00A6 166 Part of serial bus EOI count $00A7 167 Buffered tape I/O byte $00A8 168 Buffered serial input byte $00A9-$00AA 169-170 Color vector for scrolling/temporary storage $00AB 171 Current file name length $00AC 172 Number of current logical file $00AD 173 Secondary address of current logical file $00AE 174 Device number of current logical file $00AF-$00B0 175-176 Pointer to name of current logical file $00B1 177 Count of tape errors $00B2-$00B3 178-179 Begin SAVE address $00B4-$00B5 180-181 Relocated LOAD address $00B6-$00B7 182-183 Pointer for cassette buffer $00B8-$00B9 184-185 Address for VECTOR $00BA-$00BB 186-187 Temporary storage for cassette I/O $00BC-$00BD 188-189 Pointer for tape messages $00BE-$00BF 190-191 Pointer to fetch byte for ROM banking $00C0-$00C1 192-193 Text vector for scrolling/temporary storage $00C2 194 Flag for reversed text ($00=off, $12=on) $00C3 195 Last cursor column for input $00C4 196 Temporary cursor line pointer $00C5 197 Temporary cursor column pointer $00C6 198 Flag for shift/control key input $00C7 199 Flag for input from keyboard ($00) or screen ($03) $00C8-$00C9 200-201 Address of current screen line $00CA 202 Current cursor column $00CB 203 Flag for quote mode ($00=no, $01=yes) $00CC 204 Temporary storage for editor $00CD 205 Current cursor line $00CE 206 Last character input $00CF 207 Counter for insert mode characters $00D0-$00D7 208-215 Zero page area reserved for speech software $00D8-$00E8 216-232 Free zero page area for applications $00E9 233 Segment size for CIRCLE $00EA-$00EB 234-235 Address of current color line $00EC-$00ED 236-237 Indirect for key scan table $00EE 238 Temporary storage for key scan $00EF 239 Keyboard queue index $00F0 240 Flag for screen I/O pause (CTRL S/T) $00F1-$00F4 241-244 Zero page area for monitor $00F5 245 Cassette I/O checksum $00F6 246 Zero page location for monitor $00F7 247 Pass number for cassette I/O $00F8 248 Type of cassette block $00F9 249 Flag for DMA disk ($00=not present, $80=present) $00FA 250 Temporary storage for .X during stop key check $00FB 251 Number of ROM bank currently enabled $00FC 252 X-on character for RS232 I/O $00FD 253 X-off character for RS232 I/O $00FE 254 Temporary storage for cursor line in editor $00FF 255 Used as base address for indexing forward $0100-$010F 256-271 Floating point operation buffer $0110-$0112 272-274 Temporary storage for .A, .X, .Y during I/O $0113-$0122 275-290 RAM color/ luminance table for color keys $0123-$01FF 291-511 Processor stack $0200-$0258 512-600 Input buffer $0259-$025A 601-602 Last BASIC line number $025B-$025C 603-604 Last BASIC text pointer $025D 605 Loop courter for DOS $025E-$026D 606-621 Buffer for disk file name $026E 622 Length of diskfile name 1 $026F 623 Drive for disk file 1 $0270-$0271 624-625 Address of disk file name 1 $0272 626 Length of disk file name 2 $0273 627 Drive for disk file 2 $0274-$0275 628-629 Address of disk file name 2 $0276 630 Logical address for DOS $0277 631 Physical address for DOS $0278 632 Secondary address for DOS $0279-$027A 633-634 Disk identifier $027B 635 Flag for disk id specified $027C 636 Buffer for disk output string $027D-$02AC 637-684 Disk output string area $02AD-$02AE 685-686 Graphics current x-coordinate $02AF-$02B0 687-688 Graphics current y-coordinate $02B1-$02B2 689-690 Final x-coordinate $02B3-$02B4 691-692 Final y-eoordinate $02B5-$02C4 693-708 Graphics calculation area $02C5 709 Current angle's sign $02C6-$02C7 710-711 Current angle's sine $02C8-$02C9 712-713 Current angle's cosine $02CA-$02CB 714-715 Temporary storage for distance routines $02CC-$02E3 716-739 PRINT USING/CIRCLE/SHAPE work area $02E4 740 CHAR command character ROM address $02E5 741 Temporary storage for GSHAPE $02E6 742 Flag for SCALE ($00=off, $01=on) $02E7 743 Flag for double width $02E8 744 Flag for BOX fill $02E9 745 Temporary storage of bit mask $02EA 746 Length of string $02EB 747 Flag for TRON ($00=off, $FF=on) $02EC-$02EE 748-750 Temporary storage for DIRECTORY $02EF 751 Temporary storage for graphics $02F0 752 Count of graphics parameters $02F1 753 Flag for relative or absolute $02F2-$02F3 754-755 Vector for floating point to integer conversion $02F4-$02F5 756-757 Vector for integer to floating point conversion $02F6-$02FD 758-765 Free $02FE-$02FF 766-767 Vector for cartridge software startup $0300-$0301 768-769 Vector for error routine $0302-$0303 770-771 Vector for BASIC warm start $0304-$0305 772-773 Vector for tokenization routine $0306-$0307 774-775 Vector for token PRINT $0308-$0309 776-777 Vector to execute BASIC code $030A-$030B 778-779 Vector for arithmetic symbol evaluation $030C-$030D 780-781 Vector to escape token crunch routine $030E-$030F 782-783 Vector to escape token PRINT routine $0310-$0311 784-785 Vector to escape execute routine $0312-$0313 786-787 Vector for vertical blank IRQ routine $0314-$0315 788-789 Vector for IRQ routine $0316-$0317 790-791 Vector for BRK instruction processing $0318-$0319 792-793 Vector for OPEN $031A-$031B 794-795 Vector for CLOSE $031C-$031D 796-797 Vector for CHKIN $031E-$031F 798-799 Vector for CHOUT $0320-$0321 800-801 Vector for CLRCH $0322-$0323 802-803 Vector for BASIN $0324-$0325 804-805 Vector for BSOUT $0326-$0327 806-807 Vector for STOP $0328-$0329 808-809 Vector for GETIN $032A-$032B 810-811 Vector for CLALL $032C-$032D 812-813 Free vector $032E-$032F 814-815 Vector for LOADSP $0330-$0331 816-817 Vector for SAVESP $0332-$03F2 818-1010 Buffer for cassette I/O $03F3-$03F4 1011-1012 Number of characters to write to tape $03F5-$03F6 1013-1014 Number of characters to read from tape $03F7-$0436 1015-1078 RS232 buffer $0437-$0454 1079-1108 Cassette I/ O error stack (low bytes) $0455-$0472 1109-1138 Cassette I/ O error stack (high bytes) $0473-$0478 1139-1144 Entry to get next character from BASIC text RAM $0479-$0484 1145-1156 Entry to get same character from BASIC text RAM $0485-$0493 1157-1171 Entry to check for numeric input $0494-$04AI 1172-1185 Self-modifying routine to fetch RAM data via (.A),Y $04A2-$04A4 1186-1188 Zeroes $04A5-$04AF 1189-1199 Fetch RAM via BASIC text pointer ($3B),Y $04B0-$04BA 1200-1210 Fetch RAM from ($22),Y $04BB $04C5 1211-1221 Fetch RAM from ($24),Y $04C6-$04D0 1222-1232 Fetch RAM from ($6F),Y $04D1 $04DB 1233-1243 Fetch RAM from ($5F),Y $04DC-$04E6 1244-1254 Fetch RAM from ($64),Y $04E7 1255 PRINT USING symbol for blank $04E8 1256 PRINT USING symbol for comma $04E9 1257 PRINT USING symbol for decimal point $04EA 1258 PRINT USING symbol for dollar sign $04EB-$04EE 1259-1262 Temporary storage for string functions $04EF 1263 Number of latest error $04F0-$04F1 1264-1265 Line number of latest error $04F2 $04F3 1266-1267 TRAP line $04F4 1268 Temporary storage for TRAP $04F5-$04F6 1269-1270 BASIC text pointer at latest error $04F7 1271 BASIC stack pointer at latest error $04F8-$04F9 1272-1273 DO storage of BASIC text pointer $04FA-$04FB 1274-1275 DO storage of line number $04FC 1276 Low byte of sound I duration $04FD 1277 Low byte of sound 2 duration $04FE 1278 High byte of sound I duration $04FF 1279 High byte of sound 2 duration $0500-$0502 1280-1282 USR function jump instruction $0503-$0507 1283-1287 Random number registers $0508 1288 Checked for cold/warm start ($A5=warm) $0509-$0512 1289-1298 Table of OPEN logical file numbers $0513-$051C 1299-1308 Table of OPEN device numbers $051D-$0526 1309-1318 Table of OPEN secondary addresses $0527-$0530 1319-1328 Keyboard queue $0531-$0532 1329-1330 Bottom of memory $0533 $0534 1331-1332 Top of memory $0535 1333 Timeout flag (DMA) $0536 1334 EOF flag (DMA) $0537 1335 Number of bytes in buffer $0538 1336 Valid bytes in buffer $0539 1337 Pointer to buffer $053A 1338 Type of current tape file $053B 1339 Current character color/ luminance $053C 1340 Current character flash flag ($00=no, $80=yes) $053D 1341 Free $053E 1342 Screen memory start (hilgh byte) $053F 1343 Length of keyboard queue $0540 1344 Flag for key repeat ($80=all keys repeat, $40=no keys repeat, $00=space,INST/ DEL, and cursor keys repeat) $0541-$0542 1345-1346 Counters for key repeats; $0543 1347 Flag for shift key $0544 1348 Pattern of last shift $0545-$0546 1349-1350 Vector for keyboard tabDe $0547 1351 Commodore SHIFT ena~ble ($00=enabled, $ 80 =d is ab led ) $0548 1352 Flag for scrolling (not used) $0549-$054A 1353-1354 Temporary storage durir.'g screen output $054B-$0551 1355-1361 Storage for monitor $0552-$0558 1362-1368 Register storage for mor~itor (PC,SR,A,X,Y,SP) $0559-$055C 1369-1372 Storage for monitor $055D 1373 Number of characters leilt to get from function key definition $055E 1374 Pointer to current chara,cter in function key definition $055F-$0566 1375-1382 Table of lengths of function key definitions $0567-$05E6 1383-1510 Function key definitions. $05E7 1511 Temporary storage for dlata write (DMA) $05E8 1512 Read or write (DMA) $05E9 1513 Device number (DMA) $05EA 1514 Presence flag (DMA) $05EB 1515 Temporary storage for o~pen type (DMA) $05EC-$05EF 1516-1519 Table of physical addresses for cartridge ROMs $05F0-$05F1 1520-1521 Long jump for banking ~outines $05F2 1522 .A for long jump $05F3 1523 .X for long jump $05F4 1524 .Y for long jump $05F5-$065D 1525-1629 Banking RAM area $065E-$06EB 1630-1771 RAM reserved for speech software $06EC-$07AF 1772-1967 BASIC stack $07B0 1968 Tape byte to write $07B1 1969 Temporary parity calculation byte $07B2-$07B3 1970-1971 Temporary storage for tape header write $07B4 1972 Free $07B5 1973 Temporary index for reading bytes $07B6 1974 Pointer to error stack $07B7 1975 Count of errors on initial pass $07B8-$07BD 1976-1981 Constants for timing $07BE 1982 Pointer to stack for STOP recover $07BF 1983 Pointer to stack for drop key recover $07C0-$07C3 1984-1987 Read block parameters $07C4 1988 Temporary status for read block $07C5 1989 Count of leader shorts to find $07C6 1990 Count of read errors fatal $07C7 1991 Temporary storage for VERIFY $07C8-$07CC 1992-1996 Temporary storage for tape I/O $07CD 1997 RS232 data character to send buffer $07CE 1998 RS232 flag for data character to send ($00=no, $80=yes) $07CF 1999 RS232 control character to send buffer $07D0 2000 RS232 flag for control character to send ($00=no, $80=yes) $07D1 2001 RS232 pointer to current start of input queue $07D2 2002 RS232 pointer to current end of input queue $07D3 2003 RS232 current count of input queue $07D4 2004 RS232 status $07D5 2005 RS232 temporary storage of character input $07D6 2006 RS232 flag for local hold off $07D7 2007 RS232 flag for remote hold off $07D8 2008 RS232 flag for presence of ACIA $07D9-$07E4 2009-2020 Indirect indexed RAM fetch routine via contents of $07DF $07E5 2021 Bottom screen line of current window $07E6 2022 Top screen line of current window $07E7 2023 Left screen column of current window $07E8 2024 Right screen column of current window $07E9 2025 Flag to disable scrolling ($00=scroll, $80=don't) $07EA 2026 Auto insert flag ($00=off, $FF=on) $07EB 2027 Latest character primed $07EC 2028 Storage for screen line management $07ED 2029 Color under cursor $07EE-$07F1 2030-2033 Line link table for screen $07F2 2034 .A to send to SYS $07F3 2035 .X to send to SYS $07F4 2036 .Y to send to SYS $07F5 2037 Status register to send to SYS $07F6 2038 Index for key scan $07F7 2039 Flag for control S/T ($00=enabled, else disabled) $07F8 2040 Bank for monitor fetches ($00=ROM, $80=RAM) $07F9 2041 Bank for color key color/luminance value table ($00=RAM ($0113-$0122), $80=ROM) $07FA 2042 Bit map mask for split screen $07FB 2043 Screen memory mask for split screen $07FC 2044 Cassette motor lock signal $07FD 2045 Time-of-day for PAL (not used) $07FE-$07FF 2046-2047 Free $0800-$0BE7 2048-3047 Color memory $0BE8-$0BFF 3048-3071 Free $0C00-$0FE7 3072-4071 Screen memory $0FE8-$0FFF 4072-4095 Free $1000-$3FFF 4096-16383 RAM used by BASIC (in text mode) $1000-$17FF 4096-6143 Free (in BASIC graphics mode) $1800-$1BE7 6144-7143 Luminance memory (in BASIC graphics mode) $1BE8-$1BFF 7144-7167 Free (in BASIC graphics mode) $1C00-$1FE7 7168-8167 Color memory (in BASIC graphics mode) $1FE8-$1FFF 8168-8191 Free (in BASIC graphics mode) $2000-$3F3F 8192-16191 Graphics screen (in BASIC graphics mode) $3F40-$3FFF 16192-16383 Free (in BASIC graphics mode) $4000-$7FFF 16384-32767 RAM used by BASIC $8000-$FCFF 32768-64767 RAM used by BASIC (under ROM) $8000-$CDFF 32768-52735 BASIC and monitor ROM $CE00-$CFFF 52736-53247 Operating system ROM $D000-$D7FF 53248-55295 Character ROM $D800-$FBFF 55296-64511 Operating system ROM $FC00-$FCFF 64512-64767 Banking routines ROM (in all ROM maps) $FCFI-$FCF3 64753-64755 Jump to interrupt routine for cartridge $FCF4-$FCF6 64756-64758 Jump to cartridge reenable routine $FCF7-$FCF9 64759-64761 Jump to long fetch routine $FCFA $FCFC 64762-64764 Jump tolongjump routine $FCFD-$FCFF 64765-64767 Jump to long interrupt routine $FD00-$FDOF 64768-64783 ACIA chip (used for RS232, in all maps) $FD10-$FDIF 64784-64799 Parallel port (6529, in all maps) $FD20 $FDCF 64800 64975 Unknown (in all maps) $FDD0-$FDDF 64976-64991 Cartridge banking port (in all maps) $FDE0-$FEFF 64992-65279 Direct Memory Access disk (in all maps) $FF00 $FF3F 65280-65343 Graphics chip (in all maps) $FF40-$FFFF 65344-65535 RAM (under ROM) $FF40-$FFFF 65344-65535 Operating system ROM $FF49-$FF4B 65353-65355 Jump to function key definition routine $FF4C-$FF4E 65356-65358 Jump to PRINT routine $FF4F-$FF51 65359-65361 Jump to print message routine $FF52-$FF55 65362-65364 Jump to monitor $FF80 65408 Version number of operating system ROM (most significant bit 0=NTSC, 1=PAL) $FF81-$FF83 65409 65411 Jump to CINT $FF84-$FF86 65412-65414 Jump to IOINIT $FF87-$FF89 65415-65417 Jump to RAMTAS $FF8A-$FF8C 65418-65420 Jump to RESTOR $FF8D-$FF8F 65421-65423 Jump to VECTOR $FF90-$FF92 65424-65426 Jump to SETMSG $FF93-$FF95 65427-65429 Jump to SECND $FF96-$FF98 65430-65432 Jump to TKSA $FF99-$FF9B 65433-65435 Jump to MEMTOP $FF9C-$FF9E 65436-65438 Jump to MEMBOT $FF9F-$FFA1 65439-65441 Jump to SCNKEY $FFA2-$FFA4 65442 65444 Jump to SETTMO $FFA5-$FFA7 65445-65447 Jump to ACPTR $FFA8-$FFAA 65448 65450 Jump to CIOUT $FFAB-$FFAD 65451 -65453 Jump to UNTLK $FFAE-$FFB0 65454-65456 Jump to UNLSN $FFBI-$FFB3 65457-65459 Jump to LISTN $FFB4-$FFB6 65460-65462 Jump to TALK $FFB7-$FFB9 65463-65465 Jump to READSS $FFBA-$FFBC 65466-65468 Jump to SETLFS $FFBD-$FFBF 65469-65471 Jump to SETNAM $FFC0-$FFC2 65472-65474 Jump to OPEN $FFC3-$FFC5 65475-65477 Jump to CLOSE $FFC6-$FFC8 65478-65480 Jump to CHKIN $FFC9-$FFCB 65481-65483 Jump to CHOUT $FFCC-$FFCE 65484-65486 Jump to CLRCH $FFCF-$FFD1 65487-65489 Jump to BASIN $FFD2-$FFD4 65490-65492 Jump to BSOUT $FFD5-$FFD7 65493-65495 Jump to LOADSP $FFD8 $FFDA 65496-65498 Jump to SAVESP $FFDB-$FFDD 65499-65501 Jump to SETTIM $FFDE-$FFE0 65502-65504 Jump to RDTIM $FFE1-$FFE3 65505-65507 Jump to STOP $FFE4-$FFE6 65508-65510 Jump to GETIN $FFE7-$FFE9 65511-65513 Jump to CLALL $FFEA-$FFEC 65514-65516 Jump to UDTIM $FFED-$FFEF 65517-65519 Jump to SCRORG $FFF0 $FFF2 65520-65522 Jump to PLOT $FFF3-$FFF5 65523-65525 Jump to IOBASE $FFF6-$FFF8 65526-65528 Bank in ROM $FFF9 65529 Jump opcode $FFFA-$FFFB 65530-65531 Vector (used for reset, not NMIs) $FFFC-$FFFD 65532-65533 RESET vector $FFFE-$FFFF 65534-65535 IRO vector Operating System Subroutine Descriptions $FF81 CINT Registers Altered: .A, .X, .Y Initializes the screen editor. This subroutine performs such functions as setting up default I/ O devices (keyboard and screen), the text window, and the current character color. It clears the screen to all blanks with character color black. $FF84 IOINIT Registers Altered: .A, .X Initializes the I/O devices. This subroutine performs such functions as setting up the graphics chip and the DMA disk. $FF87 RAMTAS Registers Altered: .A, .X, .Y Performs a RAM test. This subroutine performs such functions as clearing zero page and pages 2,3, 4, and 7, setting the top and bottom of memory, and defining the function keys. Call it before any of these areas are initialized, or otherwise they will be overwritten. $FF8A RESTOR Registers Altered: .A, .X, .Y Restores the vectors to their initial values. This subroutine sets up the vectors at $0312-$0331 from ROM, performing such functions as directing IRQ and BRK service to the appropriate addresses. $FF8D VECTOR Registers Altered: .A, .Y When called with the carry clear, loads the vectors at $0312-$0331 from a designated section of memory. Before calling this subroutine, set .X to the low address to load the vectors from, and .Y to the high address to load the vectors from. Be certain none of the vectors will be used during the loading process (e.g., disable interrupts). When called with the carry set, this subroutine reads the vectors and stores their values in the designated section of memory. Before calling it, set .X to the low address to store the vectors to, and .Y to the high address to store the vectors to. $FF90 SETMSG Registers Altered: .A Sets the system message flag to control output of messages. The value in .A when the routine is called is stored in the message flag ($9A). A value of $00 means a program is running (and presumably handles message output). A value of $80 flags output of direct BASIC mode messages. A value of $C0 flags output of MONITOR messages. $FF93 SECND Registers Altered: .A Sends the value in .A as a secondary address to a device following a call to LISTN ($FFBI). The valid secondary addresses depend on the device. The secondary address must be ORed with $60 before SECND is called. For the 1541 disk operating system, the low nybble determines the channel ($0 is reserved for LOAD, $1 for SAVE, and $F is the command channel). If the high nybble is $F, a CLOSE is indicated. If the high nybble is $E, an OPEN is indicated. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FF96 TKSA Registers Altered: .A Sends the value in .A as a secondary address to a device following a call to TALK ($FFB4). The valid secondary addresses depend on the device. The secondary address must be ORed with $60 before TKSA is called. For the 1541 disk operating system, the low nybble determines the channel ($0 is reserved for LOAD, $1 for SAVE, and $F is the command channel). If the high nybble is $F, a CLOSE is indicated. If the high nybble is $E, an OPEN is indicated. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FF99 MEMTOP Registers Altered: .X, .Y When called with the carry set, returns with .X equal to the low byte of the top of memory, and .Y equal to the high byte of the top of memory. When called with the carry clear, the top of memory ($0533-$0534)is set. The low byte is from .X and the high byte from .Y. The top of memory is the address plus one of the end of a contiguous section of RAM for use by BASIC. It is initially set during the power-on sequence. $FF9C MEMBOT Registers Altered: .X, .Y When called with the carry set, returns with .X equal to the low byte of the bottom of memory, and .Y equal to the high byte of the bottom of memory. When called with the carry clear, the bottom of memory ($0531-$0532)is set. The low byte is from .X and the high byte from .Y. Only the high byte of the bottom of memory is initialized during the power-on sequence. BASIC does not use this information. $FF9F SCNKEY Registers Altered: .A, .X,.Y Scans the keyboard and sets up the keyboard queue and the function key index register for the GETIN ($FFE4) and BASIN ($FFCF) routines. This subroutine is normally called by the system IRQ service routine. $FFA2 SETTMO Registers Altered: none The value in .A is stored in the timeout flag ($0535). This location is not used by the built-in Plus/ 4 operating system. It is designed for use with add-on hardware and software. $FFA5 ACPTR Registers Altered: .A Returns I byte of data in .A from the serial bus or DMA disk using handshaking. A device must be instructed to talk using the routine TALK ($FFB4) before this routine is called. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFA8 CIOUT Registers Altered: none Sends the byte in .A to the serial bus or DMA disk using handshaking. Normally, one or more devices will have been instructed to listen using the routine LISTN ($FFBI) before this routine is called. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFAB UNTLK Registers Altered: .A Commands all devices on the serial bus or the DMA disk to stop talking (see TALK, $FFB4). The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFAE UNLSN Registers Altered: .A Commands all devices on the serial bus or the DMA disk to stop listening (see LISTN, $FFBI). The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFB1 LISTN Registers Altered: .A Commands a device on the serial bus or the DMA disk to listen. The device number ($04-$1 F) must be in .A. Also, if it has not previously been set, the device number must be stored in the current device number ($AE) before this routine is called. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFB4 TALK Registers Altered: .A Commands a device on the serial bus or the DMA disk to talk. The device number ($04-$1 F) must be in . A. Also, if it has not previously been set, the device number must be stored in the current device number ($AE) before this routine is called. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFB7 READSS Registers Altered: .A Returns the current value of the I/ O status byte ($90) in .A. The bits of the status byte have various meanings depending on the device accessed. In general, a value of zero indicates no error. Some of the meanings of the status bits are outlined in the following table. Bit Tape 1/0 Serial 1/0 RS232 1/ 0 0 ‹ timeout write parity error 1 ‹ timeout read framing error 2 short block ‹ receiver buffer overrun 3 long block ‹ receiver buffer empty 4 read error ‹ clear to send missing 5 checksum error - - 6 end of file end or identify data set ready missing 7 end of tape device not present break detected For the 1541 disk drive, the end or identify bit set usually means the end of file has been reached. Also, for a LOADSP ($FFD5) with the verify flag set, bit 4 set means that a verify error was found. $FFBA SETLFS Registers Altered: none Prepares for a call to OPEN ($FFC0), LOADSP ($FFD5), or SAVESP ($FFD8). Before calling the routine, set .A to the logical file number to be associated with the file (needed for OPEN only), .X to the device number, and .Y to the secondary address to be sent to the device for OPEN; for LOADSP, a zero for this secondary address causes a relocated load. If no secondary address is needed, set .Y to $FF. $FFBD SETNAM Registers Altered: none Prepares for a call to OPEN ($FFC0), LOADSP ($FFD5), or SAVESP ($FFD8). Before calling this routine, set .A to the length of the file name, .X to the low byte of the address of the file name, and .Y to the high byte of the address of the file name. If no file name is needed, set .A to $00. $FFC0 OPEN Registers Altered: .A, .X, .Y This routine is vectored through $0318-$0319. It opens the logical file specified in calls to SETLFS ($FFBA) and SETNAM ($FFBD). If an error occurs, the message flag (see SETMSG, $FF90) is consulted to determine what message (if any) to output. The carry is returned set, and .A contains the error number. Possible errors are as follows: $01 = The logical file table is full. $02 = The specified logical file is already open. $04 = The specified file name is not found on the specified device. $05 = The specified device is not present. The system I/O status byte may also be checked for errors. It is read using READSS ($FFB7). $FFC3 CLOSE Registers Altered: .A, .X This routine is vectored through $031 A-$03 I B. This routine closes the logical file specified by the value in .A. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFC6 CHKIN Registers Altered: .A, .X This routine is vectored through $031 C-$03 I D. The logical file specified by the value of.X, which must have been previously opened using OPEN ($FFC0), is designated as an input channel. If an error occurs, the message flag (see SETMSG, $FF90) is consulted to determine what message (if any) to output. The carry is returned set, and .A contains the error number. The possible errors are as follows: $03 = The specified logical file is not open. $05 = The specified device is not present. $06 = The specified device is not an input device. The system I/O status byte may also be checked for errors. It is read using READSS ($FFB7). $FFC9 CHOUT Registers Altered: .A, .X This routine is vectored through $031 E-$03 I F. The logical file specified by the value of .X, which must have been previously opened using OPEN ($FFC0), is designated as an output channel. If an error occurs, the message flag (see SETMSG, $FF90) is consulted to determine what message (if any) to output. The carry is returned set, and .A contains the error number. The possible errors are as follows: $03 = The specified logical file is not open. $05 = The specified device is not present. $07 = The specified device is not an output device. The system I/O status byte may also be checked for errors. It is read using READSS ($FFB7). $FFCC CLRCH Registers Altered: .A, .X This routine is vectored through $0320-$0321. The input and output channels are cleared. If the serial bus or DMA disk was in use, an unlisten or untalk command is sent. The input and output devices are reset to the keyboard and screen. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFCF BASIN Registers Altered: .A This routine is vectored through $0322-$0323. This subroutine returns 1 byte in .A from the current input channel. For all devices except the keyboard, calls to OPEN ($FFC0) and CHKIN ($FFC6) must precede this call. The channel remains open following the call to this routine. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). For the keyboard, the first call to this routine turns on the cursor at its current location and receives input (including function key definitions) that is echoed to the screen until a carriage return is detected. A full screen of characters may be entered. When the carriage return is received, the routine returns with the first character in .A. Each subsequent call returns the next character. The input is complete when a carriage return ($0D) is returned. $FFD2 BSOUT Registers Altered: none* This routine is vectored through $0324-$0325. The byte in .A is sent to the output channel. For all devices except the screen, calls to OPEN ($FFC0) and CHOUT ($FFC9) must precede this call. The channel remains open following a call to this routine. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). *When used to send data to device I (the cassette) or 2 (RS-232), this routine may alter the value of.A on return. $FFD5 LOADSP Registers Altered: .A, .X, .Y Loads a file into memory or verifies a file against memory. For a relocated load, .X contains the low byte of the load address and .Y contains the high byte. After storing this load address, the routine vectors through $032E-$032F. For a load, .A should be $00. For a verify operation in which the designated memory is compared with the file but not changed, .A should be $01 (or another nonzero value). The call to this subroutine must be preceded by calls to SETLFS ($FFBA) and SETNAM ($FFBD). If the secondary address sent with SETLFS is $00, then the load is relocated to the address given in .X and .Y and the first 2 bytes of the file are ignored; otherwise the first 2 bytes of the file specify the load address. In any case, .X returns with the low byte of the last address loaded (+1) and .Y with the high byte of the last address loaded (+ 1). For a verify, the status byte is $00 for a valid compare and $10 when a difference is found. If an error occurs, the message flag (see SETMSG $FF90) is consulted to determine what message (if any) to output. The carry is returned set, and .A contains the error number. The possible errors are as follows: $00 = The routine was terminated by the STOP key. $04 = The specified file name is not found on the specified device. $05 = The specified device is not present. $08 = The file name was missing. $09 = The specified device is illegal for this purpose. The system I/O status byte may also be checked for errors. It is read using READSS ($FFB7). $FFD8 SAVESP Registers Altered: .A, .X, .Y Saves memory into a file. The address to start the save must be stored on zero page, low byte followed by high byte. This zero page location must then be placed in .A. The low byte of the address to stop the save (plus 1) must be placed in .X and the high byte in .Y. After these addresses are stored, the routine vectors through $0330-$0331. The call to this subroutine must be preceded by calls to SETLFS ($FFBA) and SETNAM ($FFBD). If an error occurs, the message flag (see SETMGS, $FF90) is consulted to determine what message (if any) to output. The carry is returned set, and .A contains the error number. The possible errors are as follows: $00 = The routine was terminated by the STOP key. $05 = The specified device is not present. $08 = The file name was missing. $09 = The specified device is illegal for this purpose. The system I/O status byte may also be checked for errors. It is read using READSS ($FFB7). $FFDB SETTIM Registers Altered: none Sets the system clock. This clock consists of 3 bytes (24 bits) on zero page ($A3-$A5). The low byte of the desired setting must be in .A, the middle byte in .X, and the high byte in .Y. The clock is updated by the normal system IRQ service routine. If the system IRQ service is not done, calls to UDTIM ($FFEA) may be used to update it. The normal system interrupt is a raster interrupt that occurs every I / 60th of a second (on NTSC systems). The clock is incremented by I until it reaches $4F I A00, which is 24 hours; then it is reset to zero. During some I/O operations, interrupts are disabled. This affects the clock. $FFDE RDTIM Registers Altered: .A, .X, .Y Reads the system clock. The low byte of the clock setting is returned in .A, the middle byte in .X, and the high byte in .Y. See SETTIM ($FFDB) for a description of the system clock. $FFE1 STOP Registers Altered: .A, .X This routine is vectored through $0326-$0327. This routine looks at a zero page location ($91) to determine if the STOP key was pressed. This location is updated by the system IRQ service routine or UDTIM ($FFEA). If the STOP key was detected, this routine calls CLRCH ($FFCC) and clears the keyboard queue. If the Z flag is set on exit, the STOP key was detected; if it is clear, the STOP key was not detected. $FFE4 GETIN Registers Altered: .A,.X,.Y This routine is vectored through $0328-$0329. This subroutine returns I byte in .A from the current input channel. For all devices except the keyboard, calls to OPEN ($FFC0) and CHKIN ($FFC6) must precede this call. The channel remains open following the call to this routine. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). For the keyboard, this routine gets I byte from the queue. If the queue is empty, a zero is returned in .A. $FFE7 CLALL Registers Altered: .A, .X This routine is vectored through $032A-$032B. This routine clears all channels with a call to CLRCH ($FFCC) and closes all logical files. The system I/O status byte may be checked for errors. It is read using READSS ($FFB7). $FFEA UDTIM Registers Altered: .A, .X Increments the system clock ($A3-$A5) and compares it with $4FIA01 to determine when to reset to zero. Also, this routine checks for the STOP key and sets the STOP key flag ($91), which is used by STOP ($FFEI). This routine is normally called by the system IRQ service routine. See SETTIM ($FFDB) for a description of the system clock. $FFED SCRORG Registers Altered: .X, .Y Returns $28 (the screen width) in .X and $19 (the screen height) in .Y to indicate the physical size of the Plus/4 screen. This subroutine is useful only for programs intended to run on other Commodore computers with a different screen size (e.g., the VIC-20). $FFF0 PLOT Registers Altered: .A, .X, .Y When called with the carry flag clear, sets the cursor position. The new cursor line number should be in .X, and the new cursor column should be in .Y. The screen window is returned to its default (the whole screen). When called with the carry flag set, this routine returns the current cursor position. The cursor line number is returned in .X and the cursor column in .Y. $FFF3 IOBASE Registers Altered: .X, .Y Returns $00 (the low byte of the I/ O base address) in .X and $FD (the high byte of the I/O base address) in .Y. This subroutine is useful only for programs intended to run on other Commodore computers. $FFF6 RESET Registers Altered: all Does a warm reset of the Plus/4. If the STOP key is detected, this routine goes to the MONITOR, leaving the contents of memory intact. If STOP is not detected, the Plus/4 goes to BASIC with the contents of memory reinitialized. BASIC Tokens In BASIC programs, the keywords (e.g., PRINT, GET, etc.) are not stored as character strings. Each keyword has a unique "token" assigned to it that is stored instead of the word itself. BASIC recognizes the tokens because their high bit is always set. When you enter a BASIC line, BASIC translates the keywords into tokens for storage. When you LIST a program, BASIC translates the tokens back into keywords. Dec Hex Keyword 128 $80 END 129 $81 FOR 130 $82 NEXT 131 $83 DATA 132 $84 INPUT# 133 $85 INPUT 134 $86 DIM 135 $87 READ 136 $88 LET 137 $89 GOTO 138 $8A RUN 139 $8B IF 140 $8C RESTORE 141 $8D GOSUB 142 $8E RETURN 143 $8F REM 144 $90 STOP 145 $91 ON 146 $92 WAIT 147 $93 LOAD 148 $94 SAVE 149 $95 VERIFY 150 $96 DEF 151 $97 POKE 152 $98 PRINT# 153 $99 PRINT 154 $9A CONT 155 $9B LIST 156 $9C CLR 157 $9D CMD 158 $9E SYS 159 $9F OPEN 160 $A0 CLOSE 161 $AI GET 162 $A2 NEW 163 $A3 TAB( 164 $A4 TO 165 $A5 FN 166 $A6 SPC( 167 $A7 THEN 168 $A8 NOT 169 $A9 STEP 170 $AA + 171 $AB - 172 $AC * 173 $AD / 174 $AE ^ 175 $AF AND 176 $B0 OR 177 $BI > 178 $B2 = 179 $B3 < 180 $B4 SGN 181 $B5 INT 182 $B6 ABS 183 $B7 USR 184 $B8 FRE 185 $B9 POS 186 $BA SQR 187 $BB RND 188 $BC LOG 189 $BD EXP 190 $BE COS 191 $BF SIN 192 $C0 TAN 193 $C1 ATN 194 $C2 PEEK 195 $C3 LEN 196 $C4 STR$ 197 $C5 VAL 198 $C6 ASC 199 $C7 CHR$ 200 $C8 LEFT$ 201 $C9 RIGHT$ 202 $CA MID$ 203 $CB GO 204 $CC RGR 205 $CD RCLR 206 $CE RLUM 207 $CF JOY 208 $D0 RDOT 209 $D1 DEC 210 $D2 HEX$ 211 $D3 ERR$ 212 $D4 INSTR 213 $D5 ELSE 214 $D6 RESUME 215 $D7 TRAP 216 $D8 TRON 217 $D9 TROFF 218 $DA SOUND 219 $DB VOL 220 $DC AUTO 221 $DD PUDEF 222 $DE GRAPHIC 223 $DF PAINT 224 $E0 CHAR 225 $E1 BOX 226 $E2 CIRCLE 227 $E3 GSHAPE 228 $E4 SSHAPE 229 $E5 DRAW 230 $E6 LOCATE 231 $E7 COLOR 232 $E8 SCNCLR 233 $E9 SCALE 234 $EA HELP 235 $EB DO 236 $EC LOOP 237 $ED EXIT 238 $EE DIRECTORY 239 $EF DSAVE 240 $F0 DLOAD 241 $FI HEADER 242 $F2 SCRATCH 243 $F3 COLLECT 244 $F4 COPY 245 $F5 RENAME 246 $F6 BACKUP 247 $F7 DELETE 248 $F8 RENUMBER 249 $F9 KEY 250 $FA MONITOR 251 $FB USING 252 $FC UNTIL 253 $FD WHILE 254 $FE unknown 255 $FF (pi)