1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-13 12:29:49 +00:00
6502bench/SourceGen/RuntimeData/Apple/Applesoft.sym65

163 lines
4.0 KiB
Plaintext
Raw Normal View History

2018-09-28 17:05:11 +00:00
; Copyright 2018 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
;
; Sources:
; What's Where in the Apple, by William F. Luebbert
*SYNOPSIS Applesoft BASIC addresses and constants
HCOLOR1 @ $1C ;hi-res color mask
COUNTH @ $1D ;hi-res high-order byte of step for line
HBASL @ $26 ;base address for hi-res drawing
RNDL @ $4E ;low byte of KEYIN "random" value
RNDH @ $4F ;high byte of KEYIN "random" value
2018-09-28 17:05:11 +00:00
LINNUM @ $50 ;line number ($50-51)
TEXTTAB @ $67 ;pointer to start of Applesoft program (2b)
VARTAB @ $69 ;pointer to start of Applesoft variables (2b)
ARYTAB @ $6B ;pointer to start of Applesoft array space (2b)
STREND @ $6D ;pointer to end of numeric storage (2b)
FRETOP @ $6F ;pointer to end of string storage (2b)
MEMSIZE @ $73 ;Applesoft HIMEM (2b)
CURLIN @ $75 ;Applesoft current line number (2b)
2018-09-28 17:05:11 +00:00
FACMO @ $A0 ;middle-order byte of mantissa of FAC
FACLO @ $A1 ;low-order byte of mantissa of FAC
FACSIGN @ $A2 ;single byte sign of FAC
CHRGET @ $B1 ;get next character or Applesoft token
CHRGOT @ $B7 ;get next, but don't advance TXTPTR
TXTPTR @ $B8 ;points at next char or token
AUTORUN @ $D6 ;set to $80 to auto-run
ERRFLG @ $D8 ;$80 if onerr active
HPAG @ $E6 ;hi-res page to draw on ($20 or $40)
SCALE @ $E7 ;hi-res graphics scale factor
AMPERV @ $03F5 ;JMP to function that handles Applesoft '&' cmds
2018-09-28 17:05:11 +00:00
;
; Useful Applesoft routines.
; TODO: there are many more
;
ERROR @ $D412 ;print error based on X-reg
FRMNUM @ $DD67 ;evalute expression at TXTPTR, result into FAC
SYN_ERROR @ $DEC9 ;throw SYNTAX ERROR
CHKCOM @ $DEBE ;checks TXTPTR for comma
ILLQ_ERROR @ $E199 ;throw ILLEGAL QUANTITY ERROR
GETADR @ $E752 ;convert FAC to 2-byte integer in LINNUM
GETBYT @ $E6F8 ;gets byte, in X/FACLO
HFNS @ $F6B9 ;get hi-res x/y for hplot
;
; Applesoft BASIC tokens.
;
*TAG Applesoft-Tokens
2018-10-09 01:03:04 +00:00
TOK_END = $80
TOK_FOR = $81
TOK_NEXT = $82
TOK_DATA = $83
TOK_INPUT = $84
TOK_DEL = $85
TOK_DIM = $86
TOK_READ = $87
TOK_GR = $88
TOK_TEXT = $89
TOK_PR = $8a
TOK_IN = $8b
TOK_CALL = $8c
2018-09-28 17:05:11 +00:00
TOK_PLOT = $8d
2018-10-09 01:03:04 +00:00
TOK_HLIN = $8e
TOK_VLIN = $8f
2018-09-28 17:05:11 +00:00
TOK_HGR2 = $90
TOK_HGR = $91
TOK_HCOLOR = $92
TOK_HPLOT = $93
TOK_DRAW = $94
TOK_XDRAW = $95
2018-10-09 01:03:04 +00:00
TOK_HTAB = $96
TOK_HOME = $97
TOK_ROT = $98
TOK_SCALE = $99
TOK_SHLOAD = $9a
TOK_TRACE = $9b
TOK_NOTRACE = $9c
TOK_NORMAL = $9d
2018-09-28 17:05:11 +00:00
TOK_INVERSE = $9e
2018-10-09 01:03:04 +00:00
TOK_FLASH = $9f
TOK_COLOR = $a0
TOK_POP = $a1
TOK_VTAB = $a2
TOK_HIMEM = $a3
TOK_LOMEM = $a4
TOK_ONERR = $a5
TOK_RESUME = $a6
TOK_RECALL = $a7
TOK_STORE = $a8
TOK_SPEED = $a9
TOK_LET = $aa
TOK_GOTO = $ab
TOK_RUN = $ac
TOK_IF = $ad
TOK_RESTORE = $ae
TOK_AMPER = $af
TOK_GOSUB = $b0
TOK_RETURN = $b1
TOK_REM = $b2
TOK_STOP = $b3
TOK_ON = $b4
TOK_WAIT = $b5
TOK_LOAD = $b6
TOK_SAVE = $b7
TOK_DEF = $b8
TOK_POKE = $b9
TOK_PRINT = $ba
TOK_CONT = $bb
TOK_LIST = $bc
2018-09-28 17:05:11 +00:00
TOK_CLEAR = $bd
2018-10-09 01:03:04 +00:00
TOK_GET = $be
2018-09-28 17:05:11 +00:00
TOK_NEW = $bf
2018-10-09 01:03:04 +00:00
TOK_TAB = $c0
2018-09-28 17:05:11 +00:00
TOK_TO = $c1
2018-10-09 01:03:04 +00:00
TOK_FN = $c2
TOK_SPC = $c3
TOK_THEN = $c4
2018-09-28 17:05:11 +00:00
TOK_AT = $c5
2018-10-09 01:03:04 +00:00
TOK_NOT = $c6
TOK_STEP = $c7
TOK_PLUS = $c8
TOK_MINUS = $c9
TOK_MULT = $ca
TOK_DIV = $cb
TOK_EXPOP = $cc
TOK_AND = $cd
TOK_OR = $ce
TOK_GREATER = $cf
TOK_EQUAL = $d0
TOK_LESSER = $d1
2018-09-28 17:05:11 +00:00
TOK_SGN = $d2
2018-10-09 01:03:04 +00:00
TOK_INT = $d3
TOK_ABS = $d4
TOK_USR = $d5
TOK_FRE = $d6
2018-09-28 17:05:11 +00:00
TOK_SCRN = $d7
2018-10-09 01:03:04 +00:00
TOK_PDL = $d8
TOK_POS = $d9
TOK_SQR = $da
TOK_RND = $db
TOK_LOG = $dc
2018-09-28 17:05:11 +00:00
TOK_EXP = $dd
TOK_COS = $de
TOK_SIN = $df
2018-10-09 01:03:04 +00:00
TOK_TAN = $e0
TOK_ATN = $e1
TOK_PEEK = $e2
TOK_LEN = $e3
TOK_STR = $e4
TOK_VAL = $e5
TOK_ASC = $e6
TOK_CHR = $e7
TOK_LEFT = $e8
TOK_RIGHT = $e9
TOK_MID = $ea
; end of tokens