; ; Commodore Plus 4 specific constants and memory addresses ; .proff .cpu "6502" io .namespace .include "ted.asm" .virtual $ff00 ted .dstruct _ted .endvirtual .endnamespace BASIC_START = $1001 BTOK_SYS = $9e SCREEN_RAM = $0c00 ; =========================================================================== PDIR = $0000 ; 7501 on-chip data-direction register PORT = $0001 ; 7501 on-chip 8-bit Input/Output register SRCHTK = $0002 ; Token 'search' looks for (run-time stack) ZPVEC1 = $0003 ; Temp (renumber) ZPVEC2 = $0005 ; Temp (renumber) CHARAC = $0007 ; Search character ENDCHR = $0008 ; Flag: scan for quote at end of string TRMPOS = $0009 ; Screen column from last TAB VERCK = $000A ; Flag: 0 = load 1 - verify COUNT = $000B ; Input buffer pointer / No. of subsctipts DIMFLG = $000C ; Flag: Default Array DIMension VALTYP = $000D ; Data type: $FF = string $00 = numeric INTFLG = $000E ; Data type: $80 = integer, $00 = floating DORES = $000F ; Flag: DATA scan/LIST quote/garbage coll SUBFLG = $0010 ; Flag: subscript ref / user function coll INPFLG = $0011 ; Flag: $00 = INPUT, $43 = GET, $98 = READ TANSGN = $0012 ; Flag TAN siqn / comparison result CHANNL = $0013 ; Flag: INPUT prompt LINNUM = $0014 ; Temp: integer value TEMPPT = $0016 ; Pointer: temporary string stack LASTPT = $0317 ; Last temp string address TEMPST = $0019 ; Stack for temporary strings INDEX1 = $0022 ; Utility pointer area INDEX2 = $0024 ; Utility pointer area RESHO = $0026 ; RESMOH = $0027 ; RESMO = $0028 ; RESLO = $0029 ; TXTTAB = $002B ; Pointer: start of BASIC text VARTAB = $002D ; Pointer: start of BASIC variables ARYTAB = $002E ; Pointer: start of BASIC arrays STREND = $0031 ; Pointer: end of BASIC arrays (+1) FRFTOP = $0033 ; Pointer: bottom of string storage FRESPC = $0035 ; Utility string pointer MEMSIZ = $0037 ; Pointer: highest address used by BASIC CURLIN = $0039 ; Current BASIC line number TXTPTR = $003B ; FNDPNT = $003D ; DATLIN = $003F ; Current DATA line number DATPTR = $0041 ; Pointer: Current DATA item address INPPTR = $0043 ; Vector: INPUT routine VARNAM = $0045 ; Current BASIC variable name VARPNT = $0047 ; Pointer: Current BASIC variable data FORPNT = $0049 ; Pointer: Index variable for FOR/NEXT OPPTR = $0048 ; OPMASK = $004D ; DEFPNT = $004E ; DSCPNT = $0050 ; HELPER = $0053 ; JMPER = $0054 ; SIZE = $0055 ; OLDOV = $0056 ; TEMPF1 = $0057 ; HIGHDS = $0058 ; HIGHTR = $005A ; LOWDS = $005D ; LoWTR = $005F ; EXPSGN = $0060 ; FACEXP = $0061 ; Floating-point accumulator #1: exponent FACHO = $0062 ; Floating accum. #1: mantissa FACMOH = $0063 ; FACMO = $0064 ; FACLo = $0065 ; FACSGN = $0066 ; Floating accum. #1: sign SGNFLG = $0067 ; Pointer: series evaluation constant BITS = $0068 ; Floating accum. #1: overflow digit ARGEXP = $0069 ; Floating-point accumulator #2: exponent ARGHO = $006A ; Floating accum. #2: mantissa ARGMOH = $006B ; ARGMO = $006C ; ARGLO = $006D ; ARGSGN = $006E ; Floating accum. #2: sign ARISGN = $006F ; Sign comparison result: accum. #1 vs #2 FACOV = $0070 ; Floating accum. #1. low-order (rounding) FBUFPT = $0071 ; Pointer: cassette buffer AUTINC = $0073 ; Increment value for auto (0 = off) MVDFLG = $0075 ; Flag if 10K hires allocated KEYNUM = $0076 ; KEYSIZ = $0077 ; SYNTMP = $0078 ; Used as temp Eor indirect loads DSDESC = $0079 ; Descriptor for DSS TOS = $007C ; Top of run time stack TMPTON = $007E ; Temps used by music (tone & volume) VOICNO = $0080 ; RUNMOD = $0081 ; POINT = $0082 ; GRAPHM = $0083 ; Current graphic mode COLSEL = $0084 ; Current color selected MC1 = $0085 ; Multicolor 1 FG = $0086 ; Foreground color SCXMAX = $0087 ; Maximum # of columns SCYMAX = $0088 ; Maximum # of rows LTFLAG = $0089 ; Paint-left flag RTFLAG = $008A ; Paint-Right flag STOPNH = $008B ; Stop paint if not BG (Not same Color) GRAPNT = $008C ; VTEMP1 = $008E ; VTEMP2 = $008F ; STATUS = $0090 ; Kernal I/O status word: ST STREY = $0091 ; Flag: STOP key / RVS key SPVERR = $0092 ; Temp VERFCK = $0093 ; Flag: 0 = load, 1 = verify C3PO = $0094 ; Plag: serial bus - output char buffered BSOUR = $0095 ; Buffered character for serial bus XSAV = $0096 ; Temp for basin LDTND = $0097 ; # of open files / index to file table DFLTN = $0098 ; Default input device (0) DFLTO = $0099 ; Default output (CMD) device (3) MSGFLG = $009A ; Flag: $80 = direct mode $00 = program SAL = $009B ; Tape pass 1 error log SAH = $009C ; Tape pass 2 error log EAL = $009D ; EAH = $009E ; T1 = $009F ; Temp data area T2 = $00A1 ; Temp data area TIME = $00A3 ; Real-time jiffy clock (approx) 1/60 sec R2D2 = $00A6 ; Serial bus usage (EOI on output) TPBYTE = $00A7 ; Byte to be written/read on/off tape BSOUR1 = $00A8 ; Temp used by serial routine FPVERR = $00A9 ; DCOUNT = $00AA ; FNLEN = $00A8 ; Length of current file name LA = $00AC ; Current logical fiie number SA = $00AD ; Current seconda.y address FA = $00AE ; Current device number FNADR = $00AF ; Pointer: current file name ERRSUM = $00B1 ; STAL = $00B2 ; I/O start address STAH = $00B3 ; MEMUSS = $00B4 ; Load ram base TAPEBS = $00B6 ; Base pointer to cassette base TMP2 = $00B8 ; WRBASE = $00BA ; Pointer to data for tape writes IMPARM = $00BC ; Pointer to immediate string for primms FETPTR = $00BE ; Pointer to byte to be fetched in bank fetc SEDSAL = $00C0 ; Temp for scrolling RVS = $00C2 ; RVS field flag on INDX = $00C3 ; LSXP = $00C4 ; X position at start LSTP = $00C5 ; SFDX = $00C6 ; Flag: shift mode for print CRSW = $00C7 ; Flag: INPUT or GET from keyboard PNT = $00C8 ; Pointer: current screen line address PNTR = $00CA ; Cursor column on current line QTSW = $00CB ; Flag: editor in quote mode, $00 = no SEDT1 = $00CC ; Editor temp use TBLX = $00CD ; Current cursor physical line number DATAX = $00CE ; Temp data area INSRT = $00CF ; Flag: insert mode, >0 = # INSTs CIRSEG = $00E9 ; Screen line link table / editor temps USER = $00EA ; Screen editor color IP KEYTAB = $00EC ; Key scan table indirect TMPKEY = $00EE ; NDX = $00EF ; Index to keyboard queue STPFLG = $00F0 ; Pause flag TO = $00F1 ; Monitor ZP storage CHRPTR = $00F3 ; BUFEND = $00F4 ; CHKSUM = $00F5 ; Temp for checksum calculation LENGTH = $00F6 ; PASS = $00F7 ; Which pass we are doing str TYPE = $00F8 ; Type of block USE4DY = $00F9 ; (B.7 = 1)=> for wr, (B.6 = 1)=> for rd XSTOP = $00FA ; Save xreg for quick stopkey test CURBNK = $00FB ; Current bank configuration XoN = $00FC ; Char to send for a x-on (RS232) XoFF = $00FD ; Char to send for a x-off (RS232) SEDT2 = $00FE ; Editor temporary use LOFBUF = $00FF ; FBUFFR = $0100 ; SAVEA = $0110 ; Temp Locations for SAVEY = $0111 ; ... for Save and SAVEX = $0112 ; ... Restore COLKEY = $0113 ; Color/luminance table in RAM SYSSTK = $0124 ; System stack BUF = $0200 ; Basic/monitor input buffer OLDLIN = $0259 ; Basic storage OLDTXT = $025B ; Basic storage XCNT = $025D ; DOS loop counter PNBUFR = $025E ; Area for filename DOSF1L = $026E ; DOS filename 1 length DOSDS1 = $026F ; DOS disk drive 1 DOSF1A = $0270 ; DOS filename 1 addr DOSF2L = $0272 ; DOS filename 2 length DOSDS2 = $0273 ; DOS disk drive 2 DOSF2A = $0274 ; DOS filename 2 addr DOSLA = $0276 ; DOS logical address DOSEA = $0277 ; DOS phys addr DOSSA = $0278 ; DOS secordary address DOSDID = $0279 ; DOS disk identifier DIDCHK = $0278 ; DOS DID flag DOSSTR = $027C ; DOS output string buffer DOSSPC = $027D ; Area used to build DOS string XPOS = $02AD ; Current x position YPOS = $02AE ; Current y position XDEST = $02B1 ; X coordinate destination YDEST = $02B3 ; Y coordinate destination XABS = $02B5 ; YABS = $02B7 ; XSGN = $02B9 ; YSGN = $02BB ; FCT1 = $02BD ; FCT2 = $02BF ; ERRVAL = $02C1 ; LESSER = $02C3 ; GREATR = $02C4 ; ANGSGN = $02C5 ; Sign of angle SINVAL = $02C6 ; Sine of value of angle COSVAL = $02C8 ; Cosine of value of angle ANGCNT = $02CA ; Temps for angle distance routines BNR = $02CD ; Pointer to begin no. ENR = $02CE ; Pointer to end no. DOLR = $02CF ; Dollar flag FLAG = $02D0 ; Comma flag SWE = $02D1 ; Counter USGN = $02D2 ; Sign exponent UEXP = $02D3 ; Pointer to exponent VN = $02D4 ; # of digits before decimal point CHSN = $02D5 ; Justify flag VF = $02D6 ; # of pos before decimal point (field) NF = $02D7 ; # of pos after decimal point (field) POSP = $02D8 ; +/- flag (field) FESP = $02D9 ; Exponent flag (field) ETOF = $02DA ; Switch CFORM = $02D8 ; Char counter (field) SNO = $02DC ; Sign no. BLFD = $02DD ; Blank/star flag BEGFD = $02DE ; Pointer to beginning of field LFOR = $02DF ; Length of format ENDFD = $02E0 ; Pointer to end of field XCENTR = $02CC YCENTR = $02CE XDIST1 = $02D0 YDIST1 = $02D2 XDIST2 = $02D4 YDIST2 = $02D6 COLCNT = $02DA ; Characters column counter ROWCNT = $02DB ; Characters row counter STRCNT = $02DC XCORD1 = $02CC YCORD1 = $02CE BOXANG = $02D0 ; Rotation angle XCOUNT = $02D2 YCOUNT = $02D4 BXLENG = $02D6 ; Length of a side XCORD2 = $02D8 YCORD2 = $02DA XCIRCL = $02CC ; Circle center, x coordinate YCIRCL = $02CE ; Circle center, y coordinate XRADUS = $02D0 ; X radius YRADUS = $02D2 ; Y radius ROTANG = $02D4 ; Rotation angle ANGBEG = $02D8 ; Arc angle start ANGEND = $02DA ; Arc angle end XRCOS = $02DC ; X radius * cos (rotation angle) YRSIN = $02DE ; Y radius * sin (rotation angle) XRSIN = $02E0 ; X radius * sin (rotation angle) YRCOS = $02E2 ; Y radius * cos (rotation angle) KEYLEN = $02CD KEYNXT = $02CE STRS2 = $02CE ; String length GETTYP = $02D0 ; Replace string mode STRPTR = $02D1 ; String position counter OLDBYT = $02D2 ; Old bit map byte NEWBYT = $02D3 ; New string or bit map byte XSIZE = $02D5 ; Shape column length YSIZE = $02D7 ; Shape row length XSAVE = $02D9 ; Temp for column length STRADR = $02D8 ; Save shape string descriptor BITIDX = $02DD ; Bit index into byte SAYSIZ = $02DE ; Temporary work locations CHRPAG = $02E4 ; High byte addr of char ROM for char cmd LITCNT = $02E5 ; Temp for gshape SCALEM = $02E6 ; Scale mode flag WIDTH = $02E7 ; Double width flag FILFLG = $02E8 ; Box fill flag BITMSK = $02E9 ; Temp for bit mask NUMCNT = $02EA TRCFLG = $02EB ; Flags trace mode T3 = $02EC T4 = $02ED VTEMP3 = $02EF ; Graphic temp storage VTEMP4 = $02F0 VTEMP5 = $02F1 ADRAY1 = $02E2 ; Ptr to routine: convert float to integer ADRAY2 = $02F4 ; Ptr to routine: convert integer to float BNKVEC = $02FE ; Vector for function cartridge users IERROR = $0300 ; Indirect Error (Output Error in .X) IMAIN = $0302 ; Indirect Main (System Direct Loop) ICRNCH = $0304 ; Indirect Crunch (Tokenization Routine) IOPLOP = $0306 ; Indirect List (Char List) IGONE = $0308 ; Indirect Gone (Character Dispatch) IEVAL = $030A ; Indirect Eval (Symbol Evaluation) IESCLK = $030C ; Escape token crunch IESCPR = $030E ; IESCEX = $0310 ; ITIME = $0312 ; CINV = $0314 ; IRQ Ram Vector CBINV = $0316 ; BRK Instr RAM Vector IOPEN = $0318 ; Indirects for Code ICLOSE = $031A ; ICHKIN = $031C ; ICKOUT = $031E ; ICLRCH = $0320 ; IBASIN = $0322 ; IBSOUT = $0324 ; ISTOP = $0326 ; IGETIN = $0328 ; ICLALL = $032A ; USRCMD = $032C ; ILOAD = $032E ; ISAVE = $0330 ; Savesp TAPBUF = $0333 ; Cassette tape buffer WRLEN = $03F3 ; Length of data to be written to tape RDCNT = $03F5 ; Length of data to be read from tape INPQUE = $03F7 ; RS-232 input queue ESTARL = $0437 ESTAKH = $0455 CHRGET = $0473 CHRGOT = $0479 QNUM = $0485 INDSUB = $0494 ; Shared ROM fetch sub ZERO = $04A2 ; Numeric constant for Basic INDTXT = $04A5 ; Txtptr INDIN1 = $04B0 ; Index & Index1 INDIN2 = $04BB ; Index2 INDST1 = $04C6 ; Strng1 INDLOW = $04D1 ; Lowtr INDFMO = $04DC ; Facmo PUFILL = $04E7 ; Print using fill symbol [space] PUCOMA = $04E8 ; Print using comma symbol [;] PUDOT = $04E9 ; Print using D.P. symbol [.] PUMONY = $04EA ; Print using monetary symbol [$] TMPDES = $04EB ; Temp for instr ERRNUM = $04EF ; Last error number ERRLIN = $04F0 ; Line # of last error TRAPNO = $04F2 ; Line to go on error TMPTRP = $04F4 ; Hold trap no. temporarily ERRTXT = $04F5 OLDSTR = $04F7 TMPTXT = $04F8 TMPLIN = $04FA MTIMLO = $04FC ; Table of pending jiffies (2's comp) MTIMHI = $04FE USRPOK = $0500 KERNDX = $0503 DEJAVU = $0508 ; 'cold' or 'warm' start status LAT = $0509 ; Logical file numbers FAT = $0513 ; Primary device numbers SAT = $051D ; Secondary addresses KEYD = $0527 ; IRQ keyboard buffer MEMSTR = $0531 ; Start of memory [1000] MSIZ = $0533 ; Top of memory [FD00] TIMOUT = $0535 ; IEEE timeout flag FILEND = $0536 ; File end reached = 1, 0 otherwise CTALLY = $0537 ; # of chars left in buffer (for R & W) CBUFVA = $0538 ; # of total valid chars in buffer (R) TPTR = $0539 ; Ptr to next char in buffer (for R & W) FLTYPE = $053A ; Contains type of current cass file COLOR = $053B ; Active attribute byte FLASH = $053C ; Character flash flag HIBASE = $053E ; OC Base location of screen (top) [0C] XMAX = $053F ; RPTFLG = $0540 ; Key repeat flag KOUUT = $0541 ; DELAY = $0542 ; SHFLAG = $0543 ; Shift flag byte LSTSHF = $0544 ; Last shift pattern KEYLOG = $0545 ; Indirect for keyboard table setup MODE = $0547 ; shift, C= AUTODN = $0548 ; Auto scroll down flag (0=on,0off) LINTMP = $0549 ROLFLG = $054A FORMAT = $054B ; Monitor non-zpage storage MSAL = $054C WRAP = $054F TMPC = $0550 DIFF = $0551 PCH = $0552 PCL = $0553 FLGS = $0554 ACC = $0555 XR = $0556 YR = $0557 SP = $0558 INYL = $0559 INVH = $055A CMPFLG = $055B ; Used by various monitor routines BAD = $055C KYNDX = $055D ; Used for programmable keys KEYIDX = $055E ; KEYBUF = $055F ; Table of P.F. lengths PKY9UF = $0567 ; P.F. Key storage area KDATA = $05E7 ; Temp for data write to kennedy RDYCMD = $05E8 ; Select for kennedy read or write KDYNUM = $05E9 ; Kennedy's dev # RDYPRS = $05EA ; Rennedy present = $ff, else = $00 KDYTYP = $05EB ; Temp for type of open for kennedy SAVRAM = $05EC ; 1 page used by banking routines PAT = $05EC ; Physical Address Table LNGJMP = $05F0 ; Long jump address FETARG = $05F2 ; Long jump accumulator FETXRG = $05F3 ; Long jump x register FETSRG = $05F4 ; Long jump status register AREAS = $05F5 ; RAM areas for banking ASPECH = $065E ; RAM area for speech STKTOP = $06EC ; BASIC run-time stack WROUT = $07B0 ; Byte to be written on tape PARITY = $07B1 ; Temp for parity calc TT1 = $07B2 ; Temp for write-header TT2 = $07B3 ; Temp for write-header RDBITS = $07B5 ; Local index for READBYTE routine ERRSP = $07B6 ; Pointer into the error stack FPERRS = $07B7 ; Number of first pass errors DSAMP1 = $07B8 ; Time constant DSAMP2 = $07BA ; Time constant ZCELL = $07BC ; Time constant SRECOV = $07BE ; Stack marker for stopkey recover DRECOV = $07BF ; Stack marker for dropkey recover TRSAVE = $07C0 ; params passed to RDBLOK RDETMP = $07C4 ; Temp stat save for RDBLOK LDRSCN = $07C5 ; # consec shorts to find in leader CDERRM = $07C6 ; # Errors fatal in RD countdown VSAVE = $07C7 ; Temp for Verify command T1PIPE = $07C8 ; Pipe temp for T1 ENEXT = $07CC ; Read error propagate UOUTQ = $07CD ; User chracter to send UOUTFG = $07CE ; 0 = empty ; 1 = full SOUT9 = $07CF ; System character to send SOUNFG = $07D0 ; 0 = empty ; 1 = full INOFPT = $07D1 ; Pntr to front of input queue INQRPT = $07D2 ; Pntr to rear of input queue INQCNT = $07D3 ; # of chars in input queue ASTAT = $07D4 ; Temp status for ACIA AINTMP = $07D5 ; Temp for input routine ALSTOP = $07D6 ; FLG for local pause ARSTOP = $07D7 ; FLG for remote pause APRES = $07D8 ; FLG to indicate presence of ACIA RLUDES = $07D9 ; Indirect routine downloaded SCBOT = $07E5 ; Screen bottom (0...24) SCTOP = $07E6 ; Screen top SCLF = $07E7 ; Screen left (0...39) SCRT = $07E8 ; Screen right SCRDIS = $07E9 ; Negative = scroll out INSFLG = $07EA ; Insert mode: FF = on, 00 = off LSTCHR = $07EB LOGSCR = $07EC TCOLOR = $07ED BITABL = $07EE SAREG = $07F2 ; Registers for SYS command SXREG = $07F3 SYREG = $07F4 SPREG = $07F5 LSTX = $07F6 ; Key scan index STPDSB = $07F7 ; Flag to disable CTRL-S pause RAMROM = $07F8 ; MSB for monitor fetches from ROM=0;RAM=1 COLSW = $07F9 ; MSB for color/lim table in RAM=0;ROM=1 FFRMSK = $07FA ; ROM mask for split screen VMBMSK = $07FB ; VM base mask for split screen LSEM = $07FC ; Motor lock semaphore for cassette PALCNT = $07FD ; PAL tod TEDATR = $0800 ; TED attribute bytes TEDSCN = $0C00 ; TED character pointers BASBGN = $1000 ; Start of BASIC text area BMLUM = $1800 ; Luminance for bit map screen BMCOLR = $1C00 ; Color for bit map ; KERNAL JUMP TABLE CINT = $ff81 ; Initialize screen editor IOINIT = $ff84 ; Initialize I/O devices RAMTAS = $ff87 ; Ram test RESTOR = $ff8a ; Restore vectors to initial values VECTOR = $ff8d ; Change vectors for user SETMSG = $ff90 ; Control O.S. messages SECND = $ff93 ; Send SA after LISTEN TKSA = $ff96 ; Send SA after TALK MEMTOP = $ff99 ; Set/Read top of memory MEMBOT = $ff9c ; Set/Read bottom of memory SCNKEY = $ff9f ; Scan keyboard SETTMO = $ffa2 ; Set timeout in DMA disk ACPTR = $ffa5 ; Handshake serial bus or DMA disk byte in CIoUT = $ffa8 ; Handshake serial bus or DMA disk byte out UNTLR = $ffab ; Send UNTALK out serial bus or DMA disk UNLSN = $ffae ; Send UNLISTEN out serial bus or DMA disk LISTN = $ffb1 ; Send LISTEN out serial bus or DMA disk TALK = $ffb4 ; Send TALK out serial bus or DMA disk READST = $ffb7 ; Return I/O STATUS byte SETLFS = $ffba ; Set LA, FA, SA SETNAM = $ffbd ; Set length and FN address OPEN = $ffc0 ; Open logical file CLOSE = $ffc3 ; Close logical file CHKIN = $ffc6 ; Open channel in CHOUT = $ffc9 ; open channel out CLRCHN = $ffcc ; Close I/O channels BASIN = $ffcf ; Input from channel CHRIN = BASIN BSOUT = $ffd2 ; output to channel CHROUT = BSOUT LOADSP = $ffd5 ; Load from file SAYESP = $ffd8 ; Save to file SETTIM = $ffdb ; Set internal clock RDTIM = $ffde ; Read internal clock STOP = $ffe1 ; Scan STOP key GETIN = $ffe4 ; Get character from queue CLALL = $ffe7 ; Close all files UDTIM = $ffea ; Increment clock SCRORG = $ffed ; Screen org. PLOT = $fff0 ; Read/Set X,Y coord of cursor IOBASE = $fff3 ; Return location of start of I/O .pron ; vim: syntax=64tass