In this page...


Index

$4000-$AEFF - BASIC Entry Vectors

BASIC Entry Vectors

16384 $4000 JHARD_RESET

Disassembled code

Entry point for the HARD_RESET routine, currently at $4023.

BASIC cold-start entry point. This is the normal entry point following a system reset.

16387 $4003 JSOFT_RESET

Disassembled code

Entry point for the SOFT_RESET routine, currently at $4009.

BASIC warm-start entry point. This is the normal entry point during a RUN/STOP-RESTORE NMI interrupt.

16390 $4006 JBASIC_IRQ

Disassembled code

Entry point for the BASIC_IRQ routine, currently at $A84D.

BASIC IRQ entry point. The target routine supports sprite movement, sprite collision detection, light pen reading, and the BASIC music statements. This is the normal entry point during the system IRQ service routine.

16393 $4009 SOFT_RESET

Performs a warm start of BASIC

Disassembled code

This routine is the normal final step of the RUN/STOP-RESTORE sequence. It resets the SID registers and sound locations, and calls the routine at $418D to stop sprite movement. However, it does not reinitialize the BASIC vectors or pointers.

16416 $4020 Unused

Three unused bytes filled with the value 255/$FF.

16419 $4023 HARD_RESET

Performs a cold start of BASIC

Disassembled code

This routine is the normal final step of the reset sequence. It performs a complete initialization of BASIC, including resetting all vectors, pointers, and working storage locations to their default values. This routine also includes a call to the Kernal PHOENIX routine $FF56, which will start any function ROMs that may be present, or boot a disk if one is in the drive.

16453 $4045

Initializes BASIC pointers and constants

Disassembled code

This is the main initalization routine of the cold-start sequence. It is responsible for setting all RAM working storage locations for BASIC to their default values.

16658 $4112

Initializes SID registers and sound routine locations

Disassembled code

This routine sets all SID chip registers to 0/$00 and initializes all locations associated with the SOUND and PLAY statements.

16762 $417A

Initializes MMU preconfiguration registers

Disassembled code

16781 $418D

Initializes sprite speed and direction table

Disassembled code

This routine copies a 0/$00 into the speed control byte for each entry in the sprite movement table at $117E, effectively halting all sprite motion.

16795 $419B

Displays the power-on message

Disassembled code

This routine displays the text from the following area of ROM. Note that the free memory figure is part of the ROM message, and may not reflect the actual amount of memory available to BASIC.

16827 $41BB

Text for power-on message

Disassembled code
{CLR}
 COMMODORE BASIC V7.0 122365 BYTES FREE
  (C)1985 COMMODORE ELECTRONICS, LTD.
     (C)1977 MICROSOFT CORP.
      ALL RIGHTS RESERVED

16977 $4251

Initializes BASIC indirect vectors

Disassembled code

This routine copies the BASIC indirect vectors from the following table to locations 768-785/$0300-$0311, and initializes the vector at $02FC-$02FD.

16999 $4267

Table of default vector values

Disassembled code

This area contains the default addresses copied into the page 3 indirect vectors by the routine at $4251.

17017 $4279

Text for character retrieval routines

Disassembled code

This area contains the code for CHRGET and the other page 3 character retrieval subroutines. The routines are copied into RAM.

17102 $42CE

Assorted character retrieval subroutines

Disassembled code

17162 $430A CRUNCH

Tokenizes keywords in lines of BASIC program text

Disassembled code

17328 $43B0

Handles extended tokens

Disassembled code

17356 $43CC

Deletes a character in the input buffer

Disassembled code

17378 $43E2

Searches keyword tables for match

Disassembled code

17431 $4417

BASIC keyword tables

Disassembled code

The following table holds the BASIC 7.0 keywords in token number order. Bit 7 of the last character of each keyword will be set to %1 to indicate the end of the keyword.

Token Keyword Token Keyword
128/$80 END 160/$A0 CLOSE
129/$81 FOR 161/$A1 GET
130/$82 NEXT 162/$A2 NEW
131/$83 DATA 163/$A3 TAB(
132/$84 INPUT# 164/$A4 TO
133/$85 INPUT 165/$A5 FN
134/$86 DIM 166/$A6 SPC(
135/$87 READ 167/$A7 THEN
136/$88 LET 168/$A8 NOT
137/$89 GOTO 169/$A9 STEP
138/$8A RUN 170/$AA +
139/$8B IF 171/$AB -
140/$8C RESTORE 172/$AC *
141/$8D GOSUB 173/$AD /
142/$8E RETURN 174/$AE ^
143/$8F REM 175/$AF AND
144/$90 STOP 176/$B0 OR
145/$91 ON 177/$B1 >
146/$92 WAIT 178/$B2 =
147/$93 LOAD 179/$B3 <
148/$94 SAVE 180/$B4 SGN
149/$95 VERIFY 181/$B5 INT
150/$96 DEF 182/$B6 ABS
151/$97 POKE 183/$B7 USR
152/$98 PRINT# 184/$B8 FRE
153/$99 PRINT 185/$B9 POS
154/$9A CONT 186/$BA SQR
155/$9B LIST 187/$BB RND
156/$9C CLR 188/$BC LOG
157/$9D CMD 189/$BD EXP
158/$9E SYS 190/$BE COS
159/$9F OPEN 191/$BF SIN
192/$C0 TAN 224/$E0 CHAR
193/$C1 ATN 225/$E1 BOX
194/$C2 PEEK 226/$E2 CIRCLE
195/$C3 LEN 227/$E3 GSHAPE
196/$C4 STR$ 228/$E4 SSHAPE
197/$C5 VAL 229/$E5 DRAW
198/$C6 ASC 230/$E6 LOCATE
199/$C7 CHR$ 231/$E7 COLOR
200/$C8 LEFT$ 232/$E8 SCNCLR
201/$C9 RIGHT$ 233/$E9 SCALE
202/$CA MID$ 234/$EA HELP
203/$CB GO 235/$EB DO
204/$CC RGR 236/$EC LOOP
205/$CD RCLR 237/$EO EXIT
206/$CE function token extender 238/$EE DIRECTORY
207/$CF JOY 239/$EF DSAVE
208/$D0 ROOT 240/$F0 DLOAD
209/$D1 OEC 241/$F1 HEADER
210/$D2 HEX$ 242/$F2 SCRATCH
211/$D3 ERR$ 243/$F3 COLLECT
212/$D4 INSTR 244/$F4 COPY
213/$D5 ELSE 245/$F5 RENAME
214/$D6 RESUME 246/$F6 BACKUP
215/$D7 TRAP 247/$F7 OELETE
216/$D8 TRON 248/$F8 RENUMBER
217/$D9 TROFF 249/$F9 KEY
218/$DA SOUNO 250/$FA MONITOR
219/$DB VOL 251/$FB USING
220/$DC AUTO 252/$FC UNTIL
221/$DD PUOEF 253/$FO WHILE
222/$DE GRAPHIC 254/$FE statement token extender
223/$DF PAINT    

17929 $4609

Table of extended token statements

Disassembled code

BASIC 7.0 has too many keywords to have a one-byte token for each. Additional statements use a two-byte token where the first byte is always 254/$FE. This table holds the extended token statement keywords in order of the second byte of the token. Like the standard keywords, bit 7 of the last character of each keyword will be set to %1.

Token Keyword Token Keyword
2/$02 BANK 21/$15 DCLEAR
3/$03 FILTER 22/$16 SPRSAV
4/$04 PLAY 23/$17 COLLISION
5/$05 TEMPO 24/$18 BEGIN
6/$06 MOVSPR 25/$19 BEND
7/$07 SPRITE 26/$1A WINDOW
8/$08 SPRCOLOR 27/$1B BOOT
9/$09 RREG 28/$1C WIDTH
10/$0A ENVELOPE 29/$1D SPRDEF
11/$0B SLEEP 30/$1E QUIT
12/$0C CATALOG 31/$1F STASH
13/$0D DOPEN 32/$20 (no keyword for this token)
14/$0E APPEND 33/$21 FETCH
15/$0F DCLOSE 34/$22 (no keyword for this token)
16/$10 BSAVE 35/$23 SWAP
17/$11 BLOAD 36/$24 OFF
18/$12 RECORD 37/$25 FAST
19/$13 CONCAT 38/$26 SLOW

18121 $46C9

Table of extended token functions

Disassembled code

BASIC 7.0 has too many keywords to have a one-byte token for each. Additional functions use a two-byte token where the first byte is always 206/$CE. This table holds the extended token function keywords in order of the second byte of the token. Like the standard keywords, bit 7 of the last character of each entry is set to % 1.

Token Keyword
2/$02 POT
3/$03 BUMP
4/$04 PEN
5/$05 RSPPOS
6/$06 RSPRITE
7/$07 RSPCOLOR
8/$08 XOR
9/$09 RWINDOW
10/$0A POINTER

18172 $46FC

Table of statement dispatch addresses

Disassembled code

This area holds the address of the routines to execute tokens 128-162/$80-$A2. Because of the way statement execution is handled, the values here are actually one less than the address of the target routine.

18242 $4742

Table of statement dispatch addresses

Disassembled code

This area holds the address of the routines to execute tokens 213-250/$D5-$FA. Because of the way statement execution is handled, the values here are actually one less than the address of the target routine.

18172 $46FC

Table of statement dispatch addresses

Disassembled code

This area holds the address of the routines to execute extended statement tokens 2-38/$02-$26. Because of the way statement execution is handled, the values here are actually one less than the address of the target routine.

18317 $478D

Table of function dispatch addresses

Disassembled code

This area holds the address of the routines to execute tokens 180-211/$B4-$D3.

18454 $4816

Table of function dispatch addresses

Disassembled code

This area holds the address of the routines to execute extended function tokens 2-10/$02-$0A.

18472 $4828

Table of operator priorities and dispatch addresses

Disassembled code

Each mathematical operator such as +, -, *, and / has a three-byte entry in this table. The first byte is the priority of the operator for expression evaluation and the next two are the address of the routine to perform the specified operation.

18502 $4846

Prints unimplemented command message

Disassembled code

BASIC 7.0 contains two unused keywords, QUIT and OFF.

Either of those will use this routine to print the UNIMPLEMENTED COMMAND error message.

18507 $484B

Table of BASIC error messages

Disassembled code

This area holds text for the BASIC error messages in error number order. Bit 7 in the last character of each message will be set to %1 to mark the end of the message.

Error number Error message
1/$01 TOO MANY FILES
2/$02 FILE OPEN
3/$03 FILE NOT OPEN
4/$04 FILE NOT FOUND
5/$05 DEVICE NOT PRESENT
6/$06 NOT INPUT FILE
7/$07 NOT OUTPUT FILE
8/$08 MISSING FILE NAME
9/$09 ILLEGAL DEVICE NUMBER
lO/$OA NEXT WITHOUT FOR
11/$OB SYNTAX
12/$OC RETURN WITHOUT GOSUB
13/$OD OUT OF DATA
14/$OE ILLEGAL QUANTITY
15/$OF OVERFLOW
16/$10 OUT OF MEMORY
17/$11 UNDEF’D STATEMENT
18/$12 BAD SUBSCRIPT
19/$13 REDIM’D ARRAY
20/$14 DIVISION BY ZERO
21/$15 ILLEGAL DIRECT
22/$16 TYPE MISMATCH
23/$17 STRING TOO LONG
24/$18 FILE DATA
25/$19 FORMULA TOO COMPLEX
26/$1A CAN’T CONTINUE
27/$1B UNDEF’D FUNCTION
28/$1C VERIFY
29/$1D LOAD
30/$1E BREAK
31/$1F CAN’T RESUME
32/$20 LOOP NOT FOUND
33/$21 LOOP WITHOUT DO
34/$22 DIRECT MODE ONLY
35/$23 NO GRAPHICS AREA
36/$24 BAD DISK
37/$25 BEND NOT FOUND
38/$26 LINE NUMBER TOO LARGE
39/$27 UNRESOLVED REFERENCE
40/$28 UNIMPLEMENTED COMMAND
41/$29 FILE READ

19074 $4A82

Sets pointer to error message

Disassembled code

Sets locations $26-$27 to point to the error number specified in the accmulator upon entry.

19103 $4A9F GONE

Main BASIC statement execution routine

Disassembled code

This routine handles COLLISION processing, then falls through into the next routine to execute the current BASIC statement.

19190 $4AF6 NEWSTT

Executes the next BASIC statement

Disassembled code

19381 $4BB5

Tests for RUN/STOP keypress

Disassembled code

This routine tests whether the RUN/STOP key is being pressed. If so, a branch will be taken into the following routine.

19403 $4BCB STOP/END

Handles the STOP and END statements

Disassembled code

19447 $4BF7

Handles the execution of function keywords

Disassembled code

19587 $4C83

Displays the SYNTAX ERROR message

Disassembled code

19590 $4C86 OR

Handles the OR logical operator

Disassembled code

19593 $4C89 AND

Handles the AND logical operator

Disassembled code

19638 $4CB6

Handles relational operators «, =, »

Disassembled code

19754 $4D2A

Prints the READY prompt

Disassembled code

19767 $4D37 READY

Enters MAIN with a READY prompt

Disassembled code

This routine is the normal path back to immediate mode after a program or previous immediate mode line has been executed. It prints the READY prompt and falls through into the MAIN routine.

19770 $4D3A

Displays an OUT OF MEMORY error message

Disassembled code

19772 $4D3C ERROR

Handles BASIC errors

19836 $4D7C

Prints a specified error message

19895 $4DB7 MAIN

Handles immediate mode and program line entry

19938 $4DE2

Adds or deletes BASIC program lines

20303 $4F4F LNKPRG

20371 $4F93

Reads a line of input into the buffer

20394 $4FAA

Searches for a particular token in the runtime stack

20478 $4FFE

Decrements the runtime stack pointer

20503 $5017

Checks for available string space

This routine tests whether there is sufficient space in the string pool before a string is added. If no space is available, garbage collection is attempted.

20569 $5059

Increments runtime stack pointer

20580 $5064 FNDLIN

Searches program text for a specified line number

20640 $50A0 LINGET

Creates integer value from a character string

This routine converts a string of characters at the current text pointer address into a two-byte integer value in locations $16-$17.

20706 $50E2 LIST

Handles the LIST statement

20771 $5123

Lists a single BASIC program line

20950 $51D6 NEW

Handles the NEW statement

20984 $51F8 CLR

Handles the CLR statement

21076 $5254

Resets the CHRGET text pointer

This routine resets the CHRGET text pointer, locations 61-62/ $3D-$3E, to the beginning of the BASIC text area.

21090 $5262 RETURN

Handles the RETURN statement

21135 $528F BEND/DATA

Handles the BEND and DATA statements

21149 $529D REM

Handles the REM statement

21189 $52C5 IF

Handles the IF statement

21280 $5320

Skips a BEGIN-BEND block

21393 $5391 ELSE

Handles the ELSE statement

21411 $53A3 ON

Handles the ON statement

21446 $53C6 LET

Handles variable value assignments

This routine evaluates the expression on the right of a relational operator and assigns the resulting value to the variable on the left.

21818 $553A PRINT#

Handles the PRINT# statement

21824 $5540 CMD

Handles the CMD statement

21844 $5554 PRINT

Handles the PRINT statement

22034 $5612 GET

Handles the GET statement (also GET# and GETKEY)

22088 $5648 INPUT#

Handles the INPUT# statement

22114 $5662 INPUT

Handles the INPUT statement

22185 $56A9 READ

Handles the READ statement

22474 $57CA

Moves the CHRGET text pointer to the next DATA statement

22516 $57F4 NEXT

Handles the NEXT statement

22648 $5878 DIM

Handles the DIM statement

22661 $5885 SYS

Handles the SYS statement

22708 $58B4 TRON/TROFF

Handles the TRON and TROFF statements

22717 $58BD RREG

Handles the RREG statement

22785 $5901 MID$

Handles MID$ when used as a statement

22901 $5975 AUTO

Handles the AUTO statement

22918 $5986 HELP

Handles the HELP statement

22956 $59AC

Highlights the portion of a listed line containing an error

22991 $59CF GOSUB

Handles the GOSUB statement

23003 $59DB GOTO

Handles the GOTO statement

23069 $5A1D

Places RETURN parameters in the runtime stack

23101 $5A3D GO

Handles the GO statement

Begins by testing whether the GO token is followed by the token for TO, indicating that GOTO was entered as GO TO. The acceptance of GO TO as a synonym for GOTO is unique to Commodore.

23136 $5A60 CONT

Handles the CONT statement

23169 $5A81

Sets flags for running a program

23195 $5A9B RUN

Handles the RUN statement

23242 $5ACA RESTORE

Handles the RESTORE statement

23280 $5AF0

Table of tokens for RENUMBER

23288 $5AF8 RENUMBER

Handles the RENUMBER statement

24057 $5DF9 FOR

Handles the FOR statement

24199 $5E87 DELETE

Handles the DELETE statement

24372 $5F34 PUDEF

Handles the PUDEF statement

24397 $5F4D TRAP

Handles the TRAP statement

24418 $5F62 RESUME

Handles the RESUME statement

24544 $5FE0 DO

Handles the DO statement

24633 $6039 EXIT

Handles the EXIT statement

24714 $608A LOOP

Handles the LOOP statement

24801 $60E1

Assigns a definition string to a programmable key

24842 $610A KEY

Handles the KEY statement

24989 $619D

Table of characters for KEY

25000 $61A8 PAINT

Handles the PAINT statement

25271 $62B7 BOX

Handles the BOX statement

25643 $642B SSHAPE

Handles the SSHAPE statement

25997 $658D GSHAPE

Handles the GSHAPE statement

26254 $668E CIRCLE

Handles the CIRCLE statement

26448 $6750 CIRSUB

Bitmapped graphics circle-drawing subroutine

26519 $6797 DRAW

Handles the DRAW statement

26583 $67D7 CHAR

Handles the CHAR statement

26965 $6955 LOCATE

Handles the LOCATE statement

26976 $6960 SCALE

Handles the SCALE statement

27096 $69D8

Table of scaling factors

27106 $69E2 COLOR

Handles the COLOR statement

27212 $6A4C

Table for translating VIC color values to VDC color values

27228 $6A5C

Calculates color fill values

27257 $6A79 SCNCLR

Handles the SCNCLR statement

27482 $6B5A GRAPHIC

Handles the GRAPHIC statement

27593 $6BC9 BANK

Handles the BANK statement

27607 $6BD7 SLEEP

Handles the SLEEP statement

27693 $6C2D WAIT

Handles the WAIT statement

27727 $6C4F SPRITE

Handles the SPRITE statement

27846 $6CC6 MOVSPR

Handles the MOVSPR statement

28129 $6DE1 PLAY

Handles the PLAY statement

This routine has many suboutines to handle parsing and execution of the strings of music data. PLAY is actually a minilanguage within BASIC.

28631 $6FD7 TEMPO

Handles the TEMPO statement

28644 $6FE4

Data tables for PLAY string processing

28689 $7011

Default values for ENVELOPE instrument tables

28742 $7046 FILTER

Handles the FILTER statement

28865 $70C1 ENVELOPE

Handles the ENVELOPE statement

29028 $7164 COLLISION

Handles the COLLISION statement

This routine sets up the conditions for COLLISION checking. The actual testing for collisions occurs during the BASIC IRQ routine $A84D.

29072 $7190 SPRCOLOR

Handles the SPRCOLOR statement

29110 $71B6 WIDTH

Handles the WIDTH statement

29125 $71C5 VOL

Handles the VOL statement

29164 $71EC SOUND

Handles the SOUND statement

29388 $72CC WINDOW

Handles the WINDOW statement

29493 $7335 BOOT

Handles the BOOT statement

If a filename is provided, the routine does the equivalent of BLOAD followed by SYS, rather than actually attempting to boot a disk.

29554 $7372 SPRDEF

Handles the SPRDEF statement

SPRDEF isn’t really a statement; it’s a built-in machine language sprite-design utility program.

30444 $76EC SPRSAV

Handles the SPRSAV statement

30643 $77B3 FAST

Handles the FAST statement

30660 $77C4 SLOW

Handles the SLOW statement

30679 $77D7

Evaluates an expression with a test for type mismatch

30703 $77EF FRMEVL

Evaluates an expression

30935 $78D7 EVAL

Evaluates a single term of a numeric expression

31084 $796C

Displays a SYNTAX ERROR message

31096 $7978

Evaluates a variable value

This routine is also responsible for processing all the BASIC reserved variables: TI, TI$, ST, DS, DS$, ER, and EL.

31407 $7AAF

Finds or creates a variable

This routine searches the variable table in bank 1 for a specified variable, and creates the variable if it does not already exist.

31632 $7B90

Creates an entry in the variable table for a new scalar variable

31846 $7C66

Moves arrays upward in bank 1 to make room for a new scalar variable

31915 $7CAB

Finds or creates an array variable

32386-32767 $7E82-$7FFF

This unused area of BASIC ROM is filled with the value 255/$FF.

32768 $8000 FRE

Handles the FRE function

32800 $8020

Prints designers’ message

When you use the statement SYS 32800,123,45,6, you’ll get a rather political message from the designers of the 128.

32842 $804A VAL

Handles the VAL function

32886 $8076 DEC

Handles the DEC function

32965 $80C5 PEEK

Handles the PEEK function

32997 $80E5 POKE

Handles the POKE statement

33014 $80F6 ERR$

Handles the ERR$ function

33090 $8142 HEX$

Handles the HEX$ function

33154 $8182 RGR

Handles the RGR function

33179 $819B RCLR

Handles the RCLR function

33283 $8203 JOY

Handles the JOY function

33357 $8240 POT

Handles the POT function

33454 $82AE PEN

Handles the PEN function

33530 $82FA POINTER

Handles the POINTER function

33566 $831E RSPRITE

Handles the RSPRITE function

33633 $8361 RSPCOLOR

Handles the RSPCOLOR function

33660 $837C BUMP

Handles the BUMP function

33687 $8397 RSPPOS

Handles the RSPPOS function

33761 $83E1 XOR

Handles the XOR function

33799 $8407 RWINDOW

Handles the RWINDOW function

33844 $8434 RND

Handles the RND function

33936 $8490

Table of floating-point constants for RND calculation

34000 $84D0 POS

Handles the POS function

34009 $84D9

Checks that BASIC is in run mode

34032 $84F0

Checks that BASIC is in immediate mode

34042 $84FA DEF

Handles the DEF statement

34107 $853B FN

Handles user-defined functions using FN

34222 $85AE STR$

Handles the STR$ function

34239 $85BF CHR$

Handles the CHR$ function

34262 $85D6 LEFT$

Handles the LEFT$ function

34314 $860A RIGHT$

Handles the RIGHT$ function

34332 $861C MID$

Handles the MID$ function

34408 $8668 LEN

Handles the LEN function

34423 $8677 ASC

Handles the ASC function

34437 $8685

Displays the ILLEGAL QUANTITY error message

34440 $8688

Creates space for a string in the string pool

34458 $869A

Stores a string in the string pool

34573 $870D

Performs string concatenation

34683 $877B

Evaluates a string parameter

This routine returns with locations $24-25 set to point to the string and the Y register holding the length of the string.

34801 $87F1

Evaluates a numeric expression

This routine evaluates a numeric parameter and checks that it is in the range 0-255/$00-$FF. If the parameter is valid, it will be returned in the X register.

34819 $8803

Evaluates parameters for POKE or WAIT

This routine retrieves a pair of parameters: The first, a value in the range 0-65535/$0000-$FFFF, will be returned in locations $16-$17, and the second, a value in the range 0-255/ $00-$FF, will be returned in the X register.

34831 $880F

Checks that the next character is a comma

34837 $8815

Evaluates a numeric parameter

This routine retrieves a numeric parameter, checking that it is in the range 0-65535/$0000-$FFFF. If the value is valid, it will be returned in locations $16-$17.

34862 $882E

Subtracts value in memory from FAC1

Loads FAC2 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte), then subtracts the value in FAC2 from the one in FAC1, leaving the results in FAC1.

34865 $8831

Subtracts FAC1 from FAC2

Subtracts the value in FAC2 from the one in FAC1, leaving the results in FAC1.

34885 $8845

Adds value in memory to FAC1

Loads FAC2 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte), then adds the value in FAC2 to the one in FAC1, leaving the results in FAC1.

34888 $8848

Adds FAC1 to FAC2

Adds the value in FAC2 to the one in FAC1, leaving the results in FAC1.

34993 $88B1

Normalizes FAC1

35110 $8926

Forms twos complement of FAC1

35165 $895D

Displays OVERFLOW error message

35170 $8962

Performs byte alignment of FAC1

35274 $89CA LOG

Handles the LOG function

35342 $8A0E

Adds 0.5 to FAC1

35364 $8A24

Multiplies value in memory by FAC1

Loads FAC2 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte), then multiplies the value in FAC2 by the one in FAC1, leaving the results in FAC1.

35367 $8A27

Multiplies value in memory by FAC1

Loads FAC2 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte), then multiplies the value in FAC2 by the one in FAC1, leaving the results in FAC1.

35465 $8A89

Loads FAC2 with value from the current bank

Loads FAC2 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte).

35508 $8AB4

Loads FAC2 with value from bank 1

Loads FAC2 with the five-byte floating-point value in bank 1 pointed to by the accumulator and Y register (low byte/high byte).

35607 $8B17

Multiplies FAC1 by 10

35640 $8B38

Divides FAC1 by 10

35657 $8B49

Divides value in memory by FAC1

Loads FAC2 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte), then divides the value in FAC2 by the one in FAC1, leaving the results in FAC1.

35660 $8B4C

Divides FAC2 by FAC1

Divides the value in FAC2 by the one in FAC1, leaving the results in FAC1.

35796 $8BD4

Loads FAC1 from memory

Loads FAC1 with the five-byte floating-point value pointed to by the accumulator and Y register (low byte/high byte).

35840 $8C00

Copies FAC1 value into memory

Stores the value in FAC1 in five bytes pointed to by the X and Y registers (low byte/high byte).

35880 $8C28

Copies FAC2 into FAC1

35896 $8C38

Copies FAC1 into FAC2

35911 $8C47

Rounds FAC1

35927 $8C57

Determines the sign of the value in FAC1

35941 $8C65 SGN

Handles the SGN function

35972 $8C84 ABS

Handles the ADS function

35975 $8C87

Compares FAC1 against FAC2

36039 $8CC7

Converts FAC1 to a four-byte integer

36091 $8CFB INT

Handles the INT function

36120 $8D18

Fills FAC1 with the value in the accumulator

36130 $8D22

Generates floating-point value representing character string

This routine reads a character string from BASIC program text and generates the equivalent floating-point value in FAC1.

36390 $8E26

Prints IN and a line number

36398 $8E2E

Prints a line number

This routine generates a string based on the value in $3B-$3C, then prints the results.

36418 $8E42

Generates a character string representing the value in FAC1

This routine generates a string of characters in the work area at 256/$0100 representing the value in FAC1.

36791 $8FB7 SQR

Handles the SQR function

This routine calculates the square root of the value in FAC1, taking advantage of the fact that SQR(X) = X ^ 0.5.

36801 $8FC1

Handles the exponentiation (^) operator

This routine raises the value in FAC1 to the power specified in FAC2. This routine takes advantage of the fact that A ^ B = EXP(LOG(A) * B).

36869 $9005

Table of floating-point constants for EXP evaluation

36915 $9033 EXP

Handles the EXP function

36998 $9086

Performs series evaluation

37080 $90D8

Calls the Kernal OPEN routine

37087 $90DF

Calls the Kernal BSOUT routine

37093 $90E5

Calls the Kernal BASIN routine

37117 $90FD

Calls the Kernal CHKIN routine

37129 $9109

Calls the Kernal GETIN routine

37138 $9112 SAVE

Handles the SAVE statement

37161 $9129 VERIFY

Handles the VERIFY statement

37164 $912C LOAD

Handles the LOAD statement

37261 $918D OPEN

Handles the OPEN statement

37274 $919A CLOSE

Handles the CLOSE statement

37294 $91AE

Evaluates parameters for SAVE, LOAD, and VERIFY

37366 $91F6

Evaluates parameters for OPEN and CLOSE

37433 9243

Clears DS$ after disk operations

37457 $9251

BASIC calls to Kernal routines

The subroutines in this area are BASIC’s formal calls to Kernal routines:

Address Routine
37457/$9251 READSS
37463/$9257 SETLFS
37469/$9250 SETNAM
37475/$9263 BASIN
37481/$9269 BSOUT
37487/$926F CLRCH
37493/$9275 CLOSE
37499/$927B CLALL
37505/$9281 PRIMM
37511/$9287 SETBANK
37517/$9280 PLOT
37523/$9293 STOP

37529 $9299

Creates space in the string pool for a temporary string

37610 $92EA GARBA2

Performs garbage collection on string pool

37897 $9409 COS

Handles the COS function

This routine takes advantage of the fact that COS(X) = SIN (X + $\pi$/2).

37904 $9410 SIN

Handles the SIN function

37977 $9459 TAN

Handles the TAN function

This routine takes advantage of the fact that TAN (X) = SIN(X) / COS(X).

38021 $9485

Table of constants for trig function evaluation

38067 $94B3 ATN

Handles the A TN function

38115 $94E3

Table of constants for trig function evaluation

38176 $9520 PRINT USING

Handles the PRINT USING statement

39361 $99C1 INSTR

Handles the INSTR function

39692 $9B0C RDOT

Handles the RDOT function

39728 $9B30 DRAWLN

Bitmapped graphics line-drawing routine

39931 $9BFB

Bitmapped point-plotting routine

40010 $9C4A

Scales graphics parameters

40366 $9DAE

Applies scaling factor to a specified parameter

40557 $9E6D

Evaluates graphics parameters

40712 $9F08

Handles relative graphics parameters

40783 $9F4F

Allocates the bitmapped graphics area

40903 $9FC7

Adjusts BASIC program pointers for graphics area allocation or de-allocation

40994 $A022

De-allocates the bitmapped graphics area

41076 $A074

Confirms that the graphics area has been allocated

41086 $A07E CATALOG/DIRECTORY

Handles the CATALOG and DIRECTORY statements

41245 $A11D DOPEN

Handles the DOPEN statement

41268 $A134 APPEND

Handles the APPEND statement

41303 $A157

Finds an available secondary address

41327 $A16F DCLOSE

Handles the DCLOSE statement

41347 $A183

Closes all open files for a specified device

41356 $A18C DSAVE

Handles the DSAVE statement

41380 $A1A4 DVERIFY

Handles the DVERIFY statement

41383 $A1A7 DLOAD

Handles the DLOAD statement

41416 $A1C8 BSAVE

Handles the BSAVE statement

41496 $A218 BLOAD

Handles the BLOAD statement

41575 $A267 HEADER

Handles the HEADER statement

41633 $A2A1 SCRATCH

Handles the SCRATCH statement

41687 $A2D7 RECORD

Handles the RECORD statement

41762 $A322 DCLEAR

Handles the DCLEAR statement

41775 $A32F COLLECT

Handles the COLLECT statement

41798 $A346 COPY

Handles the COPY statement

41826 $A362 CONCAT

Handles the CONCAT statement

41838 $A36E RENAME

Handles the RENAME statement

41852 $A37C BACKUP

Handles the BACKUP statement

41923 $A3C3

Evaluates parameters for disk commands

42535 $A627

Table of disk command templates

42599 $A667

Sets up disk command buffer

42872 $A778

Reads disk status string (DS$)

42977 $A7E1

Provides ARE YOU SURE query

43021 $A80D

Clears disk status string

43077 $A845

Switches to bank 15 configuration

43085 $A84D

BASIC IRQ service routine

This routine supports the MOVSPR sprite movement statement, the COLLISION statement, and the PEN function. It is also responsible for updating the duration timers for the SOUND and PLAY statements.

43504 $A9F0

Common exit point from BASIC IRQ routine

43551 $AA1F STASH

Handles the STASH statement

43556 $AA24 FETCH

Handles the FETCH statement

43561 $AA29 SWAP

Handles the SWAP statement

43630-44642 $AA6E-$AE62 Unused

All locations in this unused area of ROM are filled with the value 255/$FF.

44643-44799 $AE63-$AEFF

This area contains a heavily encoded message from the designers of the 128.