Overview

Index
O.S. Map
RAM
TED & Music
PETSCII codes
Graphic modes
Bugs
I-O tables
Disk drives
HW
BASIC
EDIT
Credits


Sheet 1: Index

















The Ultimate Plus/4 map




by S\_/S of [FIRE] crew

Release 2.1 (2020)





svs.fire@gmail.com






















































Disclaimer: I did all my best to avoid any bug or mistake, but I cannot warrant the reliability of the data described in this document. Thus there is no liability.























SUMMARY














(click over a title to jump in)














































O.S. map Banking routines














ACIA chip













RAM map SPI 6529B

Zero page











TIA 6523A

Stack (page 1)










TED Registers & Music TED area address

Banking routines
TED <--> VIC-II comparison









Kernal jump table



ROM/RAM selection








Graphic modes tables and info

Text mode

Music frequency formula











Text multicolor mode

Music notes table








Bugs of O.S. and Drive DOS

Extended color mode

System frequencies











Bitmap HiRes mode











I/O tables

Bitmap Multicolor mode


STatus Register values after an I/O operation










Colors table (and RGB)


I/O Errors codes of Kernal and Monitor







Disk drives 1541 RAM map
Bitmap for Basic


CBM Peripheral device codenames and features








1551 RAM map
Screen layout of Bitmap


Keyboard matrix table and working







Credits 1581 RAM map
CHAR special modes


Plus/4 and C64 keyboards camparison








Jump table of drives' DOS




RS-232 Registers and settings







PETSCII codes Jobs execution and programming



PET-ASCII table









Exit codes of DOS after a job



Screen codes








Special tools Command codes of drives' DOS



Search for the screen code of a character









DOS errors



Search for the PETSCII code of a character



Arrays calculator



Hardware Disk surface map



CBM characters fonts



DEC <--> HEX$ calculator




Master tracks maps







Screen attributes coder/decoder




BASIC Use of RAM

Bus timing table











Basic line struct.

Userport










Editing Variables/Arrays

CPU Speed
Editor









Keywords /tokens

Expansion port
ESC codes









V364 words table



MONITOR commands









Program'ng Tricks














Errors














Sheet 2: O.S. Map

The ultimate Plus/4 ROM & chips map
WARNING. There were more versions of C16/Plus4 O.S., then some addresses, routines or data could result different.
Release 2.1
























Category Address(es) C=Command, T=Table/data, *=In all banks Label Input Output Notes









Description Bits ---> 7 6 5 4 3 2 1 0
BASIC 8000 (O.S. ROM or banked cartridge)
BASIC cold-start


JMP $8019 - If a cartridge is connected: Entry point of exec code








BASIC 8003 C Warm start / Monitor "X" command


JMP $800A - If a cartridge is connected: Entry point for warm start








BASIC 8006 T ROM/Cartridge identification code
$00 = Never; $01 = Immediately; $10…$FF = Later (i.e. when press a funct. key)
If a cartridge is connected: Desired Start Mode (use $10 or following if you want to show it in the screen message)








BASIC 8007-8009 T CBM identifier marks
$43 $42 $4C
ASCII = "CBM" ($43 $42 $4D) in cartridge too.








BASIC 800A
Basic warm-start


JSR $FFCC…









800D
Store current I/O prompt

save to $13









BASIC 8019
BASIC setup: initialize vectors












O.S. 8020
Shows list of connected ROMs


JSR $8117








BASIC 802A
Vectors for conversions integer /FP


Contain: $98 $71 $94 $71 for storing in RAM $02F2…








BASIC 802E
Initialize BASIC INIT











O.S. 804A
System copies to RAM the code of CHRGET / CHRGOT routines

$7FFF is overwrited (by the bank #?)









O.S. 8062
Clear lenght of Cassette buffer, and T3 T4 area in zeropage RAM












O.S. 8090
Set charater ROM hibyte address as $D0












O.S. 807A
Set multicolor color1 as $36












BASIC 80C2
Print BASIC power on message MSGTBL











BASIC 80CC-80E4 T Power on message


"COMMODORE BASIC V.3.5" on standard; "os96 cbm basic v3.5e" if OS96 ROM








BASIC 80E5-80F1
Calculate and print bytes free.


This is obtained by subtracting the beginning of Basic ($2B,$2C) from top of RAM ($37,$38).








BASIC 80F2-80F4
Print message routine












BASIC 80F5 T "BYTES FREE" text












BASIC 8105-8116 T BASIC vector start-up values












BASIC 8117
Fill up BASIC vectors since $300… with values of table $8105…












BASIC 8123
CHRGET routine to be copied into RAM INITAT
.A Copied to $0473…








BASIC 8129
CHRGOT routine to be copied into RAM CHRGOT
.A Copied to $0479...








BASIC 8144
RAM (under ROM) reader routine to be copied into RAM


Copied to $04A5








BASIC 8155-818D T Error messages vectors












BASIC 818E-8382 T BASIC commands (keywords)


Last character of each keyword is Ored with $80








BASIC 8383-8414 T BASIC commands execute routines jump table (-1) vectors


Each value is real address -1 in order to be launched by an RTS.








BASIC 8415 T BASIC function dispatch vectors












KERNAL 8453 T Default vectors












MATH 8453-8470 T Mathematical functions: precedence and address












BASIC 8471 T BASIC error messages


See $8A03. Last character of each message is ORed with $80.








BASIC 8479 C NEW. If Z=1 Return without execution
Z=0 to perform NEW










BASIC 847B
NEW execution code












BASIC 8493
Run












BASIC 85F6 T Error messages vector table












BASIC 8638 T ASCII text of miscellaneous BASIC messages












BASIC 8653
Find address of error message string
.A=message number $24, $25 Adress of message. .X=-1 .Y=0









BASIC 865D C Find FOR in stack












BASIC 866F
Print "READY."












BASIC 8672 T "READY" message


Before and after it: $0D $0A; String ends with a $00








BASIC 867E
Restart BASIC / Returns if no error message












BASIC 8683
Error display routine ERROR .X = Error No. (read below).
Throu JMP ($0300)








BASIC 8686
Error message handler routine and Basic pointers reset ERROR .X = Error No. If .X has bit7=1 then no message is output but pointers reset is still performed.
After displaying, it resets some Basic pointers. Values of .X from 37 to 127 are accepted but they produce odd outputs.








BASIC 868B
Open space












BASIC 86E0
Print out actual error message


Makes call to KERNAL routine $FF4F for printing








BASIC 870F
Read in a BASIC line












BASIC 872E
Handle new line












BASIC 873B
Delete program line












BASIC 8785
Insert line












BASIC 8818
Rechain lines (recalculate lines links)












BASIC 885A
Receive input line












BASIC 8867
Check if INPUT string is <89 characters in INPUT buffer ($0200...)












BASIC 8871
Scan BASIC stack

.A









BASIC 88C0
RAM blocks copy with room check and possible garbage collection
start=$5F; end=$5A new end=$58 Warning: Last block is not copied








BASIC 89C7
RAM blocks copy
start=$5F; end=$5A new end=$58 Warning: Last block is not copied








BASIC 8905
Check/Expand BASIC stack












BASIC 8905
Expand BASIC stack / Check stack depth












BASIC 8923
Check memory space
.Y
Compare .Y with memory cell $34 (End of free RAM or Bottom of string area)








BASIC 8923
Space allocation in memory


Checks if there is enough memory








BASIC 8953
Tokenize BASIC line (Crunch tokens)


Thru crunch token vector ($0304)








BASIC 8956
CRNCH CRNCH











BASIC 8967
Crunch hook


Thru crunch hook vector ($030C)








BASIC 89D4 T USR token












BASIC 89EA
Crunching after tokenizing












BASIC 8A03
Identification of tokens using table at $818E












BASIC 8A3D
Find BASIC line SRCLIN $14,$15 = Line number $5F-$60 address of found line CY=0 if line not found








BASIC 8A79 C NEW












BASIC 8A93
Set TXTPTR to TXTTAB-1 RUNC











BASIC 8A98 C CLR












BASIC 8ABD
Backup text pointer












BASIC 8AED T PUDEF default characters


[space],.$








BASIC 8AF1
Back up text pointer












BASIC 8AFF C LIST












BASIC 8B40
LIST only ONE given LINE












BASIC 8B6B
Decode tokens for LISTing (JMP ($0306) (IQPLOP)











BASIC 8B6E
Print BASIC tokens as ASCII chars (IPLOP)











BASIC 8BB1
Command-text write-out












BASIC 8BBC C RUN












BASIC 8BC4 C RUN with program line number to start from












BASIC 8BD3
BASIC command executioner procedure (cycle)












BASIC 8BD6
Execute next BASIC statement












BASIC 8BDC
Start BASIC exec


Used by KNM Cruncher








BASIC 8C1A
Address of [CONT] (where to continue) ($025B-$025C)












BASIC 8C25
Execution of tokens












BASIC 8C6B C MID$ assigning value (not as a function)


ex: MID$(a$,2)="abc"








BASIC 8C74 C GO












BASIC 8C82 C USR


See RAM at $5F, $60, $64, 65








BASIC 8C93
Evaluating presence of ":" (if not found Syntax error# 11)












BASIC 8C9A C RESTORE












KEYBOARD 8CC0
Stop key watch (pressed?)












BASIC 8CC6
Test if a TRAP is set












BASIC 8CD2
BREAK current program running












BASIC 8CD8 C STOP (segment of previous routine)












BASIC 8CDA C END (segment of previous routine)












KEYBOARD 8CDC
Stop test












BASIC 8D03 C CONT


See flag on location $025C








BASIC 8D2C C GOSUB


Saves on Basic stack: line number (2 bytes), address (2 bytes), GOSUB token (1 byte: $8D).








BASIC 8D4D C GOTO












BASIC 8D83 C RETURN












BASIC 8DB0 C DATA













8DB3
Add .Y to $3B $3C zeropage values












BASIC 8DBE
Scan for next statement












BASIC 8DC1
Scan for next line












BASIC 8DC3
Search for a character inside memory SRCCHR .X = ASCII value of character to be found $3B, $3C = address of found character









BASIC 8DE1 C IF












BASIC 8E0B C REM/ELSE












BASIC 8E1B C ON












MATH 8E3E
ASCII number conversion and save - Convert a string to integer
CY=1 to execute (CY=0 returns without execute) saves to $14/$15









BASIC 8E7C C LET












BASIC 8E9B
Giving an integer value to variable












BASIC 8EB0
Giving a value to your char variable












BASIC 8EB7 C TI$












BASIC 8EF4
Input/validation of a number into FAC and ARG












BASIC 8F04
Giving a value to text variable (subroutine)












BASIC 8FE0 C PRINT#












BASIC 8FE6 C CMD












BASIC 8FFA C PRINT from (.Y.A)
.Y/.A
??? (see $9088)








BASIC 9000 C PRINT












BASIC 903E
Print <CR> <LF>












BASIC 904F
',' (tabulator) print out












BASIC 905F C "TAB(" / "SPC(" commands
CY=1: TAB; CY=0: SPC










BASIC 907A
';' print-out (???)












I/O 9088
Display a string from memory WSCRN String is addressed at .Y,.A










BASIC 90A5
Error message handler for GET, INPUT, READ (DOAGAIN)












BASIC 90A6
Print INPUT prompt / Print ASCII (format) chars QPLOP

The prompt character is saved on pagezero $13 ($00=default "? "; $01=no prompt)








KEYBOARD 90AA
Print "Space" executing INPUT












KEYBOARD 90AD
Print "Cursor right" executing INPUT












KEYBOARD 90B0-90B7
Print "?" executing INPUT












BASIC 90B8 C GET












BASIC 90CB C GET#












BASIC 90EE C INPUT#












BASIC 9108 C INPUT












BASIC 9142
Prompt and input












BASIC 914F C READ












BASIC 9283-9292 T "?EXTRA IGNORED"












BASIC 9294 C NEXT












BASIC 9314
Compute a numerical expression (even if a single number) FRMNUM $3B, $3C address where the expression resides in memory CY=1 if string (ERROR) FAC = Result of expression









BASIC 9317
Check for number. If set as "string" then error "TYPE MISMATCH" is output. CHKNUM Value to be checked (flags are in memory cell $0D)










BASIC 931A
Char function evaluating CHKSTR











MATH 932C
Evaluate expression in BASIC line (string or math) FRMEVL 1) $3B, $3C address where the expression resides in memory; 2) $16 must be set with #$19; 3) values of address' $37, $38 must be copied to $33, $34 FAC = result Max deep of stack level is 40; else "FORMULA TOO COMPLEX" error








BASIC 9414
Next part of expression TREMVL











MATH 9439-943D T PI constant value


$82 $49 $0F $DA $A1








MATH 943E C Compute PI PIVAL











BASIC 9465 C NOT












MATH 9471
Convert single numeric term from ASCII to Floating












MATH 9471
EVAL / Float-Fixed


Vectored by $02F4








BASIC 9477 C FN












BASIC 947E C BASIC SGN












MATH 9485
Evaluate within parentheses PARCHK











MATH 948B
Check for ")" CHKCLS











MATH 948E
Check for "(" CHKOPN











MATH 9491
Check for "," CHKCOM











MATH 9493
Check for a character in BASIC stream
.A = character to be searched "SYNTAX ERROR" if not found









BASIC 949C
Print "SYNTAX ERROR" SNERR











BASIC 94A1
Error #11 (syntax)












BASIC 94AD
Get value of a variable SVAR

Evaluation of a BASIC variable








I/O 94E8
Evaluation of DS$












I/O 94FA
Disk error channel reading. (Read only after a new disk operation)












MATH 9501
Numeric evaluation












BASIC 9528 C TI












BASIC 9531
Load TI$ from current clock counter (RDTIM $FFDE)

FAC ($62-$65) Mantissa will be: $00,.Y,.X,.A








I/O 953F
Test if variable is ST












I/O 9547
ST reading into FAC

FAC ($62-$65)









I/O 954D
Test if variable is DS












I/O 9555
DS reading ($94FA) / DS$ reading in












BASIC 9577
ER, EL identifying, reading into FAC












BASIC 9583
EL reading into FAC












BASIC 958C
ER reading into FAC












BASIC 9599
Function evaluating












BASIC 95B4
Char function evaluating












MATH 95B9
Dispatch and evaluate a function SFUN











BASIC 95D9
Numerical function evaluating












BASIC 95F8 C Evaluate OR












BASIC 95FB C Evaluate AND












BASIC 9628 C Relation evaluating (>, =, <)












BASIC 9640
Relation evaluating in char types












BASIC 9665 C NOT












BASIC 969B C DIM


It is allowed to use an unDIMed array if inside these sizes = 11 or 11x11 or 11x11x11 (each dimension from 0 to 10)








BASIC 96A5
Search for a BASIC variable SRCVAR $3B, $3C point to variable name (H/L) $47, $48 = address of the data of variable, if variable exists (create variable, if not found?)








BASIC 973A
.A contains an alphabetic char? ("A"…"Z")
.A CY=1 yes









BASIC 9744
Return the address of variable found or created FINPTR .A?










BASIC 974F
Detach TI, TI$
.Y?










BASIC 9759
Check for DS,DS$












BASIC 9763
Check for ST












BASIC 9769
Check for ER,EL












BASIC 985B
Array pointer subroutine (allocate space for array descriptors)












MATH 986C-9870 T Floating point constant -32768 N32768











MATH 9871
Float-fixed convertion (FAC #1 -> 2 bytes integer) AYINT FAC .A/.Y Vectored by $02F2








MATH 9879
Conversion from Float to Integer












BASIC 989B
Set up array (search and, if not found, create)












BASIC 98AB
??? Generate "BAD SUBSCRIPT" error message BSERR











BASIC 98AE
??? Generate "ILLEGAL QUANTITY" error message IQERR











BASIC 9919
Go to "BAD SUBSCRIPT" error












BASIC 991C
Go to "ILLEGAL QUANTITY" error












BASIC 993A
Array variable saving












BASIC 99C3
Given array number search












BASIC 99F1
Array-number address evaluation












BASIC 9A2F
Compute multi-dimensional array size UMULT











BASIC 9A62 C FRE












MATH 9A76
Fixed (16 bits + sign) to floating GIVAYF .A, .Y










BASIC 9A7D C Evaluate POS












BASIC 9A86
Check for direct mode

ERR# 21 (ILLEGAL DIRECT) if running is on Test the flag in $81








MATH 9A92
A/Y to FAC, set nemeric-flag; clear mantissa












BASIC 9A9D C DEF












BASIC 9ACB
Check FN syntax












BASIC 9ADE C FN












BASIC 9B54
Allocate memory for string
.A=String lenght










BASIC 9B66 C Evaluate STR$












BASIC 9B70
Set up a string in memory / Calc string vector STRLIT











BASIC 9B74
Setup strings (collect and update strings pointers)












BASIC 9BB0
String descriptor into string-stack












BASIC 9BDA
Concatenate two strings CAT











BASIC 9C1B
Build/Transfer a string into memory MOVINS











BASIC 9C48
Compute a string expression, result is then pointed by FAC FRMSTR $3B, $3C = address of string to be evaluated FAC = Result; $61 = lenght; $62, $63 = pointer









BASIC 9C4B
Discard unwanted string FRESTR











BASIC 9C52
Make room for string












BASIC 9CAA
Clean descriptor stack (delete string from temp) FRETMS











BASIC 9CBB C Evaluate CHR$












BASIC 9CCF C Evaluate LEFT$












BASIC 9D03 C Evaluate RIGHT$












BASIC 9D15 C Evaluate MID$












BASIC 9D46
Pull string parameters of the stack (PERAM)












BASIC 9D61 C Evaluate LEN












BASIC 9D67
Exit string mode












BASIC 9D70 C Evaluate ASC












BASIC 9D81
Get a byte from BASIC line, convert ASCII number to a # value in .X (0-255) (GETBYTC) GTBYT $3B, $3C = address FAC = result; "ILLEGAL QUANTITY" error if > 255 Red notes in "description" are alternative meaning.








BASIC 9D84
Evaluate 1 BYTE parameter from basic stream (previous routine continuation)












BASIC 9D93 C Evaluate VAL

FAC1









BASIC 9DD2
Get parameters for POKE/WAIT (get 16 bits for address & 8 bits for value) GETADR, CHKCOM, GETBYT











BASIC 9DDE
Get parameters for SOUND

$14/$15









BASIC 9DE1
Compute an integer expression RENU20 $3B, $3C = address of string to be evaluated .A .Y on $14/$15









MATH 9DE4
Convert Floating to fixed (FPN to unsigned two-bytes integer) GETADR (GRADR) FAC $14/$15









BASIC 9DFA C Evaluate PEEK












BASIC 9E12 C POKE












BASIC 9E1B C Evaluate DEC












BASIC 9E6A C WAIT












MATH 9E7D
Add 0,5 to FAC1 FADDH FAC =FAC+0,5









MATH 9E84
Subtract FAC1 from a number in memory FSUB











MATH 9E87
Evaluate "subtract" for BASIC (symbol "-") FSUBT ARSUFA ARG-FAC FAC









MATH 9E96
Compare exponents of FAC and ARG

FAC









MATH 9E9B
Sum without affect FAC YAADFA ARG+(.Y,.A) FAC









MATH 9E9E
Evaluate "add" for BASIC (symbol "+") FAC + ARG FADDT (ARADFA) FAC+ARG FAC









MATH 9EDB
Make the result as negative if a borrow was done FADD4











MATH 9EEB
Add FAC1 to a number in memory FADD











MATH 9F32
Normalize floating point accumulator #1 NORMAL











MATH 9F7B
Complement FAC #1 (FAC1=compl. of FAC1) NEGFAC











MATH 9FB2
Print "OVERFLOW ERROR" message OVERR











MATH 9FB7
Single byte multiply MULSHF











MATH 9FF0-9FF4 T Floating point constants with value of 1 FONE











MATH 9FF5-A01D T Floating point constants for LOG LOGCN2











BASIC A01E C Evaluate LOG












MATH A05C
FAC=(.A,.Y)*FAC (From ROM)

FAC









MATH A062
FAC=FAC/2

FAC









MATH A066
FAC=(.A,.Y)+FAC (From ROM)

FAC









MATH A06C
FAC=(.A,.Y)-FAC (From ROM)

FAC









MATH A06F
FAC=ARG-(.Y,.A) (From ROM) ROSUFA ARG FAC .Y,.A points to a ROM constant








MATH A072
FAC=(.Y,.A)/FAC (From ROM) RODIFA FAC, .A, .Y FAC .Y,.A points to a ROM constant








MATH A078
FAC=(.Y,.A)*FAC (From RAM) YAMUFA FAC, variable address (.A, .Y) FAC









MATH A07B
(Evaluate) Multiply FAC1 by a memory value (FAC = FAC*ARG) FMULT (ARMUFA) ARG, FAC FAC









MATH A083
Multiply FAC1*FAC2 leaving product in FAC1 FMULT1 FAC1, FAC2 FAC1









MATH A0A9
Multiply subroutine (1 byte) MUTPLY

Actual subroutine starts at $A0AE








MATH A0DC
Memory to FAC #2 [ARG = (.Y,.A)] ROMUPK (ROMARG) (.Y,.A) ARG (.Y,.A) point to a ROM constant








MATH A107
Memory to FAC #2 [ARG = (.Y,.A)] CONUPK (YAARG) (.Y,.A) ARG (.Y,.A) point to a variable








MATH A137
Adjust FAC #1/#2 (Add exponent of FAC1 to exponent of FAC2 [ARG]) MULDIV











MATH A154
Under/Overflow error handle MULDVEX











MATH A162
Multiply FAC1 by 10 MULT10 FAC1*10










MATH A179-A17D T Constant 10 in FPN format TENC

$84 $20 $00 $00 $00








MATH A183
Divide FAC1 by 10 DIV10 FAC1 FAC1









MATH A194
FAC=(.A,.Y)/FAC1 Divide memory by FAC1 (From RAM) FAC = ARG/FAC FDIV (ARDIFA) ARG, FAC FAC To be verified what explaination is correct (black or red)








MATH A197
Divide FAC2 by FAC1 (Evaluate "divide"?) (FAC=ARG/FAC) FDIVT

BASIC symbol "/". To be verified what explaination is correct (black, red, blue)








MATH A21F
Memory to FAC1 of a FPN MOVFM (YAFAC) (.Y,.A) point to a variable FAC









MATH A221
ROM constant to FAC1 of a FPN ROMFAC (.Y,.A) point to a ROM constant FAC









MATH A24C
FAC1 to memory (to TEMP1?) FAC3=FAC MOVFA (FACAC4) FAC #1 FAC3 $5C-$60 FAC3 To be verified what explaination is correct (black or red)








MATH A24F
write-out of FAC to $57-$5B FAC4=FAC FACAC3 FAC4 FAC To be verified what explaination is correct (black or red)








MATH A255
write-out of FAC into RAM according to $49












MATH A259
write-out of FAC to RAM according to (YX) [FAC=(.Y,.X)] FACYX .Y, .X point to a variable FAC









MATH A281
FAC #2 to FAC #1 (FAC=ARG) MOVFA (ARGFAC) ARG FAC









MATH A291
FAC=ARG ARG=FAC FACARG FAC ARG Furthermore call $A2A0 to round the value. To be verified what explaination is true (black or red).








MATH A2A0
Round number and FAC #1 to FAC #2 MOVAF











MATH A2B0
Put FAC1 sign into .A reg.evaluation SIGN
A=$01: pos., $FF=neg.









BASIC A2BE C Evaluate SGN












MATH A2C9
Do Fixed-Float












MATH A2CE
Convert .A to floating point












BASIC A2DD C Evaluate ABS












MATH A2E0
Compare FAC #1 to memory pointed by .Y, .A CPYAFA (.Y,.A) point to a variable
Result flags are according with CMP instruction








MATH A327
Convert FAC1 into integer within FAC1 [FAC=INT(FAC)] QINT (FACINT) FAC FAC









BASIC A358 C Evaluate INT












MATH A37F
Convert an ASCII value to a FPN put in FAC1 [FAC=ASC(.$3B, .$3C)] ASFAC $3B, $3C point to the ASCII character FAC









MATH A3F7
String to FAC #1












MATH A411
Add signed integer (in .A) to FAC1 FINLOG











MATH A444-A452 T Float-char conversion constants












MATH A446 T Three constants for converting strings to FPN NO999











BASIC A453
Print "IN" followed by line-number INPRT











MATH A45A
Print a number in ASCII decimal digits LINPRT
.X/.A (low/high)









MATH A45F
Convert Hex to Dec then print it INTOUT / PRAX .X, .A (low/high) Print to standand output device









MATH A46F
Convert the content of FAC1 to ASCII character FOUT (FACAS) FAC1 on $0100









MATH A5A3 T Constant of 0,5 in FP FHALF











MATH A5A8-A5CB T Constants for Float to String conversion


Or decimal integer number chars?








MATH A5AE T Powers of minus ten constants FOUTBL











MATH A5CC-A5E3 T Hour, minute, sec convertion constants (for TI$) FDCENT











BASIC A5E4 C Evaluate SQR












MATH A5EE
(Evaluate) Compute "power" (exponentation function) FAC=ARG^FAC FPWR (ARPWFA FAC, ARG FAC









MATH A627
Evaluate NOT NEGOP

FAC:= -FAC. (The function NOT is at $9465)








MATH A632-A65F T EXP and LOG constants EXPCON











BASIC A660 C Evaluate EXP












MATH A6B3
Series evaluation (A1*X+A2*X^3+A3*X^5 polynom evaluation) subroutine 1












MATH A6C9
Series evaluation subroutine 2


Horner algorithm








MATH A6FD-A706 T RND constants












BASIC A707 C Evaluate RND












MATH A70E
FAC=(RND) (from timer)












MATH A725
FAC=(RND) (from a given function like a*b+3)












BASIC A760
Save BASIC stack


copy from $3D/$3E to $7C/$7D








BASIC A769
Restore BASIC stack












BASIC A772
Trim BASIC stack
.Y
$7C/$7D:=$7C/$7D+Y








KERNAL A77D
Kernal I/O routines calls


Error checking I/O calls








BASIC A78B
BASIC CHROUT (output a character) WRITE .A Print CHR$(A) BASIC OPEN must executed before








BASIC A791
BASIC BASIN (CHRIN)












BASIC A797
BASIC BSOUT (CHKOUT)












BASIC A7A6
BASIC CHKIN












BASIC A7AF
BASIC GETIN












BASIC A7B5 C SYS
$7F2,$7F3,$7F4,$7F5 = .A, .X, .Y, .SR $7F2,$7F3,$7F4,$7F5 = .A, .X, .Y, .SR









BASIC A7BE
SYS entry without math evaluation for address calculating
$14, $15 = Address $7F2,$7F3,$7F4,$7F5 = .A, .X, .Y, .SR $7F2,$7F3,$7F4,$7F5 = .A, .X, .Y, .SR









BASIC A7CF
SYS return












BASIC A7DE C SAVE












BASIC A7E1
LOAD (and SAVE?) preparing (clock and DS$ init)












BASIC A7F0 C VERIFY












BASIC A7F3 C LOAD












BASIC A7FA C LOAD/VERIFY entry point
$0A = 0 LOAD; 1 = VERIFY










BASIC A81B
Print "OK" (subroutine)












BASIC A81E-A822 T Message for "OK"


(Return)OK($00)









A824
Output error #29 if ST has a bit on (except bit 6)












BASIC A84D C OPEN












BASIC A85A C CLOSE












BASIC A86B C Set default parameters for LOAD/SAVE/VERIFY SETPAR

(no filename, device = 1 tape)








BASIC A897
Check for comma, and read in parameter to X

X









BASIC A89D
Check default parameters


CHRGOT, if End Of Line, deletion of returning address








BASIC A8A5
Check for comma, and ensure a character follows CHKCOM1











BASIC A8A8 C Set parameters for OPEN/CLOSE SETPAR1











I/O A8F8
DS, DS$ invalidation












BASIC A906
Allocate space in memory for string /Create a new 7 bytes descriptor for variable NOTFNS .A=String lenght










BASIC A954
Garbage collection


Clear the variable strings area from the orphan sequences and compact the used space.








MATH AA39
Substraction from source-pointers
.A
$4E/$4F:=$4E/$4F--A








BASIC AA57
Calculate end of string












BASIC AA70 C Evaluate COS












BASIC AA77 C Evaluate SIN












BASIC AAC0 C Evaluate TAN


REG1:$57…$5B
REG2:$5C…$60









MATH AAEC-AB19 T Trigonometrical constants












MATH AAFB-AB19 T SIN polinom table












BASIC AB1A C Evaluate ATN












MATH AB4A-AB86 T ATN table












BASIC AB87-AB8E T Tokens for RENUMBER












BASIC AB8F C RENUMBER












BASIC AC0D
Validate and fix reference numbers


Used for example by GOTO








BASIC ACEE
New address


Subroutine of $AC0D








BASIC ADCA C FOR












BASIC AE5A C DELETE












BASIC AECA
Line-range check












BASIC AEF7 C Print using












BASIC B1ED
Number format for output












BASIC B2B7
String format evaluation












BASIC B386 C INSTR












BASIC B42B C TRAP












BASIC B440 C RESUME












BASIC B4BE C Evaluate ERR$












BASIC B507 C Evaluate HEX$












BASIC B544 C PUDEF












BASIC B557 C DO












BASIC B5AC C EXIT












BASIC B603 C LOOP












BASIC B652 C TRON












BASIC B655 C TROFF












BASIC B6CD C AUTO












BASIC B6E8 C HELP












KERNAL B70C
Write out blinking the part of program line which went into error












BASIC B729 C KEY












BASIC B7A7 T Definitions for KEY












O.S. B7C2
Function-keys definition routine
$76 = key number; $22,$23 = Address of string; .A = string lenght










BASIC BA7F
Print a single character to the graphic screen (used by CHAR statement)
.A=character .X = line (0..24) .Y=column (0..39) $8C $8D = bitmap address where char was printed; $24 $25 = character' descriptor in ROM charset









BASIC B849 C SOUND












BASIC B8BD C VOL












BASIC B8D1 C PAINT












GRAPHIC B911
Cycle routine using X












GRAPHIC B931
Cycle routine using Y












BASIC B9D4 C CHAR statement


Warning: when executing CHAR, possible screen-windows are reset.








BASIC BAE2 C BOX












GRAPHIC BBB4
Turning of GFX












GRAPHIC BC18 T Constant used by BOX












KERNAL BC20-BC35 T O.S. authors names


"FRED B. TERRY R. MIKE I." See on address $CDAB for another way to print 4 O.S. author names (2 of them are shown here too)








GRAPHIC BC56
Function evaluating with interpolation for gfx.


Sin and Cos








BASIC BD35 C GSHAPE












BASIC BE29 C SSHAPE












BASIC BF79 C Evaluate RGR












BASIC BF85 C Evaluate RCLR












BASIC BF87 C Evaluate RLUM












BASIC BFC1 C Evaluate JOY












BASIC BFF0-BFFA T JOY direction table












BASIC BFFB-BFFC T JOY read.out mask












BASIC BFFD C Evaluate RDOT












BASIC C01E C CIRCLE


$E9 = Angle for segments (ex. 120 = Triangle; 90 = square; etc.)








GRAPHIC C0D5
Drawing of a straight line onto bitmap












:-) C0F9
BEQ $C0FE


Maybe it's time of a COFFE ;-)








:-) C113
BEQ $C0DE


Go to C0DE! :-)








GRAPHIC C1A5
Write a dot onto bitmap
$84 = color; $2AD-$2AE = x; $2AB-$2B0 = y










GRAPHIC C1C3
Give color to a single point (pixel)












GRAPHIC C1F3
Dot checking












GRAPHIC C21A
Evaluating color and luminance for chars on bitmap












GRAPHIC C264
Give pointer address for Bitmap












GRAPHIC C289-C290 T Bitmask












GRAPHIC C291
Evaluating the value of a dot on bitmap












GRAPHIC C2AD
Evaluating char coordinates

.X/.A









GRAPHIC C2D3 C SCALE












GRAPHIC C2F0
A/Y:=A/Y+--T(X) coordinates addition, or substraction












GRAPHIC C2F6
Add to coordinates












GRAPHIC C2F9
.A/.Y:=.A/.Y+T(X)












GRAPHIC C305
Subtract to coordinates


.A/.Y:=T(Y) - T(X)








GRAPHIC C308
.A/.Y:=.A/.Y--T(X)












GRAPHIC C318
.A/.Y:=T(Y)












GRAPHIC C322
.A/.Y:=ABS(T(Y)--T(X))












GRAPHIC C337
.A/.Y:=.A/.Y*T(X)/65535












GRAPHIC C37B
Set graphic cursor


T(0):=T(4), T(2):=T(6)








KERNAL C38F
2 bytes read in from BASIC graphic command

.A/.Y









KERNAL C3A0
Default set-up, CY=0












KERNAL C3A5
1 byte read in












GRAPHIC C3B6
Color code into .X (for example: Circle)












GRAPHIC C3D9
X,Y coordinates read in from BASIC graphic command












GRAPHIC C3F7
Parse graphic command












GRAPHIC C40B
Polar coordinates












GRAPHIC C45A
90 degree triangle coordinates












GRAPHIC C48F
Get graphic parameter


Coordinates








GRAPHIC C4AF-C4B2 T Colour bitmap table for multi-mode












GRAPHIC C4B3-C4C6 T 10 constants (2 bytes): SIN (0-90) for gfx












GRAPHIC C4C7-C4D8 T 9 constants (2 bytes): SIN interpolation by 10 degrees












BASIC C4D9 C DRAW












BASIC C50F C LOCATE












BASIC C51A C COLOR












BASIC C567 C SCNCLR












BASIC C5A7
Memory pages filling
.A=filling value .X=number of pages .Y=starting page
Whole pages (256 bytes) are filled with a value. WARNING: .X=0 would cause to fill the whole 64K memory!








BASIC C5B8 C SCALE












BASIC C5C3 C GRAPHIC












GRAPHIC C637-C63B T Graphic legal mode codes ($00, $20, $60, $A0, $E0)


Stored at $83 (see there bit mask)








GRAPHIC C63C
Test if graphic area is already allocated (RAM cell $75)


If yes does nothing and return








GRAPHIC C641
Enable bitmap and move BASIC area to $4000

$75 <> 0









BASIC C710
Modification of BASIC stack address












BASIC C738 C Standard memory configuration, defaults. (CLR parameter on GRAPHIC command)












BASIC C7AD
BASIC stack-address change












BASIC C7BF
Confirm graphics (is still on?)

z=1 yes









BASIC C7C9
Set TEXT screen and default graphic (GRAPHIC 0) parameters. Characters map is read from ROM.












BASIC C7F0
Copy of addresses (because of gfx)












BASIC C825
Text-reference modification












BASIC C86B
Copy length of string into registers

.X=Low address
.Y=High Address










BASIC C877
String-pointer modification












BASIC C8BC C DIRECTORY












BASIC C941 C DSAVE












BASIC C951 C DLOAD












BASIC C968 C HEADER












BASIC C99C C SCRATCH












BASIC C9CC C COLLECT












BASIC C9DA C COPY












BASIC C9F4 C RENAME












BASIC CA00 C BACKUP












I/O CA16
Disk command sending












I/O CA3F
Disk command combining












I/O CAF5-CB1E T Disk drive syntax codes












BASIC CB1F
Parse DOS command












I/O CC51
Unit number read in

.X (?)









I/O CC69
FileName read












BASIC CCAA
Check for parameter/switch












BASIC CCAF
Syntax check












I/O CCB5
Check for valid File Name












I/O CCCF
Disk-unit error channel read (after a not valid read-in)


There are two ROM versions for this routine. The 2nd starts from $CCE0








BASIC CD2F
Print "ARE YOU SURE?", and wait for Y or N

Z=1 if user hits "y"









BASIC CD32-CD3F T "ARE YOU SURE?" text












BASIC CD40
Wait for Y/N pressing

Z=1 stands for Y(es)









BASIC CD57
Delete DS$


Rumors say this routine causes the so-called "$28FF bug" by not properly setting the zeropage ($79) vector. The bug sometimes writes the values $28 $FF on RAM locations $3058, $3059 (or rarely on $305F, $3060)








MATH CD74
Write-out of .A as an integer number onto screen












BASIC CD7F
Delete the High Byte of the programm address












O.S. CD89-CDB9
Test for pressing CBM-CTRL-C (cold reset) under OS96












KERNAL CD89-CDAA T Authors names (encrypted) (other unknown code on OS96)

F.BOWEN (reverse) J.COOPER B.HERD T.RYAN (blinking) Text is EORed with $55 and written from end to begin. See at $BC20 for another area with authors names (not encrypted).








BASIC CDAB
Print authors names from $CD89 encrypted data. (Other unknown code on OS96)


Names blinking and reversed are who did write this routine (and other parts of O.S.!)









CDB8-CDB9
2 full bytes


$FF $FF








I/O CDBA-CDC3
Patch to $CCCF routine












O.S. CDC4-CDFF
Filled with $FF












O.S. CDC4-CDFF
Code for OS96












IRQ CE00
IRQ entry


Test if IRQ comes from a BRK instruction. If yes then JMP ($0316) else JMP ($0314)








IRQ CE0E
IRQ sequence entry IRQ

Tests if IRQ comes from raster. If yes, then sets value for split screen ($A1)








IRQ CE18
RS232 set (IRQ)


Test and if found set RS232








IRQ CE2E
Other IRQ routine jobs, performed during screen not visible lines (>204)












IRQ CE60
Do screen split (IRQ subroutine)












IRQ CE89
IRQ keyboard management












IRQ CEC4-CECC
8 NOPs












IRQ CECD
Sound-timing in IRQ












IRQ CEEE-CEEF T Sounds off and value


$EF $9F








IRQ CEF0
Update software clock (IRQ subroutine)… UDTIM

See note at $CFBF line








IRQ CF11
… and check for STOP key pressed (IRQ)

$91 Uses .A (doesn't affect .X, .Y)








KERNAL CF26
Read time from software clock (subroutine) RDTIM
.A, .X, .Y









KERNAL CF2D
Set the software clock (subroutine) SETTIM .A, .X, .Y $A5,$A4,$A3









MONITOR CF36-CF65 T Monitor messages












MONITOR CF66
Print out MONITOR messages












I/O CF74 T RETURN signal (echo)












KERNAL CF8A
Color code read-out
.Y = index ($0…$F). $07F9=Flag: $80: from RAM ($113…) else: from ROM ($E143…) .A Fetch a screen-color code (from print string or from keyboard input [CTRL-num or CBM-num])








KERNAL CF96
Fetch RAM/ROM read-out routine
07F8=$00: ROM; $FF: RAM
If ROM, then reads from $A1/$A2








KERNAL CFA6
Initialise ROM(s)












KERNAL CFB3
KERNAL ROM-reading routine


Copied to RAM from $7D9








I/O CFBF
Handle tape motor and time ($A3…$A5)


Routine contains the lone referrals to $CEF0 Time-update, at address $CFDB








IRQ CFD1
Adjust time clock ($A3..$A5) for PAL systems (being their IRQ 1/50" while time tick is 1/60")


Uses $7FD as counter to add 1 tick every 5 (then the 50 ticks per second added by IRQ becomes 60 and time is maintained)









CFF7
Free (9 bytes containing $FF)












I/O D000-D3FF T Chars set #1 (Capital letters/Graphic)












I/O D400-D7FF T Chars set #2 (Capital letters/Lowercase)












I/O D708-D800 T Hungarian charset












I/O D802-D833 T Screen memory line begin (0-24)


$D802-$D81A low-bytes; $D81B-$D833 high-bytes








KERNAL D834
Return screen size - subroutine SCREEN
.Y=rows .X=columns









KERNAL D839
Read/set location of the cursor - subroutine PLOT CY=1: Read; =0: Set .X/.Y (if read) If set (CY=0) then all possible windows-screen are reset. The routine works from BASIC too (SYS command); input/output parameters are: $07F3 for .X, $07F4 for .Y, $07F5 for CY.








KERNAL D84E
Reset video


See $FF81 in the Jump table









D864
Set vector at $0545 to $DB7A (keys decoding)













D86E
Set keyboard buffer size ($0A) and other keyboard values













D87E
Set standard color/lum for cursor












I/O D87F-DE7F T Color/luminance standard of cursor (after a reset)


Black








KEYBOARD D888 C ESC-N Set normal screen, Clear screen, Cursor on Home NORSCREEN











KERNAL D88B
Reset & clear screen CRL (CLEAR)











KERNAL D891
Clears all remaining screen


Clear line where cursor resides, and all following lines until bottom.








KERNAL D89A C HOME


Cursor to home position on current window (if definited one) or on fullscreen








KEYBOARD D8A1
Set pointer to current screen line SETLINE











KERNAL D8A8
Return the address of the cursor












KERNAL D8AA
Set screen pointers












KERNAL D8C1
Read-out of a char from char-buffer.

A=$00: empty There are two ROM versions of this routine.








KERNAL D8EA
Read-in from screen until RETURN is pressed












KEYBOARD D965
Read-in from screen until End of Line












KEYBOARD D9BA
Test for quote marks QUOTEST











KEYBOARD D9C7
Screen output wrap (Move cursor to next line?) OUTWRAP











KEYBOARD D9D9
Setup screen print












KERNAL DA21
New-line RETURN











KERNAL DA3D
Copy of a line

.X into .X+1









KERNAL DA5E
Insert of a line












KERNAL DA89
Scrolling of screen












KERNAL DAF7
Delete screen-line
.X=line










KERNAL DB03 T Character to fit empty areas of screen


Normally $20 (space)








KERNAL DB11
Read a character from keyboard subroutine (and clear $0543) SCNKEY Please read SCNKEY at $FF9F Please read SCNKEY at $FF9F Please read SCNKEY at $FF9F








KEYBOARD DB70
Keyboard line scan (subroutine)
.A=line to scan .A=columns status See Keyboard matrix on "I-O tables"








KEYBOARD DB7A
Decode of keys












KEYBOARD DC41-DC48 T Function keys ASCII codes


$85 $89 $86 $8A $87 $8B $88 $8C








KEYBOARD DC49
Output to the screen (main screen editor) PRINT











KEYBOARD DC8C
SHIFT/RETURN print-out on the screen












KEYBOARD DC9B C ESC-O no-reverse, no quote, no flash












KEYBOARD DCA7
Command character separation (0--$1F)












KEYBOARD DCF1
Change cursor color












KEYBOARD DCFA
Cursor right












KEYBOARD DD00
Cursor down












KEYBOARD DD0D
Cursor up












KEYBOARD DD1C
Cursor left












KEYBOARD DD27 C Small-char mode (shift/commodore) CTRL N












KEYBOARD DD2E C Char-mode change disable (CTR-I)












KEYBOARD DD35 C Char-mode change enable (CTR-H)












KEYBOARD DD3E
Big-char mode












KEYBOARD DD47
Validation for the upper 128 characters












KEYBOARD DD56 T Command characters ($20-$9F)












KEYBOARD DD99
DEL write-out












KEYBOARD DDCE
INS write-out












KEYBOARD DE06
Decode escapes












KEYBOARD DE1A-DE47 T Escape function entry points












KEYBOARD DE48 C ESC-R reduce screen












KEYBOARD DE5E C ESC-T set top of window












KEYBOARD DE60 C ESC-B set bottom of window












SCREEN DE67
Set bottom and right coordinates of a screen window
.A = bottom line (0...24) .X = rightmost column (0…39)
(JMP $DE80). Mask of multiline links is cleared








SCREEN DE70
Initialize screen (HOME/HOME) as full screen












SCREEN DE80
Clear mask of multilines links (screen line wrap)












KEYBOARD DE8B C ESC-I insert line (DE46?) INSERTLN











KEYBOARD DEA0 C ESC-D delete line












KEYBOARD DECB C ESC-Q erase to line end












KEYBOARD DEE1 C ESC-P erase from line start












KEYBOARD DEF6 C ESC-V scroll up screen 1 line SCROLL











KEYBOARD DF04 C ESC-W scroll down screen 1 line SCROLLDN











KEYBOARD DF1D C ESC-L scroll enable












KEYBOARD DF20 C ESC-M scroll disable












KEYBOARD DF26 C ESC-C cancel insert mode












KEYBOARD DF29 C ESC-A auto insert mode












KERNAL DF2F
Read-out of char below the cursor












I/O DF39
Check screen line wrap












I/O DF46
Break screen wrap
If CY=0 Screen wraping gets deleted (broken)
If CY=1 Screen wraping gets marked











I/O DF59
Make screen wrap (Move cursor to next screen line) NXTWRAP











I/O DF66
Calculate screen wrap mask












KEYBOARD DF7A-DF81 T Bitmask for multiline












KEYBOARD DF82 C ESC-J go to line start












KEYBOARD DF95 C ESC-K go to line end












KEYBOARD DFBF
Cursor right












KEYBOARD DFD4
Cursor left












KERNAL DFF6
Save of cursor position












KERNAL DFFF
Write-out of SPACE












KEYBOARD E001
Write out a single character to the screen












KEYBOARD E011
Character write-back












KEYBOARD E01E-E025 T Keyboard buffer decoder vectors KEYSETS











KEYBOARD E026-E066 T Normal characters decoder table












KEYBOARD E067-E0A7 T SHIFTed characters decoder table


SHIFT+key








KEYBOARD E0A8-E0E8 T COMMODOREd characters decoder table


CBM+key








KEYBOARD E0E9-E129 T CONTROLled characters decoder table


CTRL+key








KEYBOARD E12A-E132 T dL”*"+RUN












KEYBOARD E133-E142 T Colour buttons ASCII codes


Used with $07F9 flag








KEYBOARD E143-E152 T Colour buttons colours












I/O E153
Send "talk" to a device on the serial bus TALK (.A = device to search for)???
??? To be verified (according with Mike)








I/O E156
Send "listen" to a device on the serial bus LISTEN .A = device to search for
Check for serial device








I/O E177
Write-out of a byte on the serial bus












I/O E181
Send to serial bus












I/O E19F
Send actual byte across serial line












I/O E1E9
Serial timeouts












I/O E1F7
Send after LISTEN, the secondary address (SA) to serial bus device SECOND

There are two ROM versions for this routine.








I/O E1FC
Slear ATN












I/O E203
Send after TALK, the secondary address (SA) to serial bus device TKSA











I/O E20C
Wait for clock












I/O E21D
Send serial deferred












I/O E22F
Send UNTALK to a device on serial bus UNTLK











I/O E23D
Send UNLISTEN to a device on serial bus












I/O E252
Input on serial bus












I/O E2B8
Set serial clock line low (inverted to active) handshake set ONCLK
$01= ANDed $FD









I/O E2BF
Set serial clock line high (inverted to inactive) OFFCLK
$01 = ORed $02









I/O E2C6
Set serial but data output line low ("1") (inverted high); serial clock on OUTPUT1
$01= ANDed with $FE (clear bit 0)









I/O E2CD
Set serial but data output line high ("0") (inverted low) OUTPUT0











I/O E2D4
Get serial & clock

CY=Bit 7 Waits for serial line to settle, then shift serial bit into carry








I/O E2DC
Set timer value = #$400, wait for 1 ms delay DELAY

Waits for IRQ from Timer# 2; when it happens sets for next and exit. It does NOT call IRQ routine








KERNAL E2EA
Set timer#2 value = #$4000, wait for 18,5 ms delay

Uses .A it exits =$10 (doesn't affect :X, .Y). Changes 8501 flags Waits for IRQ from Timer# 2; when it happens, the routine enables it again (for next one), then exits. It does NOT call IRQ routine








I/O E2F8
Set Timer#2=$400 and enable IRQ for Timer#2 (appr. 1 msec.)












I/O E2FC
Set Timer#2=$4000 and enable IRQ for Timer#2 (appr. 18,5 msec.)


Uses .A (doesn't affect :X, .Y). Changes uP8501 flags: N=0 Z=0.








I/O E311
Delay of 1 ms

.A value is lost









I/O E319
Print "PRESS PLAY & REC"












I/O E31B
Print "PRESS PLAY ON TAPE"












KERNAL E364
Blanks the screen, disable IRQs, masks raster interrupt, unmasks timer #1 interrupt


Affects .A (dosn't .X, .Y)








KERNAL E378
Re-enable screen and set-up IRQ












I/O E38D
Start tape motor and wait for approx. 0.55 sec.


Affects .A, .X (doesn't .Y and 8501 flags)








KERNAL E3A2-E3AF T C1984 COMMODORE copyright












I/O E3B0
Stop the cassette motor


Bit #3 of $0001 = 1








I/O E3B7
Clear tape buffer (filled with $20)












I/O E3C3
Setup tape buffer address to $0333


No register is affected








KERNAL E3CE
Stop Cassette handling because STOP was pressed

CY=1 if STOP was pressed









KERNAL E3E4
Cassette handling in IRQ












KERNAL E3EF
Set-up countdown
1st timer goes to the register










I/O E403
Sets Timer#1 value =$48a8 (approx. 21 ms), and enable its IRQ

uP8501 flags: ZF=0 NF=0 Uses .A (doesn't affect .X, .Y)








I/O E413
Send tape (cycle) inpulse


($E777)?








I/O E447
Set 1 ms value to cassette-timer (long)












I/O E452
Set 0,25 ms value to cassette-timer (short)












I/O E45D
Set 0.50 ms value to cassette-timer (medium)












I/O E468
Send tape "0" bit












I/O E474
Send tape "1" bit












I/O E477
1.00 ms time into cassette-timer


To be confirmed








I/O E48C
Send tape byte












I/O E4BA
Write-out datablock












I/O E535
Initiate tape write












I/O E56C
Write tape header












I/O E5B0
Memory into tape












I/O E5F0
EOT signal into tape












TAPE E5FA-E5FC T Codes (not time constants) of the tape-impulses (so called: Short, Long, Double Long)


Values: $E5FA: $40 (=0,25 ms); $E5FB: $0 (=0,5 ms); $E5FC: $80 (=1 ms)








TAPE E5FD
Read-in one pulse from tape and acknowledges the type (Waits for the raise of the signal, then measures the lenght of low level of half wave)

CY=1: error =0: ok NF=0 VF=1: short NF=0 VF=0: long NF=1 VF=0: double long ZF=1 Affects all the registers








I/O E68E
Bit mask












TAPE E691
Read-in one bit from the tape

CY= bit just read









TAPE E6D5
Search for the beginning of the byte (double long, then long pulses)

CY=error









TAPE E6EC
Read-in one byte from the tape with odd parity












TAPE E6F6
Read-in bits of the byte with odd parity












I/O E74B
Read-in one block from the tape












I/O E8D3
Read-in a block into the buffer (from tape)












I/O E8F3
Read-in a block into the memory / Tape init read












I/O E917-E91C T Timer data


$E917: 0,3 ms; $E919: 0,6 ms; $E91B: 1,2 ms. These values are initially copied to $7B8… $7BD








TAPE E91D
Search for the beginning of a block (Adjusts time constants - waits for 10 shorts, waits for double long pulse - reads 1st byte of tape block)


Sets the adjusted time constants on $7B8… $7BD








I/O E9CC
Find any header (tape)












I/O EA21
Find a specific header (tape)












I/O EA5B
RS-232 out (IRQ)












BUG EAA7-EAAA
Location of RS232 bug of "CBM com routine". The bug does not allow to receive a null character ($00) because it causes to stop the receiving job. In order to send binary files you need to convert them into ASCII characters files.


In order to solve the bug, it should be sufficient to switch the position ot these two assembler instructions (credits: MikeZ) Correct data: .EAA7 STA $07D5 .EAAA BEQ $EAC2








I/O EA95
RS-232 in (IRQ)












I/O EB25
RS-232 status












I/O EB37
RS-232 CHROUT












I/O EB46
RS-232 initialization












I/O EB58-EBC5 T I/O messages of KERNAL


i.e. "SEARCHING, SAVING, PRESS PLAY" etc.








I/O EBC6
Write-out KERNAL I/O messages












I/O EBD9
Get 1 byte from the input device GETIN











I/O EBE8
Input a character from the current device BASIN
.A Comes from Kernal $FFCF jump








I/O EC0E
Get a character from tape TCHRIN











I/O EC14
Get from RS-232












I/O EC1C
Get from serial












I/O EC24
Read-in from cassette












I/O EC4B
Output a byte to standard output device BSOUT .A
Comes from Kernal $FFD2 jump








I/O EC63
Output a byte tape TCHROUT











I/O EC84
Send to RS-232


Warning: the receive routine has a bug. If you send the character $00, when it is received it is interpreted as end-of-message flag.








I/O EC8B
Receive data byte from a device on serial bus. Read a byte from standard input device. ACPTR

To be verified what explaination is correct (black or red)








I/O EC96
Parallel IEC input












I/O ECDF
Send a byte to I/O device on serial bus. Write a charater to standard output device CIOUT

To be verified what explaination is correct (black or red). The routine uses $00BA location.








I/O ED18
Designate a logical file as current input channel. Check if the file no. X is an input file CHKIN .X
To be verified what explaination is correct (black or red)








KERNAL ED3A
Open IEC channel for reading CHKIN











KERNAL ED60
Designate a logical file as current output channel. Check if the file no. X is an output file. CHKOUT .A= 0:Keyboard; 1:Tape; 2:RS232; 3:Screen, 4/5:Printers; 6/7:Plotters; 8…15:Disks BEWARE to RS232 bug (see $EC84) $99=Device (see input table here left) Devices No. 4 and following are serial chained. [To be verified what explaination is correct (black or red text)]








KERNAL ED85
Open IEC channel for writing CHKOUT











KERNAL EDA9
IEC-bus check

.A is same as input Check if a parallel drive (1551) is connected (routine uses $BA location).








KERNAL EDB8
Check for parallel disk drive(s) using DMA channel (Plus4)












KERNAL EDCF
Not a parallel device, then error












KERNAL EDD4
End of IEC












KERNAL EDEA
I/O initialization












KERNAL EDFA
Send the TALK signal to the IEEE bus TALK











KERNAL EE02
IEC Talk












KERNAL EE13
TKATN TKATN











KERNAL EE1A
Send the TALK secondary address to the IEEE bus TKSA











KERNAL EE21
IEC Secondary Talk












KERNAL EE2C
Send the LISTEN signal to the IEEE bus LISTEN

See more info at $FFB1 in the Jump table








KERNAL EE34
IEC Listen












KERNAL EE45
LSNATN LSNATN











KERNAL EE4D
Send the LISTEN secondary address to the IEEE bus SECOND











KERNAL EE54
IEC secondary listen












KERNAL EE5D
Close a logical file CLOSE
ST = -128 if device not existing/connected during last OPEN operation. To test if a device exists, just OPEN it, then CLOSE it and test ST variable. Not existing pattern of ST: 1 0 0 0 0 0 0 0
KERNAL EECA
Delete from file table












KERNAL EEE8
File-open evaluation

.x = -1: error (not found) Find a free logical file handle Not found pattern of .x: 0 1 1 1 1 1 1 1
KERNAL EEF8
File-parameter read from table / Sets current logical file number, secondary address, device no.)












KERNAL EF08
Close all logical I/O files CLALL

This operation affects only "logical" files. Then physical files located inside peripheral devices still remain open.








KERNAL EF0C
Restore I/O current devices to default CLRCHN











KERNAL EF23
Send UNLISTEN signal to a device on serial bus UNLSN











KERNAL EF2A
IEC Unlisten












KERNAL EF3B
Send UNTALK signal to a device on serial bus UNTALK











KERNAL EF42
IEC Untalk












KERNAL EF53
Open a logical I/O file OPEN

ST is not affected by result of operation (see CLOSE to test it)








I/O EF8A
Set LA, FA, SA












I/O EF8C
RS-232 OPEN












I/O EFB8
Cassette OPEN












I/O F005
Send SA












KERNAL F043
Load from a device to RAM LOAD

thru ($032E)








KERNAL F04A
Load a program
$AB = Filename lenght $AD = loadaddress mode (see notes) $AF $B0 = Filename address
The routine tests $93 for possible "verify on" $AD flag: =0 .X.Y set load address; <>0 loadaddress is taken from first 2 bytes of file








KERNAL F04C
Alternative Load program entry












I/O F064
Load from serial

.X .Y = End address of file ($9D, $9E)









I/O F0EF
Exit if BREAK is pressed (tape)












I/O F0F0
Load from tape












TAPE F128
Calculate tape file lenght and add buffer base

After LOAD: $9D, $9E = phisical end address of file to be load from tape After VERIFY: .A=$1D if OK; .A=$1C if error.









KERNAL F160
Print message "SEARCHING"












I/O F172
Print filename (if $AB<>0)












KERNAL F189
Print [LOADING] or [VERIFYING] depending on $93 value
$93: $00=Load; $01=Verify










KERNAL F194
Save from RAM to a device SAVE

Thru ($0330)








KERNAL F1A4
Kernal SAVE routine


Used by SAVE routine $F1A1 [JMP ($0330)] Vector to $F1A4








I/O F1B5
Save to serial












I/O F211
IEC Close












I/O F228
Print "SAVING"












I/O F234
Save to tape












KERNAL F265
Test [STOP] key pressed BASIC STOP instruction STOP BREAK

To be verified what explaination is correct (black or red)








I/O F273
I/O ERRORS: too many files












I/O F276
File open












I/O F279
Too many files ERROR (>10)


File not open (NightBird)








I/O F27C
File not found (Message: "I/O ERROR #4")












I/O F27F
Device not present












I/O F282
Not input file












I/O F285
Not output file












I/O F288
Missing file name












I/O F28B
Illegal device number (message: "I/O ERROR #9)












KERNAL F2A4
System reset entry (emulate NMI) RESET

Reset the whole system








KERNAL F2CE
Transfer page 3 BASIC & I/O vectors to RAM COPYVEC, RESTOR

Reset the vector table to standard values (Please read description on $FF8A)








KERNAL F2D3
Set the vector table VECTOR











KERNAL F2DC
Set RAM vector table from table pointer VECTOR .X, .Y










KERNAL F2EB T BASIC vectors page 3 VECTBL











KERNAL F2EB-F30A T KERNAL vector start-up values












KERNAL F306
Initialize CIA I/O devices IOINIT











KERNAL F30B
Initialize I/O system IOINIT

See $FF84 in the Jump Table








KERNAL F338-F351 T TED start-up values












KERNAL F33F T? Useful for screen format check


$08 = PAL; $48 = NTSC








KERNAL F351
Initialize the RAM map RAMTAS

(Please read description on $FF87)








KERNAL F352
RAM test and identify 16K/32K/64K RAM RAMTAS

(Please read description on $FF87)








O.S. F3B5
Copy the 16 standard colors table to Ram, at address $0113-$0122 and set values on $0508, $07FA, $07FB.


See flag on $07F9









F3D0-F3D1
NOPs












BASIC F3D2-F3D9 T Function buttons start-up values length












BASIC F3DA-F408 T Function keys start-up values













F409-F40B
Zeroes












KERNAL F40C
Set filename parameters for following OPEN routine SETNAM











KERNAL F413
Set logical file number, device number, second address for following OPEN routine SETLFS











KERNAL F41A
Set the Kernal message control flag SETMSG

(Please read description on $FF90)








KERNAL F41C
Read the I/O Status-word READST











I/O F41E
Change ST












KERNAL F423
Set timeout flag for IEEE bus SETTMO











KERNAL F427
Read/Set top of RAM pointer MEMTOP CY=0: Set; =1: Read










KERNAL F42F
Set MEMTOP












KERNAL F436
Read/Set bottom of RAM pointer MEMBOT CY=0: Set; =1: Read










MONITOR F445 C MONITOR












KERNAL F44C
BRK/USR Entry MONBRK
Exits thru $B003









MONITOR F478 C R (Monitor command "Registers")


Shows system registers








MONITOR F492
Write-out "?" if error appears












MONITOR F495-F4A6
Reads keyboard input and stores in RAM beginning at $0200












MONITOR F498
Enter in Monitor enviroment without message












MONITOR F4A7-F4CE
MONITOR commands interpreter and executer routine.
$0200…
Examines keyboard input stored beginning at $0200. Parses for Monitor commands by comparing with table at $F570,X. When a match is found, the index .X is used to pull RTS values from another table at $F580,X. This leads to execution of the appropriate Monitor command








KERNAL F4CC
Warm start routine WRMSTRT











MONITOR F4D7 C M (Monitor command "Memory")


Prints content of a memory area by showing hex values








MONITOR F50A C ; (Monitor command "Registers modify")


Modify current content of system registers








MONITOR F529 C > (Monitor command "Set byte(s)")


Modifies memory cell(s) by inputing hex value(s)








MONITOR F54B C G (Monitor command "Go")


Executes codes








MONITOR F570 T Monitor commands


X M R G T C D A . H F > ; L S V








MONITOR F580-F599 T Monitor commands entry points (-1) addresses


Table does not include addresses for command L, S and V (see $F66E)








MONITOR F59D
Print hex 8 memory bytes












MONITOR F5CE C C (Monitor command "Compare")


Compares two area of memory








MONITOR F5D1 C T (Monitor command "Transfer")


Copies contents from a memory area to another one. Bugged when the source area partially overlays the destination area (and only if the destination area address is greater than source area address). Ex: T 3000 3600 3500








MONITOR F60E C H (Monitor command "Hunt")


Searches inside memory for values/texts








MONITOR F66E C S/L/V (Monitor commands "Save / Load / Verify")


Saves, Loads, Verifies contents to/from a memory area








KERNAL F6F1
LOAD












KERNAL F6F3
LOAD/VERIFY
.A=0: Load <>0: Verify










MONITOR F70A C F (Monitor command "Fill")


Fills a memory area with a value








MONITOR F724 C D (Monitor command "Disassemble")


Disassembles a memory area








MONITOR F752
Disassemble an istruction












KERNAL F7BC
Evaluation of the addresses for jump-commands












KERNAL F7D4
Check for operation code












KERNAL F81B
Write-out mnemonics












MONITOR F83D T Op code modes (for Monitor)












MONITOR F881 T Machine language codes (for Monitor)












MONITOR F89B T Mnemonics (for Monitor)












MONITOR F91F C "A" or "." (Monitor command "Assemble")


Assembles into M.L. a mnemonic








KERNAL FA7D
Is it a valid hexadecimal value?
.A = ASCII character CY=1 not a legal hexadecimal character









KERNAL FA8B
Two-digit hexadecimal number read-in












KERNAL FAA0
Convert ASCII hexadecimal into binary value (pack)
.A = ASCII character .A = hexadecimal value Ex: "B" = ASCII $42 is converted to $0B








KERNAL FAAB
Hexadecimal parameter read-in












KERNAL FAFB
Hexadecimal address write-out












O.S. FAAD-FAF5
Parses keyboard input for hex numbers 0-F. Converts from ASCII values to actual numerical value.
.A $F1, $F2









KERNAL FAFF
Convert from hexadecimal packed value in .A, .X to an ASCII string and print it PUTWRD / PHLXA .A, .X (LSB/MSB) Print on standard output device. .Y not affected Example: .X=$AB .A=$CD is printed as ASCII string "ABCD"








KERNAL FB05
Convert and print .A in hexadecimal form, then a space ($FB10 then $FB08)

Print on standard output device









KERNAL FB08
Print a SPACE

Print on standard output device









KERNAL FB0B
Print a [?]

Print on standard output device









KERNAL FB10
Convert hexadecimal packed value in .A in an ASCII string and print it PUTHEX / PRHL .A Print on standard output device Ex: $2B = is printed as "2" "B" (ASCII $32 $42)








KERNAL FB20
Conversion to hexadecimal from AC












KERNAL FB3F
Read-in from INPUT buffer












KERNAL FB5B
Copy into Address-pointer












KERNAL FB64
Substraction of the pointer from the address: number of bytes












MONITOR FB72
Decrement $F1,$F2

$F1.$F2 = $F1.$F2 - 1









MONITOR FB86
Decrement $9F,$A0

$9F.$A0 = $9F.$A0 - 1









MONITOR FB94
Increment $A1,$A2

$A1.$A2 = $A1.$A2 + 1









MONITOR FBA0
Write-out address and block length













FBAD
$F1.$F2 --> $9F.$A0
$F1.$F2 $9F.$A0









MONITOR FBB7
Save registers












MONITOR FBC1
Recall registers












KERNAL FBCB
Watch for STOP button

CY=1: STOP pressed









KERNAL FBD8
Print all the following ASCII codes till a $00 PRIMM (SCRN) Hex codes must follow the JSR $FBD8; the last one must be a $00. Print on standard output device Max 255 bytes codes ($00 included)









FC00-… * RAM used by DOS


DOS seems use this area to store error messages in this format: String+[length]+[FF]








KERNAL FC00-FCFF * Banking routines


This area is always available to be read by the processor, whatever is the ROMs configuration.








KERNAL FC00
Jump to ($BC+.A)


The routine allows to jump to a location, indirect addressed by $BC, $BD + index in .A. Unfortunately values on $BC, $BC seem not be modificable (updated by IRQ?) Example: $BC=12; $BD=34; .A=5; JMP $FC00 ---> Execute $3417








KERNAL FC19 * Return base address of system I/O block - subroutine (ACIA) IOBASE
.Y=$FD .X=$00









KERNAL FC1E * Are ROM[s] present? A valid ROM must have the chars "C" "B" "M" since 8th byte ($8007...)


A part of the RESET routine








KERNAL FC56-FC58 * "C" "B" "M" characters


$43 $42 $4D ("C" "B" "M")








KERNAL FC59 * Check for autostart cartridge ("Phoenix" routine) and run it if found. PHOENIX

If a non-null value is found at $05EC.. $05EF then it is compared with the table at $FC7B… If it is exists then the bank is set and ROM is executed (JMP $8000).








KERNAL FC7B-FC7E * ROM-banks mask-table (the limit of 4 combination is only for auto-starting ROMs; if you don't need one of them, you do can utilize all the 8 slots for ROMs)


Values are: $00=BASIC; $05=3plus1; $0A=Unused; $0F= Unused.








KERNAL FC7F * Long fetch routine (read a byte from a different memory bank): LDA ($BE),Y on bank X
.X = bank, $BE, $BF = Address (l/h); .Y = index .A .X range: $0…$F Warning: this routine does not set ROM/RAM reading








KERNAL FC89 * Long jump routine: JMP ($05F0) on bank X
.X = bank; For executing routine: $5F2=.A; $5F3=.X; $5F4=.SR $5F2=.A; $5F3=.X; $5F4=.SR Execute routine addressed on $05F0 of bank .X, using values on $5F2..$5F4








KERNAL FCB0-FCB2 * JMP ($05F0)












KERNAL FCB3 * Main IRQ/BRK interrupt entry point IRQ/BRK

Save registers on stack then JMP $CE00








KERNAL FCB8 * Long IRQ routine


… set Kernal ROM and jump to $CE00









FCBE * End of IRQ routine and return
$FB = bank where return to
Restoring bank#, .Y, .X, and then RTI








KERNAL FCC9 * ROM-map switch (cartridge entry point)
$FB = bank where ROM resides; $02FE = address











FCD1-FCEC * Test CBM-CTRL-W pressed key when reset (Warm reset)













FB70?-FCFF * Area used for buffering last PRINT text


Store characters from top to down of memory (so that the last character of the string is always in $FCFD). If PRINT constant: FCFE=string lenght; FCFF=$FF. If PRINT variable: FCFE, FCFF = address inside string variable.









FCEF-FCF0 * OS96 release version


(low/high)








KERNAL FCF1-FCF3 * JMP to IRQ routine for cartridge ("SRT" entry) SRT

Jump to $FCC9








KERNAL FCF4-FCF6 * JMP to PHOENIX routine (cartridge reenable) Page in Roms & check them.


Jump to $FC59








KERNAL FCF7-FCF9 * JMP to LONG FETCH routine


Jump to $FC7F








KERNAL FCFA-FCFC * JMP to LONG JUMP routine


Jump to $FC89








KERNAL FCFD-FCFF * JMP to LONG IRQ routine


Jump to $FCB8 Bits: 7 6 5 4 3 2 1 0
I/O FD00 * ACIA uP 6551A / 8551 chip (used for RS-232 - missing on C16)
The least significant two bits of the address will choose the mode, which may be set for transmit/receive, receive status, or programming of either the command register or the control register (Read more on I/O Tables tab)
Register #0 - DATA port WARNING: due to incomplete wiring of the motherboard the four LSBs of addresses to this chip are left out and addresses are propagated to next memories by a step of 4. Then writing on $FD00 will also write to $FD04, $FD08, $FD0C. (Example 2: writing to $FD01 will also write to $FD05, $FD09, $FD0D).
Data bit 7 Data bit 6 Data bit 5 Data bit 4 Data bit 3 Data bit 2 Data bit 1 / Mode Data bit 0 / Mode
I/O FD01 * ACIA uP 6551A / 8551 chip (used for RS-232 - missing on C16)


Register #1 - STATUS port
Break detected DSR signal missing unused CTS signal missing (0=transmit is enabled) unused Receiver buffer overrun Framing error Parity error
I/O FD02 * ACIA uP 6551A / 8551 chip (used for RS-232 - missing on C16)


Register #2 - COMMAND port








I/O FD03 * ACIA uP 6551A / 8551 chip (used for RS-232 - missing on C16)


Register #3 - CONTROL port








I/O FD04-FD07 * Copy of ACIA


See note for $FD00








I/O FD08-FD0B * Copy of ACIA


See note for $FD00








I/O FD0C-FD0F * Copy of ACIA


See note for $FD00








I/O FD10-FD1F * CAS Parallel/User port (SPI uP 6529B chip)


1 Register for drives. 8 I/O lines on +4 UserPort Bits: 7 6 5 4 3 2 1 0
I/O FD10 * Only Plus/4: PIA 6529B (MOS SPI) drives 8 I/O lines on +4 user port
It permits 7 bits of either input or output, depending upon the status of the Read/Write line (Read notes about the remaining bit) User port of SPI (P0…P7 are mapped as bits 0…7). To set input, write 1 on proper bit. Result will be a +5 V in that connection. C16 and C116 ONLY: Bit 2 is connected with CST on cassette device (if =0 then either PLAY/REW/FF button is pressed) - To use all 8 bits of this port, the cassette device must have no key pressed. (The Plus/4 has connected it to bit 7 at $0001).





C16 only: Cassette sense IN (1=no pressed key)

I/O FD11-FD1F * Copies of $FD10 (read notes here rightmost)


When you use address $FD10, all the following bytes ($FD11… $FD1F) become a copy of it. ONLY FOR +4; C16/C116 are free memory








HARDWARE FD11-FD12 * Internal Printerport / Centronics (by Solder)
The eighth bit, bit two to be exact, is used as the cassette sense input.










HARDWARE FD13-FD14 * Switching (low/high) for OS96 (by Solder)



Bits: 7 6 5 4 3 2 1 0
HARDWARE FD15 * Control Register for 256Kb Expansion (by Csory)


This register must be initialized before to activate the RAM expansion. The register can not be read then it is suggested to save a copy somewhere. Warning: when expansion is active, TED does continue to read from ROM-0-Hi (Kernal) even if you set another ROM. Bits purpose ------> Select the visible window: (from 0 to 3): %00 = window 0; %01 = window 1; %10 = window 2; %11 = window 3.
Select bank #: From %0000 to $1111 selectable banks: #0 <--> #15
HARDWARE FD16 * RAM control register for 256Kb expansion (by Hannes/Solder) - plus compatibility setting for Csory version.
See rightmost bit table for single bit meaning.
The minimal area $0000 - $0FFF always remains common. Default is bank #3 (bank# 3; common area: $0000-$0FFF; TED access to any bank; no Csory card). Infact after reset all bits are "1". Bits purpose ------> Common area: 0 = $0000-$0FFF 1 = $0000-$3FFF TED access to bank: 0 = only to bank #3 1= any bank selected Hannes/Csory expansion type: %10 = Csory %00, %01, %11 = Hannes Warning: if there is no Csory connected expansion, these bits must be set %00 or %11

Select bank #: %00 = bank 0; %01 = bank 1; %10 = bank 2; %11 = Bank 3 (default)
HARDWARE FD17 * EPROM/sRAM expansion (Solder)


Sets the size and type of RAM expansion Bits purpose ------> External EPROM: 0 = enabled (internal banks A, F disabled); 1 = external EPROMs disabled (banks A, F on expansion port)


Expansion size: Select one of max 16 different sizes of expansion RAM: %0000=96 Kb; %0001=192 Kb; %0011=384 Kb; %0111=768 Kb; %1111= 1,5 Mb. --- If a smaller expansion is plugged, then areas are mirrored.
HARDWARE FD18-FD1F * Free if decoded. Could be a good place for a possible internal expansion (Solder)












HARDWARE FD20-FD2F * Decoded by PLA (pin 18)












HARDWARE FD20 * Command register for V364


Bit: 7 = Latch command 0 ---> 1 . ---> See bit pattern ---->
Latch command


Command code
HARDWARE FD21 * IRQ latch & status for V364


There are maybe 4 kinds of status (bits 0,1), and 2 kinds of signals: EOS End Of Speech (bit 6), Busy (bit 0?) . ---> See bit pattern ---->
DTRD EOS (End Of Speech)



Status 1 (FIFO?) Busy signal (?) and Status 0
HARDWARE FD22 * Speech data register for V364












HARDWARE FD23-FD2F * Other uses for V364


IF NOT V364: Decoded by PLA, only accessed by Kernal power-up routines - ROM initialization (set bit 7 = 1, during $CFA6 processing)








HARDWARE FD30 * SPI (uP 6529B) for Keyboard Columns Output Latch (the rows on the contrary come directly from TED)
Writing a datum will select the Column to be read (1=selected; 0= unselected) Maybe lower 4 bits are not considerated. Then read the same address to know if a key of this column was pressed. To select row, use 8 lines from TED ($FF08). Keyboard matrix connections: P0->15; P1->18; P2->7; P3->12; P4->11; P5->10; P6->5; P7->1. Read "I/O tables" tab of SVS-Ultimate Map for working info








HARDWARE FD31-FD3F * Copies of SPI 6529B


Copies of $FD30








HARDWARE FD40-FD5F * SID chip for SID cards (by Solder and by NST/BSZ) See $FD80 for card' registers.


Mirrored at $FE80








HARDWARE FD5E * DAC for Digiblaster


Stolen by SID card, because unused by SID chip / DAC on Digiblaster








HARDWARE FD5F * ADC for Digiblaster


Stolen by SID card, because unused by SID chip / ADC on Digiblaster








HARDWARE FD40-FD5F * SID registers for NST/BSZ card



Bits ---> 7 6 5 4 3 2 1 0
HARDWARE FD40 * (channel 1)


Write only Channel 1 Frequency (bits 0…7)
HARDWARE FD41 * (channel 1)


Write only Frequency (bits 8…15)
HARDWARE FD42 * (channel 1)


Write only Pulse width (bit 0…7) [for square waveform]
HARDWARE FD43 * (channel 1)


Write only



Pulse width (bits 8…11)
HARDWARE FD44 * (channel 1)


Write only Noise Pulse (square) waveform Sawtooth waveform Triangle waveform Test Ring modulation with channel 3 Synchroni-ze with channel 3 Gate (1=starts sound; 0=finishes sound)
HARDWARE FD45 * (channel 1)


Write only Attack duration (bits 0…3) Decay duration (bits 0…3)
HARDWARE FD46 * (channel 1)


Write only Sustain level (bits 0…3) Release duration (bits 0…3)
HARDWARE FD47 * (channel 2)


Write only Channel 2 Frequency (bits 0…7)
HARDWARE FD48 * (channel 2)


Write only Frequency (bits 8…15)
HARDWARE FD49 * (channel 2)


Write only Pulse width (bit 0…7) [for square waveform]
HARDWARE FD4A * (channel 2)


Write only



Pulse width (bits 8…11)
HARDWARE FD4B * (channel 2)


Write only Noise Pulse (square) waveform Sawtooth waveform Triangle waveform Test Ring modulation with channel 1 Synchroni-ze with channel 1 Gate (1=starts sound; 0=finishes sound)
HARDWARE FD4C * (channel 2)


Write only Attack duration (bits 0…3) Decay duration (bits 0…3)
HARDWARE FD4D * (channel 2)


Write only Sustain level (bits 0…3) Release duration (bits 0…3)
HARDWARE FD4E * (channel 3)


Write only Channel 3 Frequency (bits 0…7)
HARDWARE FD4F * (channel 3)


Write only Frequency (bits 8…15)
HARDWARE FD50 * (channel 3)


Write only Pulse width (bit 0…7) [for square waveform]
HARDWARE FD51 * (channel 3)


Write only



Pulse width (bits 8…11)
HARDWARE FD52 * (channel 3)


Write only Noise Pulse (square) waveform Sawtooth waveform Triangle waveform Test Ring modulation with channel 2 Synchroni-ze with channel 2 Gate (1=starts sound; 0=finishes sound)
HARDWARE FD53 * (channel 3)


Write only Attack duration (bits 0…3) Decay duration (bits 0…3)
HARDWARE FD54 * (channel 3)


Write only Sustain level (bits 0…3) Release duration (bits 0…3)
HARDWARE FD55 * (filter)


Write only





Filter Cut frequency (bits 0…2)
HARDWARE FD56 * (filter)


Write only
Filter Cut frequency (bits 3…10)
HARDWARE FD57 * (filter)


Write only
Filter resonance (bits 0…3) Filter Ex In (1=filters the external audio input [DigiBlaster]) Filter Channel 3 Filter Channel 2 Filter Channel 1
HARDWARE FD58 * (filter)


Write only
Mute channel 3 High pass Band pass Low pass Volume (bits 3…0)
HARDWARE FD59 * (potX)


Read only
Pot X paddle (bits 0…7)
HARDWARE FD5A * (potY)


Read only
Pot Y paddle (bits 0…7)
HARDWARE FD5B * (Osc/Rnd)


Read only
Current channel 3 upper bits oscillator (bits 0…7) [random if set as noise]
HARDWARE FD5C * (Env3)


Read only
Current Envelope of Channel 3 (bits 0…7)
HARDWARE FD5D *













HARDWARE FD5E * (DigiBlaster) DAC


Write only
D/A DigiBlaster (bits 0…7)
HARDWARE FD5F * (DigiBlaster) ADC?












I/O FD60-FD7F * Expansion userports: Max 4 further userports (by Solder)












I/O FD60-FD63 * ACIA on card 1












I/O FD64-FD67 * ACIA on card 2












I/O FD68-FD6B * ACIA on card 3












I/O FD6C-FD6F * ACIA on card 4












I/O FD70 * 6529B chip emulation for card 1












I/O FD71-FD73 * Mirrors of $FD70












I/O FD74 * 6529B chip emulation for card 2












I/O FD75-FD77 * Mirrors of $FD74












I/O FD78 * 6529B chip emulation for card 3












I/O FD79-FD7B * Mirrors of $FD78












I/O FD7C * 6529B chip emulation for card 4












I/O FD7D-FD7F * Mirrors of $FD7C












HARDWARE FD80-FD8F * Joyport at SID card (by Solder) Read note at $FD8D to test which card is connected!


Bad decoded (notes by Solder)








HARDWARE FD80 * Effective address for joyport












HARDWARE FD81-FD8F * Mirrors of $FD80












HARDWARE FD80-FD8F * NST's Audio Extention card by NST/BSZ



Bits: 7 6 5 4 3 2 1 0
HARDWARE FD80 * (Joystick)


Default 1; if a direction or fire is detected the corresponding bit becomes 1
1 1 1 Joy FIRE Joy Right Joy Left Joy Down Joy Up
HARDWARE FD81 * (Joy + Pot)


Read only. Return true bits joyport situation whatever is the Mouse-mode
1 Joy "PotY" [Digital mouse: central button 0=pressed] [Analog mouse = always 1] Joy "PotX" [Digital mouse: right button 0=pressed] [Analog mouse = always 1] Joy FIRE [Mouse hit/click: 1351 / Atari / Atari left button = 0] Joy Right yes = 0 Joy Left yes = 0 Joy Down yes= 0 Joy Up yes = 0 [Mouse 1351 right button pressed = 0]
HARDWARE FD82 * (Mouse)


Read only
Mouse X (bit 7) Mouse X (bit 6) Mouse X (bit 5) Mouse X (bit 4) Mouse X (bit 3) Mouse X (bit 2) Mouse X (bit 1) Mouse X (bit 0)
HARDWARE FD83 * (Mouse)


Read only
Mouse Y (bit 7) Mouse Y (bit 6) Mouse Y (bit 5) Mouse Y (bit 4) Mouse Y (bit 3) Mouse Y (bit 2) Mouse Y (bit 1) Mouse Y (bit 0)
HARDWARE FD84-FD87 * n.c.












HARDWARE FD88 * (SID data)




Last SID (bit D7) Last SID (bit D6) Last SID (bit D5) Last SID (bit D4) Last SID (bit D3) Last SID (bit D2) Last SID (bit D1) Last SID (bit D0)
HARDWARE FD89 * (SID R/W and address)


Bits 0…4 works correctly only if SID is set at 985 kHz
Last SID R/W (0=write) 0 0 Last SID (bit A4) Last SID (bit A3) Last SID (bit A2) Last SID (bit A1) Last SID (bit A0)
HARDWARE FD8A-FD8C * n.c.












HARDWARE FD8D * (Config)


Write only. Possible read will return $00. To test: write here $E0, then read $FD8F: if result is $E0 the card is Synergy-type else is NST/BSZ-type.
Config (Comm. 7) Config (Comm. 6) Config (Comm. 5) Config (Comm. 4) Config (Comm. 3) Config (Comm. 2) Config (Comm. 1) Config (Comm. 0)
HARDWARE FD8E * (Settings)


Read only. Standard: $0C %00001100
PAL (0) / NTSC (1) 0 Mouse type (0=Amiga type 1=Atari type) Mouse mode (0=Analogic; 1=Digital) Digi-Blaster 8-bit D/A enable flag 0=off $FE80-$FE9F enable flag (1=enabled) $D400-$D41F enable flag (1=enabled) 0=886 kHz; 1=985 kHz
HARDWARE FD8F * (Info)


Read only.
Card type (0=PAL; 1=NTSC) Version Revision (bit 3, 2, 1) Revision (bit 0) / SIDM (0=8580; 1=6581)
HARDWARE FD90-FDCF * Free












HARDWARE FDD0-FDDF * Roms latch: select the configuration of ROMs viewable by O.S. - On schematic, this is the CLK/IN for 4 D-FlipFlops located in the 74LS175 chip ADDR CLK ROM low ROM high $8000-$BFFF $C000-$FFFF
Use: Wanted configuration can be set by writing on the appropriate address ($FDDx), the value of lower nibble of the same addesss (x)








HARDWARE FDD0 *

BASIC KERNAL
Example: To enable this config write $00 to $FFD0 (This is standard BASIC config)








HARDWARE FDD1 *

3+1 KERNAL
Unavailable on C=16








HARDWARE FDD2 *

CARTRIDGE 1 KERNAL
Example: To enable this config write $02 to $FFD2








HARDWARE FDD4 *

BASIC 3+1
Unavailable on C=16








HARDWARE FDD5 *

3+1 3+1
Unavailable on C=16 (This is 3+1 config)








HARDWARE FDD6 *

CARTRIDGE 1 3+1
Unavailable on C=16








HARDWARE FDD7 *

CARTRIDGE 2 3+1
Unavailable on C=16








HARDWARE FDD8 *

BASIC CARTRIDGE 1










HARDWARE FDD9 *

3+1 CARTRIDGE 1
Unavailable on C=16








HARDWARE FDDA *

CARTRIDGE 1 CARTRIDGE 1
Example: To enable this config write $0A to $FFDA








HARDWARE FDDB *

CARTRIDGE 2 CARTRIDGE 1










HARDWARE FDDC *

BASIC CARTRIDGE 2










HARDWARE FDDD *

3+1 CARTRIDGE 2
Unavailable on C=16








HARDWARE FDDE *

CARTRIDGE 1 CARTRIDGE 2










HARDWARE FDDF *

CARTRIDGE 2 CARTRIDGE 2










HARDWARE FDE0-FEBF * Reserved for further DMA disks (Free for additional drives, besides #8, #9)


1551 does not support them








HARDWARE FDE0-FDE1 * MIDI Interface (by Solder)












HARDWARE FDE2-FDE3 * Real Time Clock (by Solder - under development???)












HARDWARE FDE4-FDFD * Free













FDFE
Register on EPROM card












HARDWARE FDFF * sRAM card control register (by Solder)












HARDWARE FE00-FE7F * Free (Solder says: "Good for a RAM-expansion with 128 byte-window-mapping" or "Best place for a Ram drive")












HARDWARE FE80-FE9F * Mirror of $FD40 SID card (for compatibility with some Hungarian progs [Csory?]) and Stereo SID (by Solder)


See $FD40 for detailed info








HARDWARE FE9E * DAC for Digiblaster


Stolen from SID because not used








HARDWARE FE9F
ADC for Digiblaster


Stolen from SID because not used









FEA0-FEBF * Free?












HARDWARE FEC0-FEDF * Mapping of 1551 drive TIA (uP 6523A / 6525 inside the paddle) if allocated as device #9












HARDWARE FEC0 * Port A of TIA


DATA








HARDWARE FEC1 * Port B of TIA


STATUS








HARDWARE FEC2 * Port C of TIA


HANDSHAKE








HARDWARE FEC3 * Port A of TIA


DDR Data Direction Register PA








HARDWARE FEC4 * Port B of TIA


DDR Data Direction Register PB








HARDWARE FEC5 * Port C of TIA


DDR Data Direction Register PC









FEC6-FEC7 * (Not used)


$FE, $FE








I/O FEC9 * Open channel out












I/O FECC * Close I/O channels













FED0-FEEF * Free?












HARDWARE FEE0-FEEF * Mapping of 1551 TIA (uP 6523A/6525 inside the paddle) if allocated as device #8


STATUS








HARDWARE FEE0 * Port A of TIA


DATA








HARDWARE FEE1 * Port B of TIA


STATUS








HARDWARE FEE2 * Port C of TIA


HANDSHAKE








HARDWARE FEE3 * Port A of TIA


DDR Data Direction Register PA








HARDWARE FEE4 * Port B of TIA


DDR Data Direction Register PB








HARDWARE FEE5 * Port C of TIA


DDR Data Direction Register PC









FEE6-FEE7 * (Not used)


$00, $00








HARDWARE FEE8-FEEF * Copy of TIA












HARDWARE FEF0-FEF7 * Copy of TIA












HARDWARE FEF8-FEFF * Copy of TIA












HARDWARE FF00-FF1F * TED chip (uP 7360/8360)


Read more on "TED" tab









FF20-FF3D * Unused












HARDWARE FF3E * TED chip: ROM read enable switch ($8000-$FFFF)
Wirite a value (whatever) System reads from ROM Possible writings still go onto underneath RAM








HARDWARE FF3F * TED chip: RAM read enable switch ($8000-$FFFF)
Wirite a value (whatever) System reads from RAM Warning: before setting the system to read from RAM, you have to properly set the IRQ routine because it resides on ROM. If you don't have a new IRQ code on RAM, simply 1) disable the IRQ, 2) Set RAM reading, 3) Read the value from RAM, 4) re-enable the IRQ. (for example: SEI - STA $FF3F - LDA xxxx - CLI)








KERNAL FF49
JMP to define function key definition routine
$76 = key number; $22,$23 = Address of string; .A = string lenght
Jmp to $87C2








KERNAL FF4C
JMP to PRINT routine












KERNAL FF4F
JMP to PRIMM print message routine (print all following bytes till $00) INFOUT The chars following the JSR $FF47 must be the chars to be printed (last=$00)
Warning: do not exceed 255 chars of data!








KERNAL FF52
JMP to ENTRY (Monitor) routine












KERNAL FF80 T Release version of O.S.


Bit#7=1: Pal; Bit#7 =0:Ntsc









JUMP TABLE (common to all small CBM computers (C20, C64, etc.)














KERNAL FF81
JMP to CINT (Initialize screen editor) CINT Any Any Go to $D84E








I/O FF84
JMP to IOINIT (Initialize I/O devices) IOINIT Any Any (.Y maintains its previous value). Go to $F30B








KERNAL FF87
JMP to RAMTAS (Ram test). Clear pages 0, 2, 3, 4, 7; set F-keys; top and bottom of memory, open Cassette buffer, Screen to $0C00. RAMTAS Any Any Go to $F352








KERNAL FF8A
JMP to RESTORE (Restore vectors to initial values, IRQ and BRK to standard) RESTOR Any Any Go to $F2CE








KERNAL FF8D
JMP to VECTOR (Read/Set vectors by user) VECTOR CY=1:read; 0:set (.X, .Y = address of table [low/high]) If read: .X, .Y=address of table (low/high) Go to $F2D3








KERNAL FF90
JMP to SETMSG (Control O.S. messages) SETMSG .A: bit 6 control messages; bit 7= error messages. (0=disable; 1=enable) Examples: $C0 MONITOR messages; $80 direct BASIC messages; $00 running BASIC messages. $9A = .A; (.X and .Y maintain their previous values) Go to $F41A. Control message are like "LOADING", Error messages are like "SYNTAX ERROR", Monitor messages are like "I/O ERROR #4). Value $40 lonely (only control messages) is never used by OS.
1 = Error messages on 1= Control messages on





I/O FF93
JMP to SECND (Send SA after LISTEN) SECND JSR LISTEN, .A=secondary address ORed with: $F0=open; $60=re-open; $E0=close (ERR on ST) Go to $EE4D. For 1541-drive' O.S., the lower nibble determines the channel No. as follows: $0=Load; $1=Save; $2…$E= free; $F=Command)








I/O FF96
JMP to TKSA (Send SA after TALK) TKSA JSR TALK, .A=secondary address ORed with: $F0=open; $60=re-open; $E0=close (ERR on ST) Go to $EE1A. For 1541-drive' O.S., the lower nibble determines the channel No. as follows: $0=Load; $1=Save; $2…$E= free; $F=Command)








I/O FF99
JMP to MEMTOP (Set/Read top of memory) MEMTOP CY=1:read; 0:set (.X, .Y=address [low/high]) ($0533/$0534) If read: .X, .Y=address (low/high) Go to $F427








I/O FF9C
JMP to MEMBOT (Set/Read bottom of memory) MEMBOT CY=1:read; 0:set (.X, .Y=address [low/high]) If read: .X, .Y=address (low/high) .A maintains its previous value. Go to $F436








I/O FF9F
JMP to SCNKEY (Scan keyboard for a key hit, setup keyboard queue and Function key index) SCNKEY Any .A=ASCII code of pressed key ($FF=no key pressed) Go to $DB11. You can insert a JSR to this subroutine (under IRQ) to obtain a double keyboard speed.








I/O FFA2
JMP to SETTMO (Set timeout in DMA disk) SETTMO .A bit 7: 0=enable; 1=disable Any Go to $F423








I/O FFA5
JMP to ACPTR (Handshake serial bus or DMA disk byte in) ACPTR JSR TALK, (JSR TKSA) .A=character (ST=error codes) Go to $EC8B








I/O FFA8
JMP to CIOUT (Send a byte to serial bus or DMA disk using handshaking) CIOUT JSR LISTEN, JSR SECOND, .A=character (ERR on ST) All the registers (.A, .X .Y) maintain their previous values. Go to $ECDF








I/O FFAB
JMP to UNTLK (Send UNTALK to all devices on serial bus or DMA disk) UNTLK Any (ERR on ST) Registers .X, .Y maintain their previous values. Go to $EF3B








I/O FFAE
JMP to UNLSN (Send UNLISTEN to all devices on serial bus or DMA disk) UNLSN Any (ERR on ST) Registers .X, .Y maintain their previous values. Go to $EF23








I/O FFB1
JMP to LISTN (Send UNLISTEN to all devices on serial bus or DMA disk) LISTN .A=device No. (valid are: 4...31). $AE should been set with device number. (must if you're using a 1551 drive). (ERR on ST) Registers .X, .Y maintain their previous values. Go to $EE2C








I/O FFB4
JMP to TALK (Send TALK to all devices on serial bus or DMA disk) TALK .A=device No. (valid are: 4...31). $AE must be set with device No. too If any previous routine have not done it. (ERR on ST) Registers .X, .Y maintain their previous values. Go to $EDFA








I/O FFB7
JMP to READST (Return I/O STATUS byte) READST Any .A = Status byte (See table at "I-O tables" page) Go to $F41C








I/O FFBA
JMP to SETLFS (Set a logical file number, and prepare it to OPEN, LOAD or SAVE) SETLFS .A=logical file number (only needed by OPEN), .X=device; .Y=secondary address ($FF=none; for LOAD: $01 =stardard; $00=relocated) Any Go to $F413. All the registers (.A, .X .Y) maintain their previous values. Go to $F413. (The logical file number in .A can be ORed with 128 to add a linefeed every carriage return).








I/O FFBD
JMP to SETNAM (Set length and FN address) SETNAM .A=filename lenght (0 if no filename); .X, .Y = address of filename (low/high) Any Go to $F40C. All the registers (.A, .X .Y) maintain their previous values. Go to $F40C. Max lenght for filename is 16.








I/O FFC0
JMP to OPEN (Open logical file) OPEN JSR SETLFS, JSR SETNAM CY=1: error (.A error number). Output error message if enabled by SETMSG. ST flag is not affected (see CLOSE) Go thru $0318 (IOPEN) to $EF53 (OPEN)








I/O FFC3
JMP to CLOSE (Close logical file) CLOSE .A=logical file number CY=1: IEC will be not closed if command channel is used. (ERR on ST) Go thru $031A (ICLOSE) to $EE5D (CLOSE)








I/O FFC6
JMP to CHKIN (Set input channel) Designate the logical file as input channel CHKIN (JSR OPEN), .X=logical file number CY=1: error (.A error number). Output error message if enabled by SETMSG. Register .Y maintains its previous value. Go thru $031C (ICHKIN) to $ED18 (CHKIN)








I/O FFC9
JMP to CHOUT (Set output channel) Designate the logical file as output channel CHOUT (JSR OPEN) .X=logical file number CY=1: error (.A error number). Output error message if enabled by SETMSG. Go thru $031E (ICKOUT) to $ED60 (CHKOUT)








I/O FFCC
JMP to CLRCH (Close all I/O channels) and send UNLSN/UNTLK commands to possible open serial/DMA devices. Input device is reset to keyboard; output device is reset to screen. CLRCH Any Any Register .Y maintains its previous value. Go thru $0320 (ICLRCH) to $EF0C (CLRCHN)








I/O FFCF
JMP to BASIN (Return a byte from current input channel) Special function if input channel is keyboard (read "Notes" here right) CHRIN (JSR OPEN), (JSR CHKIN) only if device is not the keyboard .A=character, (ERR on ST). Go thru $0322 (IBASIN) to $EBE8 (BASIN). If input channel is keyboard: First call to this routine enables cursor and echoes all pressed keys (max is a whole screen [1000]) until a [Return]. Then routine returns with first character in .A. Call again the routine to retrieve all following characters (one by one) until it gives you $0D (Return) that is the signal of end.








I/O FFD2
JMP to BSOUT (Send a byte to Output channel). If output dev is screen then it prints the character (or executes the control code). CHROUT Prepare with JSR OPEN, JSR CHKOUT only if device is not the screen. .A=byte to be sent. $053B = color for character if device is screen. (ERR on ST) .A = same than input, except when output device is Cassette or RS232. Go thru $0324 (IBSOUT) to $EC4B (BSOUT). Control codes are accepted as input bytes too. You can even send screen-color codes (ex. $90=black) like user hits CTRL+code in order to change current color. Warning: the character is sent to ALL open serial devices in the bus, then take care to maintain closed unwanted channels.








I/O FFD5
JMP to LOADSP (Load or Verify from file) LOADSP JSR SETLFS, JSR SETNAM .A=0:load; 1:verify (.X, .Y = reload address - see note at $AD) IF ERROR: CY=1; error message; error code on ST. IF OK: CY=0; .X, .Y= End address+1 ($2D,$2E) Go thru $F043 (ILOAD) to $F04A (LOAD)








I/O FFD8
JMP to SAVESP (Save to file) SAVESP JSR SETLFS, JSR SETNAM .A=Zero-page address with indirect start address; .X, .Y = end address +1 (low/high) IF ERROR: CY=1; error message; error code on ST. IF OK: CY=0; .X, .Y= End address+1 ($2D,$2E) Go thru $F194 (ISAVE) to $F1A4 (SAVE) Go thru $0330








KERNAL FFDB
JMP to SETTIM (Set system clock) The supplied values are written in the area $A3, $A4, $A5. Read note about clock info. SETTIM .A, .X, .Y = new value (low, medium, high) Any Go to $CF2D. All the registers (.A, .X .Y) maintain their previous values. Go to $CF2D. Be warned that system clock is not automatically updated. Normally the clock increment is done every 1/60" (PAL systems use $7FD to adjust the value at 50 Hz).








KERNAL FFDE
JMP to RDTIM (Read internal clock) RDTIM Any .A, .X, .Y = counter (n/60") Go to $CF26








KEYBOARD FFE1
JMP to STOP (Scan if STOP key pressed) STOP Any Z=1: STOP pressed; else .A=last keyboard scan line Go thru $0326 (ISTOP) to $F265 (STOP) . Register .Y maintains its previous value. The routine simply looks at $91, a location updated by IRQ routine. If it sees that STOP was pressed, then it calls CLRCH and clears keyboard queue. This means that while IRQ is disabled, the routine is not reliable.








I/O FFE4
JMP to GETIN (Get character from current input channel queue) GETIN JSR CHKIN, JSR OPEN only if input chanel is different than keyboard .A=character ($00 if queue is empty) Go thru $0328 (IGETIN) to $EBD9 (GETIN). Warning! Possible disabled IRQ will be re-enabled.








I/O FFE7
JMP to CLALL (Close all channels [CLRCH] and logical files) CLALL Any (ERR on ST) Register .Y maintains its previous value. Go thru $032A (ICLALL) to $EF08 (CLALL)








KERNAL FFEA
JMP to UDTIM (Increment system clock by a tick). A tick is 1/60" but is adjusted by $7FD to 1/50" for PAL systems. UDTIM Any ($A3,$A4,$A5) +1 Register .Y maintains its previous value. Go to $CEF0. When counter achieves $4F1A01 (both PAL & NTSC) then system clock is reset to zero (The value means 24h:00':01":00/60)








KERNAL FFED
JMP to SCRORG (Screen organization) Return the numbers of columns/raws of text screen. SCRORG Any .X=n. of columns; .Y= n. of lines Go to $D834








I/O FFF0
JMP to PLOT (Read/Set X,Y current coordinates of cursor) PLOT CY=1:read; 0:set (.X, .Y = coordinates [x=line]) If read: .X=line; .Y=column Go to $D839. Warning: all possible windows-screen are reset if set option (CY=0). Lefter column is numbered 0. Top line is numbered 0.








I/O FFF3
JMP to IOBASE (Return location of start of I/O) IOBASE Any .X, .Y (low/high) Standard result is $00, $FD Register .A maintains its previous value. Go to $FC19

























KERNAL FFF6
Bank in ROM/Cold start BASIC (CLDSTRT) RESET If [STOP] key is pressed while routine is launched, then system enter into Monitor state, without affect memory content. System reset (but if STOP pressed, see here leftmost) Then JMP $F2A4 (RESET routine)








KERNAL FFF9 T Opcode of JMP (entry point to obtain: JMP $F2A4)


Contains: $4C








KERNAL FFFA
Vector (used for reset, not a true NMI)


Contains: A4 F2 ($F2A4)








KERNAL FFFC-FFFD
Vector (used for system hardware reset)


Contains: F6 FF ($FFF6)








KERNAL FFFE-FFFF
Vector (used for IRQ & BRK calls)


Contains: B3 FC ($FCB3)




























Fields with this backgound color mean expansions /upgrading of standard configuration.
Texts of this colour mean locations used by V364' speech system
Messages with this background color mean that address/function has to be verified.




























Kernal jump table (common to all CBM 8 bit machines)














Sheet 3: RAM

RAM map
Areas available for user' code
Areas available for user' code, but affected by reset
Release 2.1








Address(es) $ Area size Flags, Vectors, Temporary, Tables Label Bits Notes

7 6 5 4 3 2 1 0
START OF ZERO PAGE














SYSTEM 0000

DDR: Data Direction Register for the uP 7501 (8501) port addressed by location $0001 PDIR

Unconnected (always 0)
Serial Peripherals (%1111 enables all; %0000 disables all) For each pin: 0 = Input; 1 = Output
SYSTEM 0001

DR: Data Register pin status' of uP 7501 (8501) PORT Serial DATA in Serial clock IN / Cassette Write Cassette READ Cassette motor (1=off) Serial ATN out Cassette WRITE /serial CLK out Serial DATA out Only Plus/4: bit 6 is also connected (not inverted) with cassette WRITE (some source says it's bit 7). To obtain a Plus/4 working in C16 mode, just switch jumpers J8 , J9.
BASIC 0002

BASIC token to search for in BASIC stack / Flag for loops SCRHTK









BASIC 0003-0004

Temp for RENUMBER (new start address) ZPVEC1









BASIC 0005-0006

Temp for RENUMBER (step) ZPVEC2









BASIC 0007

Start character to search for, in BASIC text / End Of Line search CHARAC









BASIC 0008

Flag: End character to search for, in BASIC text / Search for quotes at string end ENDCHR









BASIC 0009

Save last TAB column / Screen colum position from last TAB/SPC TRMPOS









I/O 000A

Flag for load / verify VERCK







0 = load; 1 = verify See also at $0093
O.S. 000B

Pointer inside input buffer / Number of subscripts in array COUNT









BASIC 000C

Flag: default dimension for the Array DIMFLG







Default for unDIMed arrays = 11 or 11x11 or 11x11x11
O.S. 000D

Flag: datum type (string or numeric) VALTYP







$FF = string; $00 = numeric
O.S. 000E

Flag: number type (integer or FP) INTFLG







$80 = integer; $00 = floating point
BASIC 000F

Flag for DATA scan / Quote on LIST / Garbage collect DORES









BASIC 0010

Flag: User function call / FNx function / Subscript ref. to array SUBFLG









BASIC 0011

Flag: Input source (GET / READ / DATA) INPFLG READ GET
READ READ


$00 = INPUT; $40 ($43?) = GET; $98 READ
BASIC 0012

Flag: Compare result / Sign of TAN or SIN result (not as flag) TANSGN









BASIC 0013

Flag: I/O prompt / INPUT prompt / Current I/O channel (CMD logical file) number CHANNL







1 = prompt off
MATH 0014-0015

Temp: integer line number value LINNUM







V364: Serial number of the word to speak
BASIC 0016

Pointer: next space in temporary stack for strings TEMPPT









BASIC 0017-0018

Address of last string in temporary stack for strings LASTPT









BASIC 0019-0021

Stack for temporary strings (descriptor) TEMPST









O.S. 0022-0023

Temporary utility pointer /Auxiliary pointer 1 INDEX1









O.S. 0024-0025

Temporary utility pointer / Auxiliary pointer 2 INDEX2









MATH 0026-002A

Result of floating point multiply RESHO RESMOH RESMO RESLO







Bytes weight: HH HM LM LL (h=high; l=low)
BASIC 002B-002C

Pointer. Start of BASIC program TXTTAB









BASIC 002D-002E

Pointer: End of BASIC program +1; Start of variables area VARTAB









BASIC 002F-0030

Pointer: End of variables area +1; Start of arrays area ARYTAB









BASIC 0031-0032

Pointer: End of arrays area +1 / Begin of free RAM STREND









BASIC 0033-0034

Pointer: Current bottom point of strings area / End of free RAM+1 FRETOP







This value depends by how many strings are stored in memory. The string area grows from address pointed by vector $37,$38 downward to End-of-arrays address (vector: $31,$32). A garbage collection could free some space by cleaning temp strings. FRE(x) function perform it.
BASIC 0035-0036

Pointer to current string / Temporary pointer for strings FRESPC









BASIC 0037-0038

Pointer: Top (highest address) of BASIC memory +1 MEMSIZ









BASIC 0039-003A

Current BASIC line number CURLIN









BASIC 003B-003C

Pointer: current character on BASIC program / Previous BASIC line number (TXTPTR?)







Used by subroutine CHRGET ($0473), CHRGOT ($0479)
BASIC 003D-003E

Pointer: to BASIC stack for CONT FNDPTR









BASIC 003F-0040

Current command DATA line number DATLIN









BASIC 0041-0042

Pointer: address to current item on a DATA line DATPTR









BASIC 0043-0044

Vector: Routine INPUT / Pointer to source of GET / READ /INPUT INPPTR / INTTPR









BASIC 0045-0046

Current BASIC variable name VARNAM









BASIC 0047-0048

Pointer: address of data of current BASIC variable VARPNT









BASIC 0049-004A

Pointer: index variable for FOR...NEXT FORPNT









BASIC 004B-004C

Temp / Math operator table displacement / Y / Operator / Basic pointer OPPTR









BASIC 004D

Mask for comparison operation OPMASK




Smaller Equal Larger 1 = larger; 2 = Equal; 4 = Smaller
BASIC 004E-004F

Pointer to current FN descriptor / Variable of DEF FN DEFPNT









BASIC 0050-0051

Temp pointer for current string descriptor DSCPNT










0052

?










BASIC 0053

Flag: HELP or LIST HELPER









O.S. 0054

Jump to function - Code of JMP JMPER







After set $55, $56 you can use a JMP (or JSR) $0054 as a programmable jump.
O.S. 0055

(address LO for above) SIZE









O.S. 0056

(address HI for above) OLDOV









BASIC 0057

BASIC numerical work area TMPF1 TEMPF1









BASIC 0058-0059

BASIC numerical work area HIGHDS









BASIC 005A-005B

BASIC numerical work area HIGHTR









BASIC 005C

BASIC numerical work area










BASIC 005D-005E

BASIC numerical work area LOWDS









BASIC 005F

BASIC numerical work area / Byte 1 of address of array passed to USR() LOWTR







Example: USR(A$(2)) -> System puts in $60,$61 address of array A$()
BASIC 0060

BASIC numerical work area / Byte 2 of address of array passed to USR() EXPSGN







See above
MATH 0061

Floating point accumulator #1 exponent FACEXP









MATH 0062-0065

Floating point accumulator #1 mantissa / $64,$65 = Address of 3-bytes header of string passed to USR() / $64,$65 temp for float-->integer convertion FACHO, FACMOH, FACMO, FACLO







3-bytes header summary: 1'=string lenght 2',3' = absolute address of the string
MATH 0066

Floating point accumulator #1 sign FACSGN









MATH 0067

Pointer: Constant for series calcolus (series evaluation constant) / Number of terms in a series evaluation SGNFLG









MATH / RS232 0068

Floating point accumulator #1 overflow digit / RS232 output bit count / Cassette temp storage BITS









MATH 0069

Floating point accumulator #2 exponent ARGEXP









MATH 006A-006D

Floating point accumulator #2 mantissa ARGHO, ARGMOH, ARGMO, ARGLO









MATH 006E

Floating point accumulator #2 sign ARGSGN









MATH 006F

Result of signs comparing (ACC1 = ACC2) / (FAC1 = FAC2) / Pointer ARISGN









MATH 0070

Floating point accumulator #2 overflow / Low byte of mantissa of FAC1 (for rounding) / Lo order rounding FACOV









MATH 0071-0072

series evaluation pointer / Pointer cassette buffer FBUFPT







Double use of this area: see next lines
TAPE 0071

Count of character in tape I/O buffer 1BUFPT









TAPE 0072

RS232 input bits / Cassette temp storage area 2BUFPT









BASIC 0073-0074

Increment for AUTO (0= disabled) AUTINC









BASIC 0075

Flag: Graphic area allocated (10 KB) MDVFLG







0 = Not allocated; >0 Allocated / 1 = 10K reserved
KEYBOARD 0076

Key work area / Temp for MID$() KEYNUM









KEYBOARD 0077

Key work area / Temp for MID$() KEYSIZ









O.S. 0078

Temp storage for indirect load / Used as temp EOR indirect loads / Temp for MID$() SYNTMP









BASIC, DOS 0079-007B

DS$ (disk error message) descriptor DSDESC







Rumors say that the lack of clearing these vectors by $CD57 O.S. routine causes the so-called $28FF bug (read more on O.S. Map). Then, writing a $00 on cell $0079 before to save, gives good chances to avoid the bug.
BASIC 007C-0080

BASIC stack pointer / Top of BASIC stack (runtime) Saved data for GOSUB, FOR and DO (see at single command description on BASIC page for more info)








The stack resides from $06EC to $07AF.
BASIC 007C-007D

Top of run-time stacks TOS









BASIC 007E-007F

Temp for sounds (frequency 0…1023) / Used by COLOR command TMPTON









SOUND 0080

Temp parameter storage (Voice# -1) VOICNO









O.S. 0081

Flag: running on / off for commands interpreter RUNMOD 1 = running






$00 = direct mode; $80 = Basic program is running
DOS 0082

Flag used by DOS command POINT









GRAPHIC 0083

Current graphic mode GRAPHM Multicolor Split screen (5 text lines) HIRES and graphic mode (1=on) Bits not used $00 = Text screen; $20 = HiRes $60 = Split Hires $A0 = Multicolor $E0 = Split Multicolor Even if O.S. has a table at $C637-C63B of legal masks, any combined mode seems to be allowed. (untested modes: $80 = Multicolor -Bitmap; $B0 = Multicolor +Text -Bitmap; $40 = Only split?) See O.S. Map at $C637-C63B


Split HiRes


---Multicolor---



Split Multicolor

GRAPHIC 0084

Current color for drawing COLSEL
Luminance Color

GRAPHIC 0085

Color #1 for multicolor mode MC1
Luminance Color

SCREEN 0086

Foreground color FG
Luminance Color

SCREEN 0087

Max number of columns on screen SCXMAX









SCREEN 0088

Max number of rows on screen SCYMAX









GRAPHIC 0089

Flag: paint to left LTFLAG









GRAPHIC 008A

Flag: paint to right RTFLAG









GRAPHIC 008B

Flag: Stop painting if any non-background color is met STOPNB







$00 = same color; $80 = any non-backgound color
GRAPHIC 008C-008D

Pointer: Bitmap color GRAPNT










008E

Temp intermediate memory VTEMP1










008F

Temp intermediate memory VTEMP2









I/O 0090

Status flags after I/O operation (Kernal) STATUS







ST variable from BASIC See table of codes at I-O Tables
BASIC 0091

Flag: STOP key / Reverse key STKEY










0092

Temp SPVERR









I/O 0093

Flag: load or verify for Kernal LOAD routine VERFCK







$00 = load, $01 = verify See also at $000A
I/O 0094

Flag: Buffered serial output char / A char is ready to output on serial bus C3PO :-)







$00 = not buffered; $80 = buffered
I/O 0095

Buffered character for serial bus BSOUR









I/O 0096

Save .X for BASIN /Temporary register save area / Temp for Basic XSAV / RSAV









I/O 0097

Number of open files / Index for filetable LDTND









I/O 0098

Current input device / Input default device DFLTN







Normally = 0 (keyboard) See peripheral device table on I-O page
I/O 0099

Current output device (CMD) / Output default device DFLTO







Normally = 3 (screen) See peripheral device table on I-O page
I/O 009A

Flag: System messages (mainly I/O related) MSGFLG 1 = Error messages on 1 = Control messages on





$80 = only error messages; $C0 = error & system messages. See $FF90 jump routine. ($80=Basic; $C0=M/C Monitor; $00=Program)
I/O 009B

Current save address (low byte) / Tape pass 1 error log index / Pointer to start address of LOAD / Screen scrolling SAL / PTR1







Start memory address of just loaded file (OS96)
I/O 009C

Current save address (high byte) / Tape pass 2 error log correction index / Pointer to start address of LOAD / Screen scrolling SAH / PTR2







Start memory address of just loaded file (OS96)
I/O 009D-009E

End SAVE address +1 / LOAD address / End tape address / End program address EAL EAH







End+1 address of just loaded program (only with OS96?)

009F-00A0

Temp data area / cassette/serial work bytes T1









MONITOR 00A1-00A2

Vector for MONITOR / Temp data area / Tape timing T2









O.S. 00A3-00A5

RTC Real time software clock counter TIME







Bytes weight: HH MM LL. Incremented by IRQ routine (the timer counts 60 ticks for 1 second, also if PAL IRQ is 1/50"). Even if the 3 bytes could maintain the time of more than 3 days, system resets them to 0 after passed 1 day. Read more at $07FD
I/O 00A6

Used by serial bus routine (EOI on output) R2D2 :-)









TAPE 00A7

Byte to be read/write from/to tape (buffered) / Tape input byte buffer TPBYTE









I/O 00A8

Buffered serial input byte / Temp used by serial routine BSOUR1









SCREEN 00A9

Vector: to color for scrolling / Temp FPVERR









SCREEN 00AA

Vector: to color for scrolling / Temp / Used by serial routine to count bits (0…8) / Used for cassette routine DCOUNT









DOS 00AB

Current file name lenght FNLEN







File name string is stored at position addessed by $AF $B0
DOS 00AC

Number of current logical file LA









DOS 00AD

Secondary address of current logical file SA







If <> 0 then the load address is taken by first 2 bytes of file. If = 0 then .X .Y set the load address.
DOS 00AE

Device number of current logical file FA







See peripheral device table on I-O page
DOS 00AF-00B0

Pointer: current logical file name FNADR







$AB sets the lenght of name
TAPE 00B1

Counter of detected tape error(s) ERRSUM









I/O 00B2-00B3

Begin SAVE address / Begin address for I/O / Temp storing for END address for tape STAL STAH







Bytes weight: Low/High
I/O 00B4-00B5

Relocated LOAD address / Address of RAM to load / Tape load temporary address MEMUSS









TAPE 00B6-00B7

Pointer: start of cassette buffer / Load end address for tape TAPEBS









I/O 00B8-00B9

Address for VECTOR TMP2









TAPE 00BA-00BB

Temp for cassette I/O / Pointer: data to be written on tape / Parallel drive number / $BA: store CY for CLOSE WRBASE







- Constants of time for tape calculated by $E91D from initial short data block. They are used to fit $7B8, $7B9 (=$BA, $BB); $7BA, $7BB (=$BA, $BB)*2; $7BC, $7BD =$BA, $BB. - Used by $EDA9 (presence of 1551 drive) and $ECDF (send a byte to I/O) routines too.

00BB

OS96 PC-Link setting device








This location sets where the PC is connected for PC-Link system (by Solder). Possible values: 00 = Any 01 = Userport 30 = userport expansion at $FD60 32 = userport expansion at $FD64 34 = userport expansion at $FD68 36 = userport expansion at $FD6C
TAPE 00BC-00BD

Pointer: tape messages / Immediate string for primms IMPAR / IMPARM







Used by $FC00 routine too. Fixed values $41 $F5 (updated by IRQ?)
BANKING 00BE-00BF

Pointer: address of byte to be fetched for ROM banking FETPTR







Used by routine $FC7F. Fixed values $BC $00 (updated by IRQ?)
SCREEN 00C0-00C1

Text vector for scrolling / Temp / Temporary memory for scroll register SEDSAL









SCREEN 00C2

Flag: reverse text RVS







$00 = not; $12 = yes (reversed)
BASIC 00C3

Last cursor column for INPUT / Index to end of logical line for input INDX







See $00CA for current position after a PRINT/CHAR
SCREEN 00C4

Temp cursor line position at input start / X position from start LSXP









SCREEN 00C5

Temp cursor column position at input start / Y position for input LSTP









KEYBOARD 00C6

(Flag for SHFT/CTRL key input) / Pressed key code (matrix coordinates) / Shift mode for print SFDX







The green colored text meaning, even if taken from official Programmer's Reference Guide is probably wrong. $40 = no pressed key
I/O 00C7

Flag: input source / INPUT or GET from keyboard CRSW







$00 = keyboard; $03 = screen
SCREEN 00C8-00C9

Pointer: current screen line address PNT









SCREEN 00CA

Cursor column on the current logical line PNTR







Position in the row of next print, after a PRINT with semicolon or after a CHAR.
EDITOR 00CB

Flag: quote mode editing QTSW







$00 = no; $01 = yes (quote)
EDITOR 00CC

Temp for editor / Lenght of current screen line SEDT1









SCREEN 00CD

Current position of cursor line (The real - not the logical - line of cursor) TBLX









I/O 00CE

Last character I/O / Temp data area /Last character printed DATAX









EDITOR 00CF

Flag: Insert mode (and number of chars to be inserted) INSRT







$00 = not in insert mode

00D0-00E8 25
Free zero-page area











00D0-00D1

Serial number of word to be spoken, later transformed to the address FREE / FREKZP










00D2-00D3

Pointer address for speech parameter (?)











00D4-00D5

Data address for speech (?)











00D6-00D7

Data address for speech (?)











00D8-00E8

Free area (O.S. never uses it) / Unknown for speech










GRAPHIC SCREEN 00E9

Segment size for CIRCLE / Screen lines link table / Editor temp storage CIRSEG







360/sides of wanted polygon. That is to obtain a triangle: 120; to obtain a square 90; etc.
SCREEN 00EA-00EB

Address of current color line / Pointer to address of current screen color RAM location USER









KEYBOARD 00EC-00ED

Vector key scan table (indirect address) / Pointer to current keyboard decode table KEYTAB







$E026
KEYBOARD 00EE

Temp for key scan TMPKEY









KEYBOARD 00EF

Number of characters on keyboard buffer / Index to keyboard queue NDX







Buffer is stored at $527…$530 $00 = no character waiting in the buffer Lenght of buffer is set by $053F (max 10)
SCREEN 00F0

Flag: pause on screen (CTRL-S) STPFLG









MONITOR 00F1-00F2

Used by MONITOR (registers) TO









MONITOR 00F3

Used by MONITOR (zero-page address) CHRPTR









MONITOR 00F4

Used by MONITOR (zero-page address) BUFEND









TAPE 00F5

Cassette I/O checksum / Temp for parity checksum / Flag additional colons in Directory CHKSUM







OS96 Flag: 0 = Uses addtional colons in directory listing; 1 = Don't.
MONITOR 00F6

Used by MONITOR LENGHT









TAPE 00F7

Pass number for cassette I/O PASS









TAPE 00F8

Block type on cassette / Header found (=$01) for tape TYPE







While searching for a header for tape: $01=Found header searched for; $03=Found a different header
DOS 00F9

Flag: DMA device present? USEKDY 1= Write / Yes 1= Read





$00 = not; $80 present
KEYBOARD 00FA

Value of .X for fast STOP-key check XSTOP









BANKING 00FB

Number of the ROM bank currently enabled / Current bank configuration CURBNK







Its value is normally used for .X register in instruction STA $FDD0,X in order to select a ROM bank (default =0 standard Plus4; default =3 Solder 256K mod)
RS232 00FC
Free on C16 X-on character mode for RS232 I/O / Char to send for an x-on XON







Writing here a non null character will set XON mode (Free on C16)
RS232 00FD
Free on C16 X-off character mode for RS232 I/O / Char to send for an x-off XOFF







Writing here a non null character will disable XON mode (Free on C16)
EDITOR 00FE

Temp for editor (cursor line)










O.S. 00FF

Used for base address for indexing forward LOFBUF









END OF ZERO PAGE - START OF PAGE 1














SYSTEM 0100-01FF

CPU Stack - Since stack works downward, the following locations are rarely written by CPU, then O.S. uses them for other jobs: (see following) SYSSTK







Of course if someone uses too much the stack (for example for nested subroutines calls) it could happen that these locations are overwritten.
MATH 0100-010F 16
Buffer for floating point to string operations BASZPT / FBUFFR









I/O 0110-0112 3
Temp storage for .A, .Y, .X during I/O (save and restore) SAVEA, SAVEY, SAVEX







Order: .A, .Y, .X
KEYBOARD SCREEN 0113-0122 16
Table of the values for color-keys

Luminance Color See flag at $07F9 instead to read them from ROM. Initialized by O.S. Routine at $F3B5
(Not warranted) 0123-01CF 173
Exclusive for processor stack SYSSTK









O.S. 01D0-01FF 48
…cont Exclusive for processor stack










END OF STACK (PAGE 1) - START OF PAGE 2














MONITOR 0200-0258 89
Input buffer for BASIC and MONITOR BUF







Max 88 characters
BASIC 0259-025A

Previous BASIC line number OLDLIN /TEXTPTR)









BASIC 025B-025C

Pointer to address of current BASIC statement OLDTXT










025C

This location is reset to $00 if the Basic program was modified after STOP.








If $00 and user hits CONT then the system relays to CAN'T CONT ERROR.
DOS 025D

Loop counter for DOS










DOS 025E-026D 16
Buffer for disk file-name PNBUFR









DOS 026E

Lenght of disk file-name #1 DOSF1L









DOS 026F

Drive for disk file-name #1 DOSDS1









DOS 0270-0271

Address of disk file-name #1 DOSF1A









DOS 0272

Lenght of disk file-name #2 DOSF2L









DOS 0273

Drive for disk file-name #2 DOSDS2









DOS 0274-0275

Address of disk file-name #2 DOSF2A









DOS 0276

Logical address for DOS DOSLA









DOS 0277

Physical address for DOS DOSEA









DOS 0278

Secondary address for DOS (SA) DOSSA









DOS 0279-027A

Disk identifier (ID) DOSDID









BASIC 0280

Used by PRINT USING










DOS 027B

Flag for disk ID specified DIDCHK









DOS 027C

Buffer for disk output string DOSDTR







Parameters sent to disk (i.e. 0:FILENAME)
DOS 027D-02AC 48
Disk output string area DOSSPC









GRAPHIC 02AD-02AE

Graphic current x-coordinate XPOS







Example: $2AD=02; $2AE=01 to set x-coordinate to 258
GRAPHIC 02AF-02B0

Graphic current y-coordinate YPOS









GRAPHIC 02B1-02B2

Destination x-coordinate XDEST









GRAPHIC 02B3-02B4

Destination y-coordinate YDEST









GRAPHIC 02B5-02B8

Graphics calculation area / Graphic: absolute values of X, Y XABS, YABS










02B9-02BA

Graphic: sign of X / Reserved also for non-graphic O.S. operations XSGN









GRAPHIC 02BB-02BC

Graphic: sign of Y YSGN









GRAPHIC 02BD-02BE

Used by graphic FCT1









GRAPHIC 02BF-02C0

Idem FCT2









GRAPHIC 02C1-02C2

Idem ERRVAL









GRAPHIC 02C3

Idem LESSER









GRAPHIC 02C4

Idem GREATR









GRAPHIC 02C5

Current angle's sign ANGSGN









GRAPHIC 02C6-02C7

Current angle's sine SINVAL









GRAPHIC 02C8-02C9

Current angle's cosine COSVAL









GRAPHIC 02CA-02CB

Temp for distance routines / Temps for angle distance routine ANGCNT









BASIC GRAPHIC 02CC-02E3 24
Multi uses work area for: PRINT USING / DRAW(?) / BOX / CIRCLE / SHAPE as follows:










BASIC GRAPHIC 02CC

Placeholder / X coordinate of CIRCLE center / Placeholder XCENTR / XCORD1 / XCIRCL









BASIC GRAPHIC 02CD

Pointer to start (PRINT USING) / …cont X coordinate of CIRCLE center BNR / XCIRCL / XCENTR / XCORD1 / KEYLEN









BASIC GRAPHIC 02CE

Pointer to end (PRINT USING) / Y coordinate of CIRCLE center ENR / YCENTR / YCORD1 / YCIRCL / KEYNXT









BASIC GRAPHIC 02CF

Dollar (currency) flag (PRINT USING)/ … cont Y coordinate of CIRCLE center / SHAPE: Lenght of string variable DOLR / YCENTR / YCIRCL / YCORD1 / STRSZ









BASIC GRAPHIC 02D0

Comma flag (PRINT USING) / Rotation angle / X radius / Set SHAPE mode / Replace string mode FLAG / XDIST1 / BOXANG / XRADUS / GETTYP









BASIC GRAPHIC 02D1

Counter / Rotation angle / … cont X radius / String position counter SWE / XDIST1 / STRPTR









BASIC GRAPHIC 02D2

Sign exponent / Y radius / Old bitmap byte / Value of exponent USGN / YDIST1 / XCOUNT / YRADUS / OLDBYT









BASIC GRAPHIC 02D3

Pointer to exponent / … cont Y radius / Variable for new string or bitmap-byte UEXP / YDIST1 / XCOUNT / NEWBYT









BASIC GRAPHIC 02D4

Number of digits before decimal point / Rotation angle / Placeholder VN / XDIST2 / YCOUNT / ROTANG









BASIC GRAPHIC 02D5

Justify flag / … cont Rotation angle / SHAPE: lenght in X direction CHSN / XDIST2 / YCOUNT / XSIZE









BASIC GRAPHIC 02D6

Number of characters before decimal point (field) / Lenght of a BOX side / … cont SHAPE: lenght in X direction VF / YDIST2 / BXLENG









BASIC GRAPHIC 02D7

Number of characters after decimal point (field) / Lenght of a BOX side / SHAPE: lenght in Y direction NF / YDIST2 / BXLENG / YSIZE









BASIC GRAPHIC 02D8

+ / - flag (field) / Placeholder / Arc angle start / X2 coordinate / … cont SHAPE: lenght in Y direction POSP / XCORD2 / ANGBEG / DISEND









BASIC GRAPHIC 02D9

Exponent flag (field) / Placeholder / X2 coordinate / … cont Arc angle start / Temp for X size FESP / XCORD2 / XSAVE









BASIC GRAPHIC 02DA

Switch / CHAR: column conter / Arc angle end / Y2 coordinate / … cont Temp for X size ETOF / COLCNT / YCORD2 / ANGEND









BASIC GRAPHIC 02DB

Character counter (field) / CHAR: row counter / Y2 coordinate / … cont Arc angle end / Save shape string descriptor CFORM / ROWCNT / YCORD2 / STRADR









BASIC GRAPHIC 02DC

Sign No. / X radius * cosine (rotation angle) / … cont Save shape string descriptor / Preliminary character no. / Used by CHAR command CNO / STRCNT / XRCOS









BASIC GRAPHIC 02DD

Space/asterisk flag / … cont X radius * cos (rotation angle) / Bit index inside a byte BLFD / BITIDX









BASIC GRAPHIC 02DE

Pointer to beginning of field / Y radius * sine (rotation angle) / Temporary work locations BEGFD / YRSIN / SAYSIZ









BASIC GRAPHIC 02DF

Lenght of format string / … cont Y radius * sine (rotation angle) / …cont Temporary work lcoations LFOR









BASIC GRAPHIC 02E0

Pointer to end of field / X radius * sine (rotation angle) / …cont Temporary work lcoations ENDFD / XRSIN









BASIC GRAPHIC 02E1

… cont X radius * sine (rotation angle) / …cont Temporary work lcoations










BASIC GRAPHIC 02E2-02E3

Y radius * cosine (rotation angle) YRCOS









BASIC 02E4

High byte address of charaters-ROM address (for CHAR command) CHRPAG







$D0 = Set#1 (Capitals/Graphics) *Default* $D4 = Set#2 (Capitals/Lowercase)
BASIC 02E5

Temp for GSHAPE / Register for SHAPE LITCNT / BITCNT









BASIC 02E6

Flag mode for SCALE SCALEM







$00 = off; $01 = on
GRAPHIC 02E7

Flag for double width of graphic pixels WIDTH







If set to "1" then each pixel of all the graphic commands output (but CHAR) is horizontally doubled. The resolution does remain the same. Example: pattern 10100010 becomes 11110011.
BASIC GRAPHIC 02E8

Flag for BOX filling FILFLG









GRAPHIC 02E9

Temp for bit mask BITMSK









BASIC 02EA

Lenght of string NUMCNT









BASIC 02EB

Flag for TRON (BASIC tracing) TRCFLG







$00 = off; $FF = on
BASIC DOS 02EC-02EE 4
Temp for DIRECTORY T3, T4









GRAPHIC 02EF

Temp for graphics VTEMP3









GRAPHIC 02F0

No. of graphic parameters VTEMP4









GRAPHIC? 02F1

Flag for relative or absolute VTEMP5







$00 = absolute; $01 = relative
MATH 02F2-02F3

Vector for floating point -> integer (signed) convert routine ADRAY1







$9871
MATH 02F4-02F5

Vector for integer (signed) -> floating point convert routine ADRAY2







$9471

02F6-02FD 8
Free










BANKING 02FE-02FF

Vector for cartridge software startup / Vector for cartridge located functions BNKVEC







Used by routine $FCC9
O.S. 0300-0301

Vector for error managing routine IERROR







[$8686] .X must contain the error code
BASIC 0302-0303

Vector for BASIC warm start / Vector for BASIC command exec / Main BASIC program loop IMAIN







$8712
BASIC 0304-0305

Vector for tokenization BASIC keywords (crunch ASCII keyword text into token) ICRNCH







[$8956] You can obtain some tricks by POKing the following values: 22 ($16) = SYNTAX ERROR when enter a command; 77 ($4D) = OUT OF MEMORY ERROR when enter a command; 44 ($2C) = Freezes the Plus4;
BASIC 0306-0307

Vector for token PRINT / Vector for LIST routine (translating tokens into ASCII text) IQPLOP







[$8B6E] POKing $FF (255) causes hiding the BASIC code when LIST, $6E (110) does reveal.
BASIC 0308-0309

Vector for BASIC code executing / Vector for next character analysis on a BASIC program / Execute next BASIC token of BASIC program IGONE







[$8BD6]
MATH 030A-030B

Vector for arithmetic symbol evaluating / Evaluate a single term arithmetic expression / BASIC token evaluating IEVAL







[$9417]
BASIC 030C-030D

Vector to escape token crunch routine / Crunch HOOK vector / BASIC user token generation IESCLK







[$896A] Allows user to create new tokens ??? Or prepare token for USR() ???
BASIC 030E-030F

Vector to escape token PRINT routine / Vector: create keyword IESCPR







[$8B88]
KEYBOARD? 0310-0311

Vector to escape execute routine / Vector: prepare User token IESCEX







[$8C8B]
IRQ 0312-0313

Vector for vertical blank IRQ routine (from clock) ITIME







Standard: $CE42
IRQ 0314-0315

Vector of interrupt (IRQ) routine (from hardware), RAM located / Address for possible wedging IRQ routine CINV







Standard: $CE0E. Possible wedged routine must finish with a JMP $CE0E (to continue with standard IRQ routine) or to JMP $FCBE (to finish IRQ routine).
O.S. 0316-0317

Vector of break routine (when CPU processes a BRK code) CBINV







Standard: $F44C
I/O 0318-0331

O.S. Vectors










I/O 0318-0319

OPEN IOPEN







[$EF53]
I/O 031A-031B

CLOSE ICLOSE







[$EE5D]
I/O 031C-031D

CHKIN ICHKIN







[$ED18]
I/O 031E-031F

CHOUT ICKOUT







[$ED60]
I/O 0320-0321

CLRCH ICLRCH







[$EF0C]
I/O 0322-0323

BASIN IBASIN







[$EB08] This indirect jump to $EBE8 allows to intercept calls to $EBE0 coming from BASIN ($FFCF)
I/O 0324-0325

BSOUT IBSOUT







[$EC4B]
I/O 0326-0327

STOP ISTOP







[$F265] POKing $88 (136) disables BASIC programs to use STOP key; $42 (66) to re-enable; $44 (68) for odd FX.
I/O 0328-0329

GETIN IGETIN







[$EBD9]
I/O 032A-032B

CLALL ICLALL







[$EF08]

032C-032D

Free vector USRCMD







[$F44C (Monitor Break)]
I/O 032E-032F

LOADSP ILOAD







Standard value $F04A (Load a program)
I/O 0330-0331

SAVESP ISAVE







[$F1A4] >0331 FF disables SAVE function; >0331 F1 to re-enable.
TAPE 0332-03F2 193
Cassette device buffer TAPBUF









TAPE 0332

Filetype (0=Basic 1=ML)










TAPE 0333-0334

Start address (LO/HI)










TAPE 0335-0336

End address (LO/HI)










TAPE 0337-0346

Program name (16 characters)










TAPE 03F3-03F4

Number of characters to write on tape / Data lenght to be written on tape WRLEN









TAPE 03F5-03F6

Number of characters to read from tape / Data lenght to be read from tape RDCNT









RS232 03F7-0436 64 Free on C16 RS232 buffer (64 bytes) / Reserved for RS232 INPQUE







Free on C16
TAPE 0437-0454 30
Cassette I/O error stack (low bytes) ESTARL









TAPE 0455-0472 30
Cassette I/O error stack (high bytes) ESTAKH









BASIC 0473-0478

Subroutine to increment index and read next byte from RAM by ($3B),Y used by BASIC CHRGET







Space-charac+N439ters are ignored (the routine automatically reads the next character). Output: .A = character; CY=0 it is a numeral (0…9); CY=1 it is not a numeral character; Z=1 character is ":" or $00
O.S. 0479-0484

Like CHRGET ($0473) but without increment (read the same byte) CHRGOT







Output: .A = character; CY=0 it is a numeral (0…9); CY=1 it is not a numeral character; Z=1 character is ":" or $00

047B

Possible patch to force BASIC reading from ROM








Write here $3E in order to let BASIC temporarly read from ROM. (Standard value is $3F)
MATH 0485-0493

Subroutine to check for numeric input QNUM







Input: .A = character to check; CY=0 it is a numeral (0…9); CY=1 it is not a numeral character; Z=1 character is ":" or $00
O.S. 0494-04A1

Self-modifying routine to fetch RAM data via (.A),Y (read note of address $0498 for modification) INDSUB









O.S. 0498

Address of above routine (INDSUB) to use for a trick (see notes)








To fetch directly from ROM write here a $2C (44). (To restore standard RAM fetching write $8D).
O.S. 0499

Possible patch to force BASIC reading from ROM (as an alternative to previous line trick)








Write here $3E in order to let BASIC temporarly read from ROM. (Standard value is $3F)
BASIC 04A2-04A4

Zeroes ($00 00 00) for Basic ZERO









BASIC 04A5-04AF

Fetch RAM under ROM via BASIC text pointer ($3B),Y then restore ROM viewing INDTXT









O.S. 04B0-04BA

As above but via ($22),Y (Index and Index1) INDIN1









O.S. 04BB-04C5

As above but via ($24),Y (Index2) INDIN2









O.S. 04C6-04D0

As above but via ($6F),Y (String1) INDST1









O.S. 04D1-04DB

As above but via ($5F),Y (Lowtr) INDLOW









O.S. 04DC-04E6

As above but via ($64),Y (Facmo) INDFMO









O.S. 04E5

Executes CLI then RTS










BASIC 04E7

PRINT USING symbol for blank PUFILL







Default = [space]
BASIC 04E8

PRINT USING symbol for separator between number groups (ex: 10,000) PUCOMA







Default = [,]
BASIC 04E9

PRINT USING symbol for decimal point PUDOT







Default = [.]
BASIC 04EA

PRINT USING symbol for currency symbol PUMONY







Default = [$]
BASIC 04EB-04EE

Temp for string functions i.e. INSTR() TMPDES









BASIC 04EF

Number of last error ERRNUM







$FF = no error happened
BASIC 04F0-04F1

Line number of latest error ERRLIN







$FFFF = no error
BASIC 04F2-04F3

TRAP line TRAPNO







$4F3=$FF means no trap
BASIC 04F4

Temp for TRAP TMPTRP









BASIC 04F5-04F6

Pointer to BASIC text producing latest error / Intermediate memory for TRAP ERRTXT









BASIC 04F7

Pointer to BASIC stack of last error OLDSTR









BASIC 04F8-04F9

Pointer to BASIC text for DO TMPTXT









BASIC 04FA-04FB

Line number for DO TMPLIN









BASIC 04FC

Sound duration 1 (low byte) / Table of pending jiffies (2' s comp) MTIMLO







(Jiffy = 1 AC supply clock cycle, that is 1/50" for PAL, 1/60" for NTSC)
BASIC 04FD

Sound duration 2 (low byte)










BASIC 04FE

Sound duration 1 (high byte) MTIMHI









BASIC 04FF

Sound duration 2 (high byte)










O.S. 0500

Code of JMP ($4C) for following USR function USRPOK







$4C
BASIC 0501-0502

Vector for jump to USR function (lo/hi) USRADD







$0501-$0502 = address of user defined function (if not set, then it aims to $991C illegal quantity error)
O.S. 0503-0507

Random (RND) function seed (starting) value RNDX







The value changes every time a RND() is executed (initial value: $00 FF FF 00 00)
O.S. 0508

Flag: cold/warm start status DEJAVU







$A5 = warm (modified by $F3B5 routine)
I/O 0509-0512

Logic files table (table of OPEN logical file numbers) LAT









I/O 0513-051C

Table of OPEN device numbers / Primary addresses table FAT









I/O 051D-0526

Table of OPEN secondary addresses SAT









KEYBOARD 0527-0530 10
Keyboard buffer / queue (managed by IRQ) (default = 10 characters max - see notes) KEYD KEYBD







Current character is indexed by $EF location Lenght of buffer is set at $053F (10 chars). The buffer logic is FIFO (first in first out).
O.S. 0531-0532

Bottom (start) of memory RAM for code MEMSTR







Default = $1000
O.S. 0533-0534

Top (end) of memory RAM for code MSIZ







Default = $FD00
DOS 0535

IEEE Timeout flag (DMA) / Timout of optional IEC-Bus (overrun) TIMOUT







Default = $FF
DOS 0536

EOF flag (DMA) (End of file reached?) FILEND







$01 = yes; $00 = not yet
DOS 0537

Number of bytes left in buffer for R/W operations CTALLY









DOS 0538

Valid bytes in buffer (only for Read operations) CBUFVA









DOS 0539

Pointer to next character in buffer for R/W TPBF









DOS 053A

Type of current tape file FLTYPE









SCREEN 053B

Current character / cursor Luminance/Color COLOR
Luminance Color

SCREEN 053C

Flash flag of current character / Cursor blink enable (0 = flashing) FLASH Flash on






$00 = normal; $80 = flashing

053D

Free










SCREEN 053E

Screen memory start (MSB) / Top page of screen memory HIBASE









KEYBOARD 053F

Lenght of keyboard queue / Maximum keyboard buffer size XMAX







Default content: $0A (10 characters) Buffer is at $0527; Index is at $EF
KEYBOARD 0540

Flag for key repeating RPTFLG







$00 = space, INST/DEL and cursor keys $40 = no key $80 = all the keys
KEYBOARD 0541

Counters for key repeats / Timing delay for key repeats KOUNT









KEYBOARD 0542

Timing delay for first key repeat DELAY









KEYBOARD 0543

Flag for pressed SHIFT-key and special-keys (could be combinated) SHFLAG




Ctrl C= Shift Together with last valid character pressed
KEYBOARD 0544

Pattern of last SHIFT/CTRL/CBM keypressed / Last SHIFT sample of keyboard LSTSHF









KEYBOARD 0545-0546

Vector for keyboard table setup routine / Pointer: Keyboard decoding table KEYLOG







$DB7A
KEYBOARD 0547

CBM+SHIFT keys enabling/disabling (character set switching) MODE 0 = enabled






$00 = enabled; $80 = disabled
SCREEN 0548

Flag for scrolling (not used?) / Screen scroll enable / Auto screen scrolling down flag AUTODN 0 = enabled








SCREEN 0549-054A

Temp used during screen output LINTMP, ROLFLG









MONITOR 054B

Used by MONITOR FORMAT









MONITOR 054C-054E

Used by MONITOR (assembler) MSAL









MONITOR 054F

Used by MONITOR (temp for assembler) WRAP









MONITOR 0550

Used by MONITOR (temp for assembler) TMPC









MONITOR 0551

Used by MONITOR (temp for assembler) DIFF









MONITOR 0552-0553

Register PC of MONITOR (high/low) PCH, PCL









MONITOR 0554

Register SR of MONITOR FLGS









MONITOR 0555

Register .A of MONITOR ACC









MONITOR 0556

Register .X of MONITOR XR









MONITOR 0557

Register .Y of MONITOR YR









MONITOR 0558

Register .SP of MONITOR SP









MONITOR 0559

Memory for MONITOR INYL









MONITOR 055A

Memory for MONITOR INVH









MONITOR 055B

Used by various MONITOR routines CMPFLG










055C

Tape input error log / Memory for various MONITOR routines BAD









KEYBOARD 055D

Number of characters left to get from function key definition KYNDX









KEYBOARD 055E

Pointer to current character in function keys definition KEYIDX









KEYBOARD 055F-0566 8
Table of lenghts of function keys definitions KEYBUF







Sequentially: F1 F2 F3 F4 F5 F6 F7 HELP
KEYBOARD 0567-05E6 128
Function keys definitions strings PKYBUF









DOS 05E7

Temp for data write (DMA) / Temp memory for data after DMA KDATA







These routines are named "Kennedy routines" because of their link with TED chip (resulting joke = Ted Kennedy)
DOS 05E8

Select Read or Write (DMA) RDYCMD








DOS 05E9

Device number (DMA) KDYNUM








DOS 05EA

Presence flag (DMA). One "Kennedy" device (ex. 1551) is present? RDYPRS FF = yes; 00 = no
DOS 05EB

Temp for open type (DMA) / Temp memory for DMA KDYTYP








BANKING 05EC-06EB

Banking routines










BANKING 05EC-05EF

Table of physical addresses for cartridge ROMs PAT









BANKING 05F0-05F1

Address for Long Jump executing routine with banking. Example: JMP ($05F0) LNGJMP







Vector used by $FCB0, or by routine $FC89 (long jump). Used by V364 IRQ routine mod too
BANKING 05F2

.A for long jump writing FETARG







Used by V364 IRQ routine mod too
BANKING 05F3

.X for long jump writing FETXRG







Used by V364 IRQ routine mod too
BANKING 05F4

.SR (status register) for long jump writing/ (.Y for long jump) FETSRG







Used by V364 IRQ routine mod too
BANKING 05F5-0604

Execute code on bank #5 at address $8003 AREAS









BANKING 0606-0608

…cont Execute code on bank #5 at address $8003










BANKING 0609-065D

…cont Banking RAM area











065E

Start of RAM for speech synthesizer APECH










065F-066D 15
Name of just loaded file











065E-067A 29
RAM reserved for speech software (never used) ASPECH










067B-067C

Utterance lookup table address (1st parameter from VOC keyword)











067D

Idem (2nd parameter) *unknown use*











067E-0683

BASIC vector backup location (6 bytes)











0684

?











0685-0688

Speech command buffer (?) (begin area)











0689

Speech speed (from RATE keyword)








Range: 1…10 (Default = 4)

068A-068D

Speech command buffer (?) (end area)











068E-069C

Read a byte from address space indirected by ($D2),Y








.X = ROM bank to read from; .Y = index; .A = read value (output)

069D-0675

Execute code (JSR $8483) on ROM bank #3











0676-068A

Self programmable code area (code copied from ROM #3 to RAM)








7501 mnemonics of this area are directly rewritten by the V364 O.S.

068B-0696

Set $05F0,$05F1 as long jump to $85ED











069D-06A7

Save .A, .X, .SR to $05F2, $05F3, $05F4











06A8-06BA

Execute a long jump (thru JSR $FCFA) on ROM bank #3 and return (using values of .A, .X, .SR stored in $05F2, $05F3, $05F4)











069D-06??
alternative use Speech ROM IRQ handler (begin area)











06A7-06A8
IRQ vector backup location











06A9-06BA
Speech ROM IRQ handler (end area)











06BB-06EB













BASIC 06EC-07AF 196
BASIC runtime stack / BASIC interpreter pseudo stack. It is used downward, that is for example: first entry $07AB-$07AF; second entry $07A6-$07AA;and so on. STKTOP







See on BASIC page, Basic Commands in order to read the structure of each entry (for GOSUB, FOR, DO). See pointers at $7C.

06F9-06FD

Temp for sending speech data











0707

Speech flag (more parameters coming?)











0708-0709














070A

Set to "3" from $8040 of Speech ROM











070B-070C














070D

Speech flag (?)











07AF

Top of BASIC runtime stack.










TAPE 07B0

Byte to write on tape WROUT









TAPE? 07B1

Temp parity calculation byte / Tape character parity PARITY









TAPE 07B2-07B3

Temp for tape header write TT1, TT2










07B4

Free










O.S. 07B5

Temp index for READBYTE routine RDBITS









O.S. 07B6

Pointer inside error stack ERRSP









TAPE? 07B7

Counter of errors on pass 1 (tape) FPERRS









O.S. 07B8-07BD

Constants for timing (intervals for tape data pulses) SAMP1, DSAMP2, ZCELL







$02 $01 $02 $02 $0d $02 (interval for tape data pulses) Initial values are copied from $E917…$E91C, then adjusted to tape data by routine in $E91D (see also $BA…$BB)
BASIC 07BE

Pointer to stack for STOP-key recover / Stack pointer for STOP-key SRECOV









KEYBOARD 07BF

Pointer to stack for drop key recover / Stack pointer for DROP-key (?) DRECOV









TAPE 07C0-07C3

Read block parameters / Parameters passed to RDBLOCK routine / Parameters sent after RDBLOK TRSAVE







Used only for tape routines.
TAPE? 07C4

Temp status saved for RDBLOCK routine RDETMP









TAPE? 07C5

Count of consec shorts pulses to find in tape data loader LDRSCN







Used by $E91D routine
TAPE? 07C6

Count of fatal read errors on RD contdown CDERRM









BASIC 07C7

Temp for VERIFY VSAVE









TAPE 07C8-07CB

Temp for tape I/O / Pipe temp for T1 T1PIPE










07CC

Read error propagate ENEXT









RS232 07CD
Free on C16 RS232 data character to send UOUTQ







Only Plus/4
RS232 07CE
Free on C16 RS232 flag for data character to send UOUTFG 1= yes





1= full $00 = no; $80 = yes / 0=empty; 1=full
RS232 07CF
Free on C16 RS232 control character to send SOUT9









RS232 07D0
Free on C16 RS232 flag for control character to send SOUNFG 1= yes





1= full $00 = no; $80 = yes / $00 = empty; $01 = full
RS232 07D1
Free on C16 RS232 pointer to current start of input queue INQFPT









RS232 07D2
Free on C16 RS232 pointer to current end of input queue INQRPT









RS232 07D3
Free on C16 RS232 current counter of input queue / Number of characters in input queue / RS232 pointer to output buffer INQCNT









RS232 07D4
Free on C16 RS232 status / Temp status for ACIA ASTAT







Copy from $FD01
RS232 07D5
Free on C16 Temp for RS232 character input / Temp for input routine AINTMP









RS232 07D6
Free on C16 RS232 flag for local hold off / Flag for local pause ALSTOP









RS232 07D7
Free on C16 RS232 flag for remote hold off / Flag for remote pause ARSTOP









RS232 07D8
Free on C16 RS232 flag for presence of ACIA APRES









O.S. 07D9-07E4

Indirect indexed RAM fetch routine via contents of $07DF / Indirect routine downloaded RLUDES / KLUDES







Before using this subroutine you have to set $07DF with the zero-page value where is stored the real address. Current value of .Y is used to index destination. (.A = read value: .X not affected)
SCREEN 07E5

Screen window: Bottom screen line SCBOT









SCREEN 07E6

Screen window: Top screen line SCTOP









SCREEN 07E7

Screen window: Leftmost screen column SCLF









SCREEN 07E8

Screen window: Righmost screen column SCRT









SCREEN 07E9

Flag to enable scrolling SCRDIS 1 = Scroll out








EDITOR 07EA

Flag for insert mode always on INSFLG







$00 = no; $FF = yes
O.S. 07EB

Last character printed LSTCHR / LSTCH









SCREEN 07EC

Temp for screen line management LOGSCR









SCREEN 07ED

Color of character under cursor (INST & DEL) TCOLOR 1 = Blink Luminance Color

SCREEN 07EE-07F1

Rows link table for screen BITABL







Warning: it is reset by use of windowing (CTRL-T, CTRL-B, etc.)
BASIC 07F2

.A for SYS command SAREG







Value to/from SYS subroutine
BASIC 07F3

.X for SYS command SXREG







Value to/from SYS subroutine
BASIC 07F4

.Y for SYS command SYREG







Value to/from SYS subroutine
BASIC 07F5

System Register (.SR) for SYS command / .SP for SYS command SPREG







Value to/from SYS subroutine
KEYBOARD 07F6

Index for key scan / Matrix coordinate of last key pressed LSTX







CHR$(n)
KEYBOARD 07F7

Flag for CTRL-S enabling STPDSB







$00 = enabled; any other = no / 6 = no
MONITOR 07F8

Flag: Bank for MONITOR fetches for addresses $8000… (sets Monitor to aim *all* next read operations from RAM or from ROM) / MSB for MONITOR fetches RAMROM 1 = RAM 1 = OS92' high ROM

Bank combination $00 = Read from ROM; $80 = Read from RAM (whatever set value, writing is always on RAM) Only with OS96: $40 = OS 96 ROM high $0x = Set bank combination ($00, $05, $0A, $0F) ($00 means BASIC+Kernal) see note at: $FC7B of O.S. map.
SCREEN KEYBOARD 07F9

Flag: Bank for color keys color/luminance values table (i.e.: CTRL-1, CTRL-2, etc) / MSB for color/lum. table COLSW 1 = ROM






$00 = RAM [default] ($0113-$0122); $80 = ROM (no modification allowed). System initialization uses routine at $F3B5 to copy on RAM the standard values (from ROM). (RAM = 0; ROM = 1)
GRAPHIC 07FA

ROM bit mask for split screen FFRMSK







content: $04 (modified by $F3B5 routine)
GRAPHIC 07FB

Screen memory mask for split screen / VM base mask for split screen / Video RAM mask for split screen VMBMSK







content: $18 (modified by $F3B5 routine)
TAPE 07FC

Cassette motor lock signal / Signal for cassette engine stop / Motor control of tape recorder LSEM










07FC

Parallel port setting (OS96 by Solder)








00 = Serial 01 = Special printerport with standard printer cable 02 = Userport with Centronics cable 60 = Extended userport address $FD60 64 = Extended userport address $FD64 68 = Extended userport address $FD68 6C = Extended userport address $FD6C
O.S. 07FD

Location used only by version PAL of the ROM (see note). Counter-down for cassette managing (0…4) / Time-of-day for PAL (not used). PALCNT







Used to fix jiffies count on PAL system to 50 per second. On NTSC systems this correction in not necessary

07FE-07FF

Free










SCREEN 0800-0BE7 1000
Luminance/Color screen map TEDATR Flash Luminance Color Bit 7: 1=flashing character

0BE8-0BFF 24
Free










SCREEN 0C00-0FE7 1000
Characters screen map TEDSCR (TEDSCN) Reverse Character code Bit 7: 1=reversed character

0FE8-0FFF 24
Free










END OF SYSTEM RAM














BASIC 1000

Start of BASIC program area (if graphic area is not allocated) BASBGN







Must always be $00; if not: SYNTAX ERROR

1000-17FF 2048
Free in BASIC graphic mode










GRAPHIC 1800-1BE7 1000
Hires screen luminances if graphic area is allocated BMLUM










1BE8-1BFF 24
Free in BASIC graphic mode










GRAPHIC 1C00-1FE7 1000
Hires screen colors if BASIC graphic area is allocated BMCOLR










1FE8-1FFF 24
Free in BASIC graphic mode










GRAPHIC 2000-3F3F 8000
Bitmap if graphic area is allocated by Basic GRAPHIC command











3F40-3FFF 192
Free in BASIC graphic mode










END OF MEMORY RAM on C=16














BASIC 4000

Start of BASIC program area (if graphic area is allocated)











4000-7FF4 16373
Available memory for BASIC code and variables











7FF5-7FFE 10
???








KERNAL custom ROMS initialization routine writes bank number in these locations.

7FFF

If 3+1 Roms are present, here will be the current bank configuration, else $FF.








The 3+1 initialization routine (at Plus4 start) copies here the value of $FB (typically $05). This happens even if 3+1 program is not started yet.
START OF RAM UNDER ROMs (Plus/4) or ONLY ROMs (C16)












Warning: to read the values from the following addresses of RAM, you have prieviously to write (whatever) to $FF3F. This is not necessay for write operations that always will affect the RAM.

8000-FCFF 32000
Available memory










I/O FD00-FEFF

Reserved for I/O










HARDWARE FF00-FF1F 32
RAM not available (system always "sees" the TED registers)











FF20-FF3D 30
Free










HARDWARE FF3E-FF3F

RAM not available (used for ROM/RAM read-mode setting)








Actually these locations are software switches to select if O.S. reads from ROM or from RAM. By writing whatever value on $FF3E you select ROM; on $FF3F RAM. (See "TED" page).

FF40-FFF5 182
Free











FFF6-FFFD

Copy of the ROM vectors (in the same addresses). They can be modified.








These copies of the corresponding ROM values can help to avoid problems when some system functions are called while RAM is set for address since $8000…

FFFE-FFFF

Free










END OF MEMORY on C= Plus/4






























The colored cells of first column mean locations suggested to put your M.L. code or data. These addresses come from my experience. Some of them are designed for special tasks (ex. RS232, TAPE, etc.). You have to choose them according to what tasks/devices you want to renounce.
Texts of this colour means locations used




by V364' speech system





























Fields with this backgound color mean expansions /upgrading of standard configuration.




























Sheet 4: TED & Music

Address

TED Registers map uP 7360, or 8360
Release 2.1

















$FFxx (65280)
























7 6 5 4 3 2 1 0 VIC-II of C64
Comments & notes














Countdown timer #1 reload value (bits 0-7) Frequency for all timers: 886,7 KHz (PAL); 894,9 KHz. (NTSC)
When this timer will achieve zero, an IRQ is set, then the previous-set value is reloaded















01 Countdown timer #1 reload value (bits 8-15)
(Always write LOW value before the high value. In this mode the low count do not start until the high byte is set).















02 Countdown timer #2 load value (bits 0-7)
When this timer will achieve zero, an IRQ is set, then it continues running















03 Countdown timer #2 load value (bits 8-15)
(Always write LOW value before the high value. In this mode the low count do not start until the high byte is set).















04 Countdown timer #3 load value (bits 0-7)
When this timer will achieve zero, an IRQ is set, then it continues running















05 Countdown timer #3 load value (bits 8-15)
(Always write LOW value before the high value. In this mode the low count do not start until the high byte is set).















06 I.C. Testing (must remain = 0) 1=Extended color mode (causes black screen [not a crash] if either Hires or MCL is on) 0=Blank screen (increases system speed up to 50% depending by system-frequency) 0=24 rows; 1=25 rows Vertical smooth-scroll position (0-7) [default=3] $D011 (bits 0…6) If Blank screen bit = 0, then double clock is used also between raster-lines 0-204 (visible area)















07 1=HW reversing characters off (enables further 128 characters on codes $80...$FF) 0=PAL; 1=NTSC 1=Halts horiz. & vertical Increments and timers. Clock switches to slow, Refresh continues (?). 1=Multicolor mode (cause black screen [not a crash] if either HiRes or Ext.Mode is on) 0=38 columns; 1=40 columns Horizontal smooth-scroll position (0-7) $D016 (bits 0…5)
















08 Read: Keyboard = bit 7 of Row; Joy #2 = Fire (0) Read: Keyboard = bit 6 of Row; Joy #1 = Fire (0) Read: Keyboard = bit 5 of Row; Read: Keyboard = bit 4 of Row; Read: Keyboard = bit 3 of Row; Joys = Right (0) Read: Keyboard = bit 2 of Row; Joys = Left (0) Write: 0 = Joy #1 Read: Keyboard = bit 1 of Row; Joys = Down (0) Write: 0 = Joy #2 Read: Keyboard = bit 0 of Row; Joys = Up (0)
Here you can read the latch of the Keyboard/joysticks. Write on bits 2, 1 to select one Joystick, or write any value for keyboard. Then read, here too, the result (keyboard gives here the row data; column data are available by $FD30 subroutine) - (Read more info in "I/O tables" tab)








09 IRQ flag (1=IRQ happened - in one of next bit 6, 4, 3, 2, 1) ($D019 bit 7) 1=Timer #3 achieved 0 NC 1=Timer #2 achieved 0 1=Timer #1 achieved 0 1=Light pen triggered (not implemented) ($D019 bit 3) 1=Raster equaled the value in Register #0B ($D019 bit 0) NC ($D019) Occured IRQs. Bit 7=1 means one or more of the enabled IRQ events occured. It must be cleared to detect new IRQs (write 1 to clear it). Be warned the bits 1, 2, 3, 4, 6 are updated even if they were not enabled by Register #0A. Only bit 7 is affected by contents of Register #0A.








0A NC 1=Enable IRQ detection when Timer#3=0 NC 1=Enable IRQ detection when Timer#2=0 1=Enable IRQ detection when Timer#1=0 1=Enable IRQ detection caused by light pen trigger ($D01A bit 3) 1=Enable IRQ detection when raster equals the selected value ($D01A bit 0) Raster line value generating IRQ (bit 8) ($D011 bit 7 write) ($D01A) ($D011) Set here what events will cause IRQ flag on (bit 7) in Register #09; Writing a $00 on this register, keyboard is disabled.










0B Raster line value generating IRQ (bits 0-7) $D012 (write) Set here the desired raster line value that will cause an IRQ (0-311 for PAL; 0-261 for NTSC). The 8th bit is on Register #0A. Visible raster lines are 4…203. When in 25-rows mode the first 3 scanlines are masked (first 7 scanlines in 24-rows mode).








0C NC NC NC NC NC NC Cursor position (bit 9) Cursor position (bit 8)
See Register #0D















0D Cursor position (bits 0-7)
See Register #0C for bits 8, 9. Valid positions are 0…999 (beyond 999 cursor is not visible)















0E Voice #1 frequency (bits 0-7) *
See below Music Tables for formula to calculate this value















0F Voice #2 frequency (bits 0-7) *
See below Music Tables for formula to calculate this value















10 NC (always 0?) NC NC NC NC NC Voice #2 frequency (bit 9) * Voice #2 frequency (bit 8) *

















11 0=Analogic mode; 1=Digital mode (constant output level for samples) (*** read notes) 1=Noise on (Voice #2) [Voice #3 for Basic] 1= Voice #2 on (if bit 6 is set to 1 output is noise) 1=Voice #1 on 1=Max sound level (ignores bits 0…2) Sound level (0...7)
To sample a sound, set to 1 the bit 7 and modulate the volume bits (3, 2, 1, 0). By setting bit 7 to 1 you can synchronize all voice generators: a) set bit 7 to 1; b) set a frequency for Voice#1; c) reset bit 7 to 0: all voices are synchronized. (***) The sound reload bit will clear the sound toggle flops and initiate the reload value of each voice to initialize the active sound count during the appropriate voice incrementing time. This bit will also initiate the white noise random number generator to "1".








12 NC NC Bitmap address (bit 15) ($D018 bit 7) Bitmap addr. (bit 14) ($D018 bit 6) Bitmap address (bit 13) ($D018 bit 5) Chars map & bitmap reading 0=from RAM; 1=from ROM Voice #1 frequency (bit 9) Voice #1 frequency (bit 8) (D018) It is not allowed to specify the bitmap address bits 0…12, then they default to 0. The possible addresses to be considered must be: $0000, $2000, $4000, $6000….$E000. See notes on Register #14 to have info about address of the Color-table of a bitmap.








13 Characters Description map address (bit 15) Characters description map address (bit 14) Characters description map address (bit 13) ($D018 bit 3) Characters description map address (bit 12) ($D018 bit 2) Characters description map address (bit 11) ($D018 bit 1) Characters description map address (bit 10 ). NC if HW reverse flag is "1" (Reg.# 07) or Extended Color Mode is "1" Processor clock PAL: 0=1,773 Mhz; 1=0,887 MHz NTSC: 0=1,432 MHz; 1=0,895 MHz CPU Banking status:. 0=RAM; 1=ROM (affects only reading) $D018 (bits 1…3) Address of Characters Description Map. Bits 0-9 are assumed be "0". Bit #0 of this register does not specify where TED reads for it: simply it gives the CPU banking status.








14 Screen matrix map (bit 15) Screen matrix map (bit 14) Screen matrix map (bit 13) ($D018 bit 7) Screen matrix map (bit 12). ($D018 bit 6). Screen matrix map (bit 11) ($D018 bit 5) NC (bit 10: consider it "1" to obtain the real address in case of Text screen) ($D018 bit 4) NC (but GRAPHIC command code maintains the value of this bit) NC (but GRAPHIC command code maintains the value of this bit) $D018 (bits 4…7) Address of memory area reserved for screen. TEXT SCREEN MODE: Characters are here saved as indexes to the Character Description Table (0=@, 1=A, 2=B...). The $400 bytes before this address are the Table of the attributes (colors, luminances and flash-flags). HIRES SCREEN MODE: The address of the register indicates the area of Hires Luminances table. Hires Colors table is located $400 bytes before. Default (Basic command GRAPHIC): Text-screen: $0C00; Hires-screen ($1C00).








15 NC Screen background color (high nibble = luminance; low nibble = color) - BASIC COLOR 0 (**) $D021? This register can be setup by Basic command COLOR 0,c,l (c=color code; l=luminance code)















16 NC Screen programmable color #3 (high nibble = luminance; low nibble = color) - BASIC COLOR 3 (**)
Used when Reg#6 bit 6=on (Extended color mode) or Reg#7 bit 4=on (Text multicolor mode) - This register can be setup by Basic command COLOR 3,c,l








17 NC Screen programmable color #1 (high nibble = luminance; low nibble = color)
Used when Reg#6 bit 6=on (Extended color mode) or Reg#7 bit 4=on (Text multicolor mode)















18 NC Screen programmable color #2 (high nibble = luminance; low nibble = color)
Used only when Reg#6 bit 6=on (Extended color mode)















19 NC Screen border color (high nibble = luminance; low nibble = color) - BASIC COLOR 4 (**) $D020 This register can be setup by Basic command COLOR 4,c,l















1A NC NC NC NC NC NC Pointer on text screen table (bit 9) Pointer on text screen table(bit 8)
See Register #1B















1B Pointer on text screen table (bits 0-7)
Upon completion of each row of text characters, this Register is incremented of 40















1C NC NC NC NC NC NC NC Current raster line (bit 8)

















1D Current raster line (bits 0-7) $D012 (read) A full screen has 312 raster lines (4...203 are for visible characters area) for PAL; 262 for NTSC.















1E Bit 8 of horizontal raster position Bit 7 of horizontal raster position Bit 6 of horizontal raster position Bit 5 of horizontal raster position Bit 4 of horizontal raster position Bit 3 of horizontal raster position Bit 2 of horizontal raster position (Read only bit) Always 0
Real range of horizontal raster is 0…455. Values of this register go from $00 to $E4. The value to be written to, has to be complemented to 2 (value read does not).








1F NC Blinking count (for cursor and blinking chars) increased once a frame Vertical relative line for characters (8 raster lines for each char). Read or write.
Blinking frequency is 2 Hz










































3E Write here to select CPU/TED readings from a ROM bank (Any writing operation still continues to achieve the underlaying RAM)
This is not a true TED register. Writing operation will set appropriate TED connections















3F Write here to select CPU/TED reading from RAM
This is not a true TED register. Writing operation will set appropriate TED connections

































































































NC = Bit not connected (read always "1", except bit 7 Reg# $10).


(**) in BASIC commands, color number must be n+1 (ex.: Red (2) must be written as 3)

























(click here to jump to Colors table on "Graphic-modes" sheet)

































































































MUSIC TABLES




















































(*) FORMULA BETWEEN FREQUENCIES / TED REGISTERS:

























f = (Phi/8)/(1024-((K+1) and 1023))

[credits: TLC]





















f = Frequency to output (note) (Hz)

























Phi = Effective clock frequency of the computer (quartz/scaling) (Hz)

























K = Value for use in Basic command SOUND(v,K,t)














































































HARDWARE FREQUENCIES: (Hz)

























HW version Crystal freq. Scaling Phi Effective Freq./8





















PAL 17,734,472 20 886,723.600 110,840.4500





















PAL-N 14,328,220 16 895,513.750 111,939.2188





















NTSC 14,318,181 16 894,886.313 111,860.7891

































































































































NOTES















































-Please select-

Pitch mode: S



















S Standard pitch




PAL PAL-N NTSC














V "Verdi" tuning

Music note Classic name Note Frequency (f) Value for TED (K) Deviation between obtained and aimed frequency (Hz) Value for TED (K) Deviation between obtained and aimed frequency (Hz) Value for TED (K) Deviation between obtained and aimed frequency (Hz) Noise (voice #3)















Octave 2 A LA 110.00 15 -0.04 5 -0.04 6 -0.01
















A# LA# 116.54 72 +0.01 62 -0.06 63 -0.02
















B SI 123.47 125 -0.04 116 -0.05 117 -0.00
















Octave 3 C DO 130.81 176 +0.05 167 -0.04 168 +0.02
















C# DO# 138.59 223 -0.04 215 -0.05 216 +0.02
















D RE 146.83 268 -0.02 261 +0.07 261 -0.03
















D# RE# 155.56 311 +0.11 303 -0.09 304 +0.02
















E MI 164.81 350 -0.11 344 +0.05 344 -0.07
















F FA 174.61 388 -0.06 382 +0.02 382 -0.10
















F# FA# 185.00 424 +0.04 418 +0.02 418 -0.11
















G SOL 196.00 457 -0.17 452 +0.04 452 -0.10
















G# SOL# 207.65 489 -0.08 484 +0.03 484 -0.12
















A LA 220.00 519 -0.08 514 -0.08 515 +0.20
















A# LA# 233.08 547 -0.22 543 +0.13 543 -0.04
















B SI 246.94 574 -0.08 570 +0.17 570 -0.01
















Octave 4 C DO 261.63 600 +0.40 595 -0.09 595 -0.27 The output sound is true "white noise" only in the range 600 <---> 940















C# DO# 277.18 623 -0.08 619 -0.10 619 -0.30















D RE 293.66 646 +0.35 642 +0.14 642 -0.06















D# RE# 311.13 667 +0.22 663 -0.19 663 -0.41















E MI 329.63 687 +0.25 683 -0.40 684 +0.34















F FA 349.23 705 -0.68 702 -0.51 703 +0.33















F# FA# 369.99 723 -0.52 720 -0.55 721 +0.41















G SOL 392.00 740 -0.34 737 -0.60 738 +0.49















G# SOL# 415.30 756 -0.17 753 -0.71 754 +0.54















A LA 440.00 771 -0.16 769 +0.71 769 +0.40















A# LA# 466.16 785 -0.44 783 +0.25 783 -0.07















B SI 493.88 799 +0.94 796 -0.76 797 +1.08















Octave 5 C DO 523.25 811 -0.42 809 -0.17 809 -0.54















C# DO# 554.37 823 -0.17 821 -0.22 821 -0.60















D RE 587.33 834 -0.87 832 -1.26 833 +1.41















D# RE# 622.25 845 +0.45 843 -0.37 843 -0.80















E MI 659.26 855 +0.50 853 -0.79 853 -1.26















F FA 698.46 864 -1.35 863 +1.16 863 +0.67















F# FA# 739.99 873 -1.05 872 +1.33 872 +0.81















G SOL 783.99 882 +2.11 880 -1.20 880 -1.75















G# SOL# 830.61 890 +2.78 888 -1.43 888 -2.01















A LA 880.00 897 -0.31 896 +1.41 896 +0.79















A# LA# 932.33 904 -0.90 903 +0.50 903 -0.16















B SI 987.77 911 +1.88 910 +2.84 910 +2.15















Octave 6 C DO 1046.50 917 -0.84 916 -0.34 916 -1.07















C# DO# 1108.73 923 -0.33 922 -0.42 922 -1.20















D RE 1174.66 929 +4.49 928 +3.65 928 +2.82















D# RE# 1244.51 934 +0.89 933 -0.74 933 -1.61















E MI 1318.51 939 +1.02 938 -1.58 938 -2.50















F FA 1396.91 944 +6.13 943 +2.33 943 +1.35
















F# FA# 1479.98 948 -2.11 947 -7.10 947 -8.13
















G SOL 1567.98 952 -6.85 952 +8.63 952 +7.52
















G# SOL# 1661.22 956 -6.88 956 +9.51 956 +8.34
















A LA 1760.00 960 -0.63 959 -10.95 959 -12.18
















A# LA# 1864.66 964 +13.99 963 +0.99 963 -0.31
















B SI 1975.53 967 +3.76 966 -11.68 966 -13.06
















Octave 7 C DO 2093.00 970 -1.67 970 +19.06 970 +17.58
















C# DO# 2217.46 973 -0.65 973 +21.32 973 +19.76
















D RE 2349.32 976 +8.99 975 -17.25 975 -18.89
















D# RE# 2489.02 978 -25.90 978 -1.48 978 -3.22
















E MI 2637.02 981 +2.04 981 +28.20 981 +26.33
















F FA 2793.83 983 -22.82 983 +4.65 983 +2.69
















F# FA# 2959.96 986 +35.73 985 -14.19 985 -16.26
















G SOL 3135.96 988 +30.91 987 -26.54 987 -28.72
















G# SOL# 3322.44 990 +36.36 989 -30.11 989 -32.42
















A LA 3520.00 992 +55.50 991 -21.90 991 -24.35
















A# LA# 3729.31 993 -34.63 993 +2.00 993 -0.62
















B SI 3951.07 995 +7.52 995 +46.76 995 +43.96
















Octave 8 C DO 4186.01 997 +77.08 996 -40.11 996 -43.02 Even if teoretically possible, the values of these notes are too much divergent from the aimed frequency















C# DO# 4434.92 998 -1.30 998 +42.65 998 +39.51















D RE 4698.64 999 -80.29 999 -34.51 999 -37.77















D# RE# 4978.03 1001 +60.17 1001 +110.12 1001 +106.55















E MI 5274.04 1002 +4.08 1002 +56.40 1002 +52.66















F FA 5587.65 1003 -45.63 1003 +9.31 1003 +5.39















F# FA# 5919.91 1004 -86.20 1004 -28.37 1004 -32.50















G SOL 6271.93 1005 -114.13 1005 -53.08 1005 -57.44















G# SOL# 6644.88 1006 -124.85 1006 -60.22 1006 -64.83















A LA 7040.00 1007 -112.47 1007 -43.80 1007 -48.70















A# LA# 7458.62 1008 -69.26 1008 +3.99 1008 -1.23















B SI 7902.13 1009 +15.05 1009 +93.53 1009 +87.93
















C DO 8372.02 1010 +154.17 1010 +238.69 1010 +232.66
















C# DO# 8869.84 1011 +366.86 1010 -259.13 1010 -265.16








































































The value for TED could be from 0 to 1023 (10 bits). [1022 is the highest, because 1023 acts like 0]


















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Sheet 5: PETSCII codes









PET-SCII UNIVERSAL CONVERTION TABLE





(Read operating notes)










Release 2.1






























CHR$ (decimal values) 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 ASC()

































Screen memory codes POKE Dec Hex 32 $2 48 $3 0 $0 16 $1 64 $4 80 $5

96 $6 112 $7 PEEK()
If one of these values is ORed with $80 (128) then the character will be printed in reverse. This value*8 is used as index from start position of Charset in memory

Obtained by:
CTRL+key Key SHIFT+key (as indicated) CBM+key Copy of columns $6 $7 Copy of columns $A $B (*) (*) = Not exactly the same than $B

Dec HEX coord. 0 1 2 3 4 5 6 7 8 9 A B C D E F


0 NUL NO KEY Tabulation CTRL-P space 0 @ P p

P
black CTRL-1 Shifted space CBM-A

P Shifted space




1 CTRL-A Set #2 CTRL-Q ! 1 A a Q q
A
Q Orange CBM-1 Set #1 CBM-E
A
Q





2 CTRL-B Reverse on CTRL-R CTRL-9 " 2 B b R r (same of $5D) B
R Flash on CTRL-< Reverse off CTRL-0 CBM-I CBM-R
B
R





3 STOP CTRL-C HOME CTRL-S # 3 C c S s
C
S RUN CLR CBM-T

C
S





4 CTRL-D DEL CTRL-T $ 4 D d T t
D
T Flash off CTRL-> INS CBM-@ CBM-H
D
T





5 white CTRL-E CTRL-2 Bold on CTRL-U % 5 E e U u
E
Function keys F1 brown CBM-2 CBM-G CBM-J
E






6 CTRL-F CTRL-= Bold off CTRL-V & 6 F f V v
F
V F3 yellow-green CBM-3 CBM + CBM-L
F
V





7 CTRL-G CTRL-W ' 7 G g W w
G
W F5 pink CBM-4 CBM-M CBM-Y
G
W





8 Graphic printing Disabling SHIFT-CBM CTRL-H Italic on CTRL-X ( 8 H h X x
H
X F7 blue-green CBM-5 CBM-U CBM-W
H
X





9 Enabling SHIFT-CBM CTRL-I Italic off CTRL-Y ) 9 I i Y y
I
Y F2 light blue CBM-6

CBM-O
I
Y





10 A LF CTRL-J Graphic char repeat CTRL-Z * : J j Z z

Z F4 blue CBM-7 CBM-N



Z





11 B Underline on CTRL-K ESC CTRL-[ + ; K k [
K
F6 light green CBM-8 CBM-Q CBM-F
K





12 C Underline off CTRL-L red CTRL-3 CTRL-£ , < L l £

L
F8 HELP purple CTRL-5 CBM-D CBM-C
L





13 D CR (Return) CTRL-M CTRL-] - = M m ]
M (the same of $42) Shifted CR
CBM-Z CBM-X
M (the same of $42)




14 E Set #2 enabling Enlarged print CTRL-N green CTRL-6 . > N n

N

Set #1 enabling yellow CTRL-8 CBM-S CBM-V
N






15 F Standard printing CTRL-O dark blue CBM-7 / ? O o


O


cyan CTRL-4 CBM-P CBM-B
O
































Legend:



Backgrounds Legend:
















MPS803 printer control codes (with updated ROM)



Characters SET #1 (capital letters + graphic signs) [hit CBM+Shift to switch]
















CTRL+key or CBM+key to obtain that character



Characters SET #2 (Capital and lowercase letters) [hit CBM+Shift to switch]
















Colors codes for text



Common characters to both the sets
















White arrows: cursor movements



OS96 Roms print these characters












































Only the symbols in this area are allowed in Extended Color mode



































Note: The graphic signs of Set#1 associated to capital letters ($61…$7A or $C1…$DA) are drawn on the Plus4 keyboard at bottom right of correspondent letter keys, and can be entered simply by hitting the key while holding [SHIFT].



































































































































HOW TO USE THE TABLE:



General rule: First column, then line.






































































column header

















1) Calculate hex value of a character:



Example: find code for "Z":






5
Result: $5A















To be used with M.L.



(Background yellow = set #1)



































row header A
Z

















































































































2) Calculate decimal value of a character:




Example: find code for "t":





80
Result: 80+4 = 84















To be used with CHR$() function




(Background cyan = set #2)



































4
t

















































































































3) Calculate decimal (or hex) screencode value of a character: Example: find code for "<":





48 $3
Result: 48+12















To be used with POKE function













Dec = 60
























12 C
<
Hex = $3C














































































































4) Calculate what is the character having its screencode: Example: find character for $46





64 $4



64 $4











To be used with PEEK function









































6
F

6



























Set #2



Set #1












































































5) Convert a hex value to decimal Example: Convert $7D





112
Result: 112+13 = 125
















(It is easier to use the Calculator below)










































7




























13 D

















































































































6) Convert a decimal value to hex Example: Convert 142





128
Process:
















(It is easier to use the Calculator below)












Column: 128 is the greater orange-colored header lower than 142




























8
Line: 142-128=14


























14 E

Result: $8E













































































































































HEX DEC calculator






























Fit the yellow input box(es) with your value(s)






























































Type A B


H83->H85 Hex->Dec









3 2


<--Potenza








Input Hex Dec


H87->H89 Dec->Hex








494 0 1 14 14











FE 240


00FE 1 2 3 4
<--Ordinale



494 238 14

<--Resti















0 0 F E




01EE 0 1 E E
















254 0 0 15 14



























3 2


<--Potenza



3 2


<--Potenza









Dec Hex


240 0 0 15 0




14 0 0 0 14










conv. 254 00F0



240 240 0

<--Resti



14 14 14

<--Resti














00F0 0 0 F 0




000E 0 0 0 E










results Hex Dec




























A+B= 01EE 494




























A-B= 000E 14































S\/S


























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Sheet 6: Graphic modes






GRAPHIC MODES




Release 2.1


























































This is the standard visualization of screen. 40 Columns x 25 lines of characters. Each character can have its own color (0..15) and luminance (0..7). Background color is the same for all characters. TEXT (40x25) 7 6 5 4 3 2 1 0
Areas default addresses used by BASIC:












Text screen matrix attribute bytes:







Characters codes:
$0C00-$0FE7
Attributes codes:
$0800-$0BE7






1= Flash on Luminance (0=dark...7=light) Color code (0=Black, 1=White, … see table below)
Black remains black whatever luminance value



































Text screen matrix character bytes:





















1 = Reverse (*) Pointer to the Character Description Table (0=@ ,1=A, 2=B, ...)
(*) If bit 7 of TED Register #07 is on, then no HW reverse is performed. This allows to point to further 128 characters in the table.






























This mode allows to set a different color for each pair of bits of each character. There are limitations: bits patterns 00, 01 and 10 set colors for all the characters in the screen. Actually only bits pattern 11 can set a different specific color for each character area (8x8 pixels). Bit 3 of each byte of "attributes area" is used as flag (0=Standard mode). This causes that available colors are 8 (0..7) for Multicolor characters and further 8 for Standard mode (8..15). Luminance has the usual 7 levels. TEXT MULTICOLOR (Bit 4 TED Register #07 is on) (40x25) 7 6 5 4 3 2 1 0
Areas default addresses used by BASIC:












Text screen matrix attribute bytes: (specifies only color code for "11" pair pattern) (**)







Characters codes:
$0C00-$0FE7
Attributes codes:
$0800-$0BE7






Ignored Luminance (0=dark 7=light) 1 = Multico-lor tile 0 = Stan-dard tile Foreground color code (0=Black, 1=White, ...). Colors go from 0 to 7.
While Multicolor mode is enabled, if bit 3 is off, the mode of that character switches to Standard, and its color ranges between 0 to 15. The bit 3 thus allows cohexistence of Multicolor and Standard modes in the same screen.














Black remains black whatever luminance value.












Text screen matrix character bytes:





















Pointer to the Character Description Table (0=@ ,1=A, 2=B, ...)
No reverse allowed.
No blinking (then no cursor).

































Bits pattern of a pair from Character map Resulting color/luminance value for each pair of bits (*)



















Luminance value from… Color value from…














00 Bits 4…6 of Background color (TED Reg.# $15) Bits 0…3 of Background color (TED Reg.# $15)
This color can be set by BASIC command COLOR 0,color,luminance (**)












01 Bits 4…6 of Background color #1 (TED Reg.# $16) Bits 0…3 of Background color (TED Reg.# $16)
This color can be set by BASIC command COLOR 3,color,luminance (**)












10 Bits 4…6 of Programmable color# 2 (TED Reg.# $17) Bits 0…3 of Programmable color# 2 (TED Reg.# $17)
This color can be set only by writing onto TED register #17












11 (**) Bits 4…6 of text screen Attribute area Bits 0…2, of text screen Attribute area







































This mode allows to set a different background color for each text characters. There are 4 possible backgound colors: bits patterns 00 shows the standard background color of screen (Basic command: COLOR 0,c,l); 01 shows TED register $16 (Basic command: COLOR 3,c,l); 10 shows TED register $17; 11 shows TED register $18. By changing one of those TED registers you can obtain the immediate changing of all the related background character over the screen. Bit 3 of each byte of "attributes area" is used as flag (1=Standard mode). This causes that available colors are 8 (0..7) for Extended Color Mode characters and further 8 for Standard mode (8..15). Luminance has the usual 7 levels. EXTENDED COLOR MODE (Bit 6 TED Register #06) (40x25) 7 6 5 4 3 2 1 0
Areas default addresses used by BASIC:












Screen matrix attribute bytes:







Characters codes:
$0C00-$0FE7
Attributes codes:
$0800-$0BE7






Ignored Luminance (0...7) [0=darker] 1=Extended color 0=Normal Color code of character (0=black, 1=White, …7=Yellow)
Warning: If either Multicolor or HiRes modes is enabled, the result is a black screen (not a crash). The graphic image still exists but is not visible.














Black color remains black whatever luminance value.












Screen matrix character bytes:


,



No reverse allowed.
No blinking (then no cursor).










Background color code (**) Pointer to the Character Description Table (0=@ ,1=A, 2=B, ...)
Since there are only 6 bits as character' pointer you can only use one of the first 64 characters (0=@, 1=A, 2=B…), and only from Character' set #1 (Capital letters)






Resulting color/luminance value for each pair of bits (*)



















Luminance value from… Color value from…














00 Bits 4…6 of Background color (TED Reg.# $15) Bits 0…3 of Background color (TED Reg.# $15)
This color can be set by BASIC command COLOR 0,color,luminance (**)












01 Bits 4…6 of Programmable color # 1 (TED Reg.# $16) Bits 0…3 of Programmable color # 1 (TED Reg.# $16)
This color can be set by BASIC command COLOR 3,color,luminance (**)












10 Bits 4…6 of Programmable color # 2 (TED Reg.# $17) Bits 0…3 of Programmable color # 2 (TED Reg.# $17)
This color can be set only by writing onto TED register #17












11 (**) Bits 4…6 of Programmable color # 3 (TED Reg.# $18) Bits 0…3 of Programmable color # 3 (TED Reg.# $18)
This color can be set only by writing onto TED register #18





































This mode allows the best resolution of Plus4 (320x200). There are limitations with color using. Inside each tile (area of 8x8) the pixels will have only the same color/luminance (16 colors * 7 luminances), but the background can be a color different from each other tile. No blinking allowed. BITMAP HI-RES (Bit 5 TED Register #06) (320x200) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Areas default addresses used by BASIC:


Bitmap: $2000-$3FFF
Bitmap data addressing:
Luminances codes:
$1800-$1BEF
Colors codes: $1C00-1FE7
Bits 5, 4, 3 of TED Reg.# $12 (Bitmap addess) Position of the tile (8x8 pixels) (0...999) Bits 2, 1, 0 of TED Register# $1D (Current raster line)
(The area from $1000 to $17FF is free and available for programs and variables)























COLOR table (TED Reg.# $14) default: $1C00





















7 6 5 4 3 2 1 0














Color code if bit of bitmap is "0" Color code if bit of bitmap is "1" Valid for each tile (8x8 pixels)




































LUMINANCE table (TED Reg.# $14 -$400) default: $1800





















Ignored Luminance code if bit of bitmap is "1" Ignored Luminance code if bit of bitmap is "0" Valid for each tile (8x8 pixels)






































This mode uses a resolution of 160x200 pixels (h/v), each of them has its own color. Inside each tile (4x8 pixels) you can use till 4 colors. The bitmap is a sequence of pairs of bits specifying one of the 4 colors available. Bits patterns 00 uses the standard background color (Basic command: COLOR 0,c,l); 11 uses TED register $16 (Basic command: COLOR 3,c,l). Patterns 01, 10 use values stored inside dedicated Color/Luminance areas. Modifications of the colors 0 or 3 will be applied to all the tiles. BITMAP MULTICOLOR (Bit 5 TED Register #06 & Bit 4 TED Register #07) (160x200) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Areas default addresses used by BASIC:


Bitmap: $2000-$3FFF
Bitmap data addressing:















Luminances codes:
$1800-$1BEF
Colors codes: $1C00-1FE7
Bits 5, 4, 3 of Reg.# $12 (Bitmap addess) Position of the tile (8x8 pixels) (0...999) Bits 2, 1, 0 of TED Register# $1D (Current raster line)
(The area from $1000 to $17FF is free and available for programs and variables)
COLOR table (TED Reg.# $14) default $1C00





















7 6 5 4 3 2 1 0








Erasing a line:




COLOR of ink 1 COLOR 2 of ink 2 Valid for each tile (4x8 pixels) only for patterns 01 and 10







Be warned that if you use color #1, #2 or #3 after you have set it like background color, you do not erase the line. Simply it is invisible but still existing. Then a possible new draw (with a new color) crossing the same tile, will "review" your old line. The right way to erase a line is to redraw it using ink #0.

















LUMINANCE table (TED Reg.# $14 -$400) default $1800















Ignored LUMINANCE of ink 2 Ignored LUMINANCE of ink 1 Valid for each tile (4x8 pixels) only for patterns 01 and 10






























Bit pattern on bitmap Resulting bitmap color/luminance value for each pair of bits (*)




















Luminance value from… Color value from… BASIC ink












00 Bits 4…6 of TED Register # $15 Bits 0…3 of TED Register # $15 0 (Screen background color - Common for all the tiles). Can be set by BASIC command COLOR 0,c,l (**)






01 Bits 0…2 of LUMINANCE table Bits 4…7 of COLOR table 1 This color can be set by BASIC command COLOR 1,c,l (**)






10 Bits 4…6 of LUMINANCE table Bits 0…3 of COLOR table 2 This color can be set by BASIC command COLOR 2,c,l (**)






11 Bits 4…6 of TED Register # $16 Bits 0…3 of TED Register # $16 3 Common for all the tiles. Set by BASIC command COLOR 3,c,l (**)


















































































Bitmap in BASIC:
Using GRAPHIC command to manage Graphic modes:










This command always sets as Bitmap address: $2000; and as Color-table address: $1C00 (then $1800 Luminance-table).






For use with Basic CHAR command,


These addresses can not be modified neither entering into Monitor while GRAPHIC command is on, because an automatic






see this table (click here)


routine restores their predefined addresses.

















































































Screen codes calculator























By this tool you can calculate the values for a memory cell, in order to set (or read) the colors / luminances / background in either Text, Hires or Multicolor screen.


























Calculate new values (fit yellow input cells):






Results: Dec Hex


6 12





COMMON VALUES to both the boxes

Text Column (0...39) Row (0...24) Chararcter color Character luminance
Blinking (0=off)
POKE 2165
$9A4,$A5 (set color, luminance, blinking)









Base addresses
Hires Foreground color Foreground lumin. Backgrnd color Backgrnd lumin.






2468 165





Hires/MCL attributes at $: 1800
Multiclr Color #1 Lumin. #1 Color #2 Lumin. #2
POKE 891
$1DA4,$5B (set colors)
6144 7588 91





Text attributes at $: 800
Input --> 20 10 5 11 7 POKE 7114
$19A4,$72 (set luminances)
7168 6564 114









The background becomes red when the parameter is out range










2048
































By this tool you can decode any screen memory value, retriving the colors / luminances / background / coordinates in either Text, Hires or Multicolor screen























Decode existing values
Inputs:
Results:



















(fit yellow input cells):
(HEX or decimal) Dec. 20 10 White (1) 13 Light green (15) 11 Hires or Multiclr
1
15











14 A 1 D F B














Hex Dec





















Colors address
7588







7588












Colors value
31







31












Lumin. address 19A4








6564












Lumin. value
189







189




















































































































































































































COLORS
















































Code Standard Colors at Plus/4 power up Standard luminance Keyboard combos
Red-Green-Blue codes

(**) in BASIC commands (except POKE), the color code-numbers must be added +1 (ex.: Cyan becomes 3+1 = 4)













Spec.key Num. key
RR GG BB
















0 Black 0 CTRL 1
-- -- --
















1 White 7 2
R- G- B

These codes are associated to numeric keyboard keys (ex: to set cursor white = [CTRL]+[2])













2 Red 3 3
RR -- --

The color codes (leftmost column) have to be added +1 for use in Basic (ex. to set yellow: COLOR 1,8,6. Yellow code is 7 then write 8)













3 Cyan 6 4
-- GG BB
















4 Purple 4 5
RR -- BB

The user can redefine them by writing new values in RAM from $0113 to $0122 and set the flag at $07F9 ($00= read from RAM)













5 Green 3 6
-- GG --

(Really some standard colors have bad luminance, so that a user' modification can make things better :)













6 Blue 4 7
-- -- BB
















7 Yellow 7 8
RR GG --
















8 Orange 4 CBM 1
RR G- --
















9 Brown 2 2
R- G- --
















10 Yellow green
5 3
R- GG --
















11 Pink 6 4
RR -- B-
















12 Blue green
5 5
-- G- BB
















13 Light blue
6 6
R- -- BB
















14 Dark blue
2 7
-- G- B-
















15 Light green
5 8
GG -- B-




















































































































SCREEN LAYOUT of single bytes of the Bitmap























Each tile (8 bytes) is located in place of a character position. Then we have 40 x 25 tiles, each 8 x 8 = 64 bits.
















































The hardware character generator works in the same way, taking for each character the proper group of 8 bytes from the memory character descriptor.


















































(Example: Start address of Bitmap = $2000)
















































Column 0 of tiles Column 1 of tiles Column 2 of tiles Column 3 of tales Column 4 of tales








Row 0 of tiles address: $2000 2008 2010










...2001 2009 2011










2002 200A 2012










2003 200B 2013










2004 200C 2014










2005 200D 2015










2006 200E 2016










2007 200F 2017










Row 1 of tiles 2140 2148













2141 2149













2142 214A













2143 214B













2144 214C













2145 214D













2146 214E













2147 214F













Row 2 of tiles






























































































































































































































































CHAR in Multicolor mode




The BASIC command CHAR can work in graphic modes too. But when in Multicolor mode, it sets the Color map of each touched tile in its way. A possible high resolution draw inside it can obtain undesired results.











how the command sets the Color map of each tile










































Bitmap: bit pattern referring to inks Bckgnd ink


















Command %00 %01 %10 %11
Examples:
















CHAR 0,x,y,T$ 0 1 2 3 2
CHAR 2,0,0," " sets tile colors: 00=ink#0; 01=ink#2; 10=ink#2; 11=ink#3; background=ink#2
















CHAR 0,x,y,T$,1 0 1 2 3 3
CHAR 2,0,0," ",1 sets tile colors: 00=ink#0; 01=ink#2; 10=ink#2; 11=ink#3; background=ink#3
















CHAR 1,x,y,T$ 0 1 2 3 0


















CHAR 1,x,y,T$,1 0 1 2 3 1


















CHAR 2,x,y,T$ 0 2 2 3 0
CHAR 2,0,0," " sets tile colors: 00=ink#0; 01=ink#2; 10=ink#2; 11=ink#3 (making impossible to show ink#1)
















CHAR 2,x,y,T$,1 0 2 2 3 2


















CHAR 3,x,y,T$ 0 3 2 3 0
CHAR 3,0,0," " sets tile colors: 00=ink#0; 01=ink#3; 10=ink#2; 11=ink#3 (making impossible to show ink#1)
















CHAR 3,x,y,T$,1 0 3 2 3 3











































Ink# used as foreground to draw

Ink# used as background




















each font character

to draw each font character






















Sheet 7: Bugs


PLUS/4 known Bugs

Release 2.0












Seriousness Problem From Solutions

Hard to detect, and to rebuild original data. MEMORY CORRUPTION after SCRATCH(ES). After intensive use of SCRATCH or (SCRATCH + DIRECTORY?) you could experience undesired writes of values $28, $FF at address $3058 (more rarely in $304C) See O.S. map at $CD57 KERNAL Rebuild the BASIC-line(s) interested in corruption (data or links). This needs a deep knowledge of BASIC lines structure. The bug seemes to be connected with memory cell $79 not correctly cleared; then writing $00 on it before the saving operation could give good chances to avoid the bug.

Part of original data are lost. WRONG COPIED DATA with T MONITOR COMMAND. If source and destination areas are (in part) laid one upon the other, and if destination area has an address higher than source area, then problem happens. (Command "T" always copies source data from start to end: instead of from end to start, as this case needs) MONITOR enviroment After happened, source and destination data result corrupted. To avoid the problem before it happens: 1) Copy segment in a far (temp) area (not laid); 2) Copy from new (temp) area to the wished destination.

You may need a reset! PROGRAM CORRUPTION using a LOADer. When a running BASIC program LOADs an overlay that ends at an higher address than Loader, it does not update the pointer of end-program/start variables. Existing variables are lost. New variables can overwrite new program' code. BASIC To avoid overwriting of code, first lines of new program have to properly set the pointers on $2D, $2E to the end of itself. To maintain the variables of first program, in order to be used by the second one, the first program has to set the pointer considering where the second program will end.

Possible damage of file structure and loss of data. READ WRONG DATA from REL-type file. You wrote inside a record the hex values $00 or $FF. These are used as flag-values in REL files ($00=End of data inside a record; $FF=empty record). CBM DOS 2A Hard to find a solution! This is not a real Plus4 bug, being a Drive-O.S. problem.

Crossed links can be rebuild, but overwritten data are lost. CROSSED LINKS ON DISK (1541). You used the @SAVE command (@=save and replace). Somebody thinks that problem happens only if you have less than n+2 free blocks on the disk when you run the command (n=new file lenght). Untested if bug exists in 1551 O.S. too. CBM DOS 2A (1551 may be free) 1) Save with a new filename; 2) Scratch previous file; 3) Rename the new file. This is not a real Plus/4 bug, being a Drive-O.S. problem.

Not reliable sending of data. INCOMPLETE TRANSMITTING DATA thru RS232. The process is finished even if more data are still to be received. The problem happened when the received byte is $00. All further bytes are ignored and routine exits. [See on O.S. at address $EAA7 - Credits: MikeZ] KERNAL 1) You have to test if inside the data to be sent there is a $00. If yes: 2) Convert each byte into 2 ASCII characters (UNPACK). For ex. $0B --> $30,$42 ("0","B"). 3) Transmit them, then deconvert them (PACK)

To solve it, you need to write without see. GARBAGE SCREEN when ERROR. BASIC Error routine reloads the standard address of characters table, but does not set TED banking on Rom. (The problem appears when an alternative character set is in use). BASIC and MONITOR environment (symbol "?") Type (without to see what you're writing): a) if you are in Monitor (or M.L.): >FF12 C4: [RETURN] . b) if you are in BASIC: POKE 65298,196: [RETURN]

To solve it, you need to write without see. GARBAGE SCREEN exiting MONITOR. "X" Command from Monitor reloads the standard address of characters table, but does not set TED banking on Rom. (Problem appears when an alternative character set is in use residing in RAM). MONITOR enviroment Type (without to see what you're writing): POKE 65298,196: [RETURN]


LOGIC ERROR IN FOR…NEXT. The first cycle is always performed even if limit variable is set with a value greater than initial value of control variable. BASIC Add the code with an IF statement before to execute the FOR…NEXT.


LOGIC ERROR IN INT() FUNCTION. When this funcion is called to work inside a negative value, then it still subtract decimal values until it reaches an integer value. The result is then -1 lower than correct. (For example INT(-2.1) = -3 instead of -2) BASIC If result is negative you have to add +1.

In printing case, you maintain all the records. ENDLESS cycles printing/sorting more than 255 RECORDS. Using 3+1 Software, you can have problems managing more than 255 records in the dataBase. 3+1 Use SW updated version (3+1 Extra or PlusGraph) or plug in TURBOPLUS cartridge

Unknown in detail what problems this bug causes PROBLEMS with RECORD LEN in REL-type file. You defined a forbidden lenght of record: in fact, for odd reasons, it seems that lenghts 42, 58, 63 cause bad managings. CBM DOS 2A Define longer records (48 -> 49, 58->59, 63->64) This is not a real Plus4 bug, being a Drive-O.S. problem.

Coders have to pay attention when they edit these restored lines LOST links in listed BASIC lines. If you windowise an area of screen, leaving out a BASIC listing, when you restore the fullscreen size, the old listed BASIC lines have lost their "screen links" (That is: if an old BASIC line continued on next screen line, now it ends at 40th character of screen line. Next line of data are not linked and should be lost if you press return over it). O.S. Before to windowise, split each "long" BASIC line into more lines lower than 41 characters each.

Code has to manage an exception to math operations when integer variables are involved. The value -32768 used in any integer variable or function, generates an "illegal quantity error". For example in: NOT(-32768); a%=-32768; k=32568: a%=k: print a%. Lower values (like -32769) simply give wrong results, without any error message. BASIC Must use FP variables

Basic program will have one/more wrong GOTO/GOSUB destinations After RENUMBER, one line of the Basic program has a GOTO 65535 or GOSUB 65535. Accepted Basic line-numbers cannot be greater than 63999. The problem happens when system mets a GOTO (or GOSUB) aiming a not existing line.
Redo RENUMBER to detect if bug occoured (?SYNTAX ERROR after execution means it did). If yes find out and correct the aimed line-numbers.


SYNTAX ERROR when RUN a BASIC program The byte preceding the start of BASIC area (specified on $2B, $2C) is different than $00.




SYNTAX ERROR when run FOR…NEXT cicle. You have used an integer variable as control cicle variable. Only a floating-point variable can be used. BASIC For example use the variable A instead of A% (Austrospeed compiler does allow integer control variables)


ENTER into MONITOR inputing BASIC line number You wrote 35072121 as line number BASIC 1) X [RETURN]; 2) Use a number between 0 and 63999


SCREEN WINDOWS SETTINGS desappears. You have used CHAR command (it sets standard window 40x25). Or you printed a string containing two [HOME] codes ($13 $13): this last one is not a bug, but the way to reset a Screen-Window. BASIC Use PRINT command instead of CHAR. To plot on the screen, use Cursor' codes inside the string to be printed.


SYNTAX ERROR in DEF FN Variable function of a FN command can not be an integer variable type (for example X%). BASIC Use a FP type variable (for example X)


COLOR KEYS do not accomplish the wanted colors. You achieved a great deep of Processor Stack (under $123). Here were stored the colors values for keyboard. O.S. 1) MONITOR [RETURN]; 2) >07F9 80 [RETURN] This command set reading colors from ROM


SAVED DATA of a SHAPE variable gives odd effects. When you save on tape/disk a variable with the content of a SHAPE (after execute SSHAPE), it does not save the horizontal size of the SHAPE box. Thus when you reload it, doing a GSHAPE you will not obtain the same thing you saved. BASIC The bug appears only under some circumstances (or maybe of certain versions of O.S.), then cross your fingers! :)


EXTRA SECTOR ALLOCATED IN SEQ FILE. When by last saved field inside a SEQuential file, a phisical sector (256 bytes) is filled in, system allocates another more block even if the file is then close. CBM DOS 2.6 Perform a disk validate.


INPUT# cuts off initial spaces of entering string. Like INPUT from keyboard, INPUT# does ignore any space character ($20) until a non-space caracter is found. A string of all spaces are accepted as a null string. BASIC Use GET# statements until a CR is met.


PRINT USING doesn't left-allign numbers BASIC You have to convert numerical values to string by STR$ function, then use the string in the PRINT USING statement.


RCLR(n) returns 0. This happens if current color ink n (0…4) is 16. BASIC Insert a test and convert possible result 0 into 16.


INT(n) returns a wrong result. This happens if argument n is negative. System seems to subtract decimal values until they achieve zero (for example -3.5 becomes -4.0) but this way works only with positive values. BASIC Convert datum by ABS(n) then calculate INT(n)*-1.













:)) SYSTEM CRASHES with no apparent reason, FILE-SYSTEM PROBLEMS, NEEDS RESETS, NOT UNDERSTANDABLE ERROR MESSAGES, KEYBOARD FREEZINGS, ETC. M$ You turned on a PC instead of a Plus4. 1) Turn off the PC; 2) Unplug its cable. 3) Turn on the Plus4 …and enjoy! :))



















"These are not bugs: they are features! "




(said by NightBird imitating M$ support)






Sheet 8: I-O tables





I/O TABLES




Release 2.1



































































STatus flags after an I/O operation

ST is byte $0090 in RAM; it can be read by READST Kernal routine ($FFB7), or by BASIC reserved variable ST Click here to go to READST Kernal routine











































7 6 5 4 3 2 1 0
















BRK (break detected) [read below note!] DTS (data set ready) missing [data set refers to the modem]
CTS (clear to send) missing [read below note!] Receiver buffer empty Receiver buffer overrun Framing error Parity error
















Serial cassette EOT (end of tape) EOF (end of file) only during read operations Checksum error (one or more faulty characters were read) Unrecoverable read error (only during read operations); Verify error (during verification) Long block (data file block too long) Short block (data file block too short)


















Serial disk Device not present (test it after a CLOSE command) EOI (end of identify) For 1541 this means End of File
Verify error (if LOADSP was run with verify flag set)

Read timeout (listener) Write timeout (talker)
















NOTE: It appears that any of these bits is never used by O.S.







































































































I/O ERRORS codes of Kernal routines



PERIPHERAL DEVICES codenames




KEYBOARD MATRIX












Their code is returned in .A (and CY=1) when an I/O error happens. The text message is output only if SETMSG routine has enabled direct Monitor messages (memory address $009A=$C0)






Note the Easter-egg in the column 4 (CBM) ;-)













































Precalculated












Error No. Description
Number Peripheral device Connection



$FF08 TED register


0 The routine was terminated by pressing STOP key
0 Keyboard Dedicated


Values: 80 40 20 10 08 04 02 01 <-- values to select only one column

1 The logical file table is full (Max 10 entries)
1 Cassette tape Dedicated


Values Bit 7 6 5 4 3 2 1 0


2 The specified logical file was already open
2 RS232


$FD30 (u SPI) FE 0 @ F3 F2 F1 HELP
RETURN DEL


3 The specified logical file was not open
3 Screen Dedicated

FD 1 SHFT E S Z 4 A W 3


4 The specified file name was not found on the specified device
4 Printer #1 Serial

FB 2 X T F C 6 D R 5


5 The specified device is not present
5 Printer #2

F7 3 V U H B 8 G Y 7


6 The specified device is not an input device
6 Plotter #1

EF 4 N O K M 0 J I 9


7 The specified device is not an output device
7 Plotter #2

DF 5 , - : .
L P



8 The file name was missing
8 Serial disk or TCBM disk driver
Possible TCBM
BF 6
+ = ESC
; *



9 The specified device is illegal for this purpose
9 Serial disk or TCBM disk driver

7F 7 STOP Q CBM SPACE 2 CTRL HOME 1


-128 Device not present / not connected / not turned on (after a CLOSE operation)
10…31 Serial disk drivers























Operating mode: (General rule: bit=0 selected/pressed; =1 unselected/unpressed)












240 Top of memory modifies the allocation/deallocation of RS232 buffer (to be verified)
The only TCBM known device is the 1551 disk drive




(it is allowed to test more than one key at once)













































1) First select the raw(s) to test by writing mask on $FD30 (0=select) **
























2) Then write it to $FF08
























3) Read the column(s) from $FF08 (0 = the key/s was/were pressed)






































RS232 setting










Example:
























test ESC key

LDA #$BF (%10111111); select row 6









Syntax to OPEN the RS232 device:
OPEN #LogicFile,2,0,R1,R2










* STA $FD30












#LogicFile = Logical file number (2…14)









* STA $FF08












R1 = Control Register (see below table)









* LDA $FF08












R2 = Command Register (see below table)










AND #$10 (%00010000); test if column 4 is 0
























BEQ ITSESC; (if bit=0 the key was pressed)









X-on X-off: These features are embedded in RS232 logic. They can be set by poking a non-zero character into $FC (x-on) or into $FD (x-off).



































* OS subroutine at $DB70 executes these mnemonics (.A input and output)












CONTROL REGISTER bits:
























7 6 5 4 3 2 1 0



** If you use #$00 for row selecting, then the whole keyboard is tested (if result is #$FF then no key was hit)












Stop bits (0 = 1 stop bit; 1 = 2 stop bits) Word lenght (00 = 8 bits; 01 = 7 bits, 10 = 6 bits; 11 = 5 bits) Receiver clock source (0 = external clock; 1 = baud rate generator) Baud rate (0000 = 16 times external clock; 0001 = 50 baud; 0010 = 75 baud; 0011 = 109.92 baud; 0100 = 134.58 baud; 0101 = 150 baud; 0110 = 300 baud; 0111 = 600 baud; 1000 = 1200 baud; 1001 = 1800 baud; 1010 = 2400 baud; 1011 = 3600 baud; 1100 = 4800 baud; 1101 = 7200 baud; 1110 = 9600 baud; 1111 = 19200 baud.





























Differences between C16/Plus4 and C64 keyboards:












COMMAND REGISTER bits:










Plus4




@ £ ESC HOME + - HELP (missing)
7 6 5 4 3 2 1 0



C64 - + £ HOME

*
^ @ F8 RESTORE
Parity Bits Action - - 0 disabled 001 odd parity receive and transmit 011 even parity receive and transmit 101 mark parity bit transmit / no parity check 111 space parity bit transmit / no parity check Receiver mode (0 = normal; 1 = echo [bits 2 and 3 must be 00]) Transmitter controls Bits IRQ RTS Transm. 00 disabled high OFF 01 enabled low ON 10 disabled low ON 11 disabled low BRK Receiver interrupt enable (0 = IRQ enabled from bit 3 of Status Register; 1 = IRQ interrupt disabled) DTR - Data terminal ready (0 = disable receiver and all interrupts [DTR high]; 1 = enable receiver and all interrupts [DTR low])











(*) Shift RIGHT






Sheet 9: Disk drives


Blue texts mean the same use for different drives models
DISK DRIVES Maps



Release 2.1








Bits |--->






Address ($) 1541 1551 1581 Notes 7 6 5 4 3 2 1 0

RAM RAM RAM








0000 Command code for Buffer #0 6510T CPU data direction register Free Click here to go to Command list







0001 Command code for Buffer #1 6510T CPU port, FDC control register Free 1551: See bits description --> Byte latched (1=yes) DS1 (Density select #1) DS0 (Density select #0) WPS (Write Protect Sensor) ACT (drive LED) MTR (drive motor on/off) STP (drive head stepper 1) STP (drive head stepper 0)
0002 Command code for Buffer #2 Command code for Buffer #0 (See below tables) Command code for Buffer #0 (See below tables)








0003 Command code for Buffer #3 Command code for Buffer #1 Command code for Buffer #1








0004 Command code for Buffer #4 Command code for Buffer #2 Command code for Buffer #2








0005 Command code for Buffer #5 (unused) Command code for Buffer #3 Command code for Buffer #3








0006 Track for Buffer #0 Command code for Buffer #4 Command code for Buffer #4








0007 Sector for Buffer #0 Command code for Buffer #5 (unused) Command code for Buffer #5








0008 Track for Buffer #1 Track for Buffer #0 Command code for Buffer #6








0009 Sector for Buffer #1 Sector for Buffer #0 Command code for Buffer #7 (reserved for BAM jobs only)








000A Track for Buffer #2 Track for Buffer #1 Command code for Buffer #8 (reserved for BAM jobs only)








000B Sector for Buffer #2 Sector for Buffer #1 Logical (or physical) track and sector for each job (2 bytes per job)








000C-000D Track & sector for Buffer #3 Track & sector for Buffer #2








000E-000F Track & sector for Buffer #4 ?








0010-0011 Track & sector for Buffer #4 (unused) ?








0012-0013 ID drive #0 ?








0014-0015 ID drive #1 ID drive #1








0016-0017 Header block: ID ?








0018 Header block: track Block header ID #1








0019 Header block: sector Block header ID #2








001A Header block: parity (checksum) Track block header








001B Disk controller block (not used) Sector block header








001C Flag for disk change (drive #0) Checksum of block header








001D Flag for disk change (drive #1) Current drive # (always $00) ID








001E Flag for write protect sensor (drive #0) ?








001F Flag for wite protect sensor (drive #1) ? Track number








0020 Drive #0 status (disk and step motor) or Flag for head transport ? Side (0: front 1= rear) 1541: see bits description ---> Disk drive ready (0=yes) R/W head moving (1= yes) Motor on (1=yes) Switch off motor (1=yes)



0021 Drive #1 status ? Sector number








0022 Current track for drive #0 Write protect flag (drive #0 or #1) Sector size








0023 Current track for drive #1 (unused) / Flag drive model (0=1541; not 0= 1540) Write protect flag for drive 1 (never used) CRC checksum








0024 Scratch pad of GCR conversion ?








0025 ? Flag: disk change








0026 ? Drive mode: 0 = Disk inactive








0027
Current head position








0028
Buffer for job code








0029 FDC current track Lenght of the command line








002A ? On or follower counter for drive motor








002B Drive status flag 1551: See bits description --> Drive ready Stepper motor Drive motor




002C Unused ? Stackpointer in controller loop call








002D
Init mode








002E Pointer for temp storage ? Sector offset








002F ? Free blocks in the current track (BAM check)








0030 Pointer on buffer for disk controller / Pointer: active buffer ? Options with errors (???)








0031
Pointer inside BAM








0032 Pointer: active track ?








0033 Pointer: active sector ? Pointer to user jump table








0034 Pointer to last converted byte ?








0035 Not used (decode error, GCR)? ? Flags: BAM status








0036 Byte counter for GCR/BIN convertion ? Latch








0037 Unused (bit counter) ? Mode of command $9E (BUFMOV) *bug*








0038 [$07] Mark for start of data block ? Buffer for burst Load / 'U9' (warm start)








0039 [$08] Mark for start of block header ? Latches








003A Parity for header block (or for data buffer?) Temp stack storage Latch








003B ? Stepper motor direction Position of "*" in command line 1551: <$80: inner; >=$80: outer if =1 then outer






003C ? ? Flag for burst Load: the file has only 1 block








003D Drive # for disk controller (always $00) / Motor flag Last sector read Counter for sectors found in Query Disk Format








003E Active drive ($FF = not active) Next sector to be read Sector number found in Query Disk Format








003F Buffer # for disk controller / Previous work place in queue (0 - 5) GCR/BIN indicator for current buffer Cache: current buffer (on BAM)








0040 Byte counter for GCR convertion Current track Multipurpose latch








0041 Number of next work in queue (0 - 5) ?








0042 Destination track (to move R/W head to) ?








0043 Number of sectors per track for formatting ?








0044 Temp work area / Scratch pad ?








0045 Work code temp storage ? Free








0046 Free ? Jump vector for user commands








0047 [$07] Mark for starting data (or header?) block. ? 1541: the constant $07 can be changed but must remain lower than $10







0048 Counter for head movement / Timer R/W head acceleration. ? Buffer address for jobs








0049 Stack pointer temp storage ?








004A Step counter for head transport (and direction) ? Pointer in cache buffer 1541: Direction <$7F: outer; >=$80: inner if =1 then inner (toward the disk centre)






004B Temp ?








004C Last read sector
Track number of the last file (LOAD "*")








004D Next sector
Current track number








004E Pointer to buffer for GCR → BIN convertion
Current sector number








004F
Memory for upper stack limit (???)








0050 Flag: format of the data in buffer: 0=BIN 1=GCR ? Current channel number








0051 Current track for formatting ($FF at reset) ? 0 = EOI from the bus / End of file








0052 Storage for 4 BIN bytes to convert onto GCR format ? Current secondary address








0053 ? Secondary address for IEC bus








0054 ? Cache for byte updates








0055 Counter for LED flashing Buffer








0056 Storage for 5 GCR bytes to convert onto BIN format ? Buffer








0057 ? Sector number of the current side-sector








0058 ? Pointer to T & S of a data block in the Side-sector








0059 ? Pointer in the Side-sector table to the current Side-sector








005A
Enlarging a REL file








005B Flag for TALK Arithmetic register 1 (e.g. division)








005C Flag for LISTEN 1551: 1/0







005D Format characters ID after init 1551: Normally "2A"







005E [$04] Number of steps for head motor accelerating or decelerating factor Free







005F [$04] Accelerating/decl. factor ?








0060 Steps left when in stepping run / Unused ? Arithmetic register 2








0061 Steps left when in fast stepping run / Unused ROM-test checksum








0062 [$FA05] Pointer to routine of head movement ?








0063
Free








0064 [$C8] Minimum number of steps for head fast run ? Temporary buffer pointer 1541: If fewer, then use slow stepper routine







0065 [$EB22] UI vector /Pointer to start NMI reset routine ($EB2E) ?








0066 Device # Bit counter for serial bus








0067 Flag: NMI in progress ? Counters (e.g. drive / channel search)








0068 Flag for automatic disk initialization when ID is mismatch ? Position inside Record 1541: 1=no; 0=yes (acts reinitialization)







0069 [$0A] Sector interleave value (for SEQ files?) ? Number of records in the Side-sectors








006A [$05] Number of reading attempts when read-error ? Position of current T & S in Side-sector








006B [$FFEA] Pointer: start of Jump-table for U commands ($FFF6)? ? Position of Records in the Data block








006C ? Buffer for job number








006D [$0400] Pointer: start of bitmap ? Buffer occupancy (bits 0...6) 1=occupied








006E ? Drive status








006F Pointer to address for commands M and B / Temp ? Format identifier from disk 1541: setup on reset to $6F







0070 ? Channel allocation table








0071 Temp ? Dir-block where the file was found 1541: setup on reset to $FF







0072 ? Dir-block with a free entry








0073 ? Position of the free entry in the Dir-block








0074 ? Pointer to the current buffer number








0075 [$0100] Indirect pointer ? Number of sectors per track








0076 Blinking LED flag ($E0=on) Bus mode








0077 ($28) LISTEN address (Device number +$20) Last track number Device address for LISTEN (address + $20)






1
0078 ($48) TALK address (Device number +$40) Current drive # Device address for TALK (address + $40)





1

0079 Flag for active LISTEN (1/0) Current track LED flag








007A Flag for active TALK (1/0) Current sector Buffer for the secondary address








007B Addressed flag / Unused Current channel Command mode flag








007C ATN flag: serial bus receives ATN interrupt Secondary address Burst command byte








007D EOI flag from serial bus / Flag for IC 6502 in ATteNtion mode Secondary address from computer Cache for job status








007E Last handled program ? Cache buffer pointer for Burst commands








007F Drive # (always $00) ?








0080 Current Track # ? Burst status 1541: is $00 after use







0081 Current Sector # ? DOS error suppression (burst access) 1541: is $00 after use







0082 Channel # (logical index) ? Cache inside controller program








0083 Secondary address ? Number of active jobs








0084 Original secondary address ? Number of active job routine (0…32)








0085 Current data byte (temp) ? Control bits for job processing (see $C163)








0086 Temp results ?








0087 ? Flag: cache buffer changed (bit7) = 1: yes
1 = changed






0088 ? Target track for head moving








0089 ? AND mask for Burst status








008A ? OR mask for Burst status








008B Temp results area for division / multiplication ? Pointer to BUFFCACHE (since $0C00)








008C ?








008D ? I/O byte








008E ? Number of first physical track








008F Accumulator / Work storage ? Number of last physical sector








0090 ? Start track of current partition








0091 Pointer inside record Sector size








0092 ? Number of sectors on the track








0093 ? Last sector of the track








0094 Current buffer pointer / Pointer: Directory buffer ? Sector number on the track








0095 EOI Current track (in cache buffer)








0096 IEEE command in (unused) ? Disk side of the current job








0097 [$00] MY PA flag / Unused ? Current Page (in cache buffer)








0098 Bit counter for serial transmission Buffer number Head settling time after shift








0099 Pointer to next byte in Buffer #0 ($0300) Pointer to first filename Index for 2 bytes job memory (ex. T & S)








009A ? Size of the gap between two sectors







009B Pointer next byte in Buffer #1 ($0400) ? Stuff byte data block








009C
Counter for cache delay








009D Pointer next byte in Buffer #2 ($0500) ? Cache delay








009E ? LED blink counter








009F-00A0 Pointer next byte in Buffer #3 ($0600) ? Offset into track cache buffer (1 byte per job)








00A1-00A2 Pointer next byte in Buffer #4 ($0700) ?








00A3-00A4 Pointer next byte in Input (command) buffer ($0200…) ?








00A5-00A6 Pointer next byte in Error Messages buffer ($02D5…) ?








00A7 Table: channel numbers assigned to each buffer ($FF=inactive buffer) / Table: non-active channel numbers for each buffer ?








00A8-00AD ? Secondary addresses table








00AE-00B4 Table: channel numbers assigned to each buffer ($FF=inactive buffer) ?








00B5-00BA Table: For each buffer Record # / Block # (Low bytes) ?








00BB-00C0 Table: For each buffer Record # / Block # (High bytes) ? Buffer pointers (0…8)








00C1-00C6 Table: next record numbers for each buffer / Writing pointer for RELative files ?








00C7-00CC Table: Record size for each buffer (RELative files) ?








00CD-00CE Table: Side sectors for each buffer (RELative files) ? Pointer in Input buffer








00CF-00D0
Pointer in Error buffer








00D1-00D2
Buffer for Channel








00D3 File stream 1 pointer / Pointer to first filename ?








00D4 Pointer inside record (RELative files) / Pointer to start of record ?








00D5 Side sector number (RELative files) ?








00D6 Pointer to data block inside side sector (RELative files) / Index to side sector ?








00D7 Pointer to record (RELative files) / Relative file pointer to track ?








00D8-00DC Sectors of Directory entries / Directory sectors ? Buffer for Channel (again?)








00DD-00DE Index of Directory entries ?








00DF-00E1
Table: longest inactive channels








00E2-00E4 Default disk drive# (always $00) ?








00E5-00E6
Dir-block with the current file entry (?)








00E7-00E9 File type: wild cards [?] [*] [@] [closed] ?








00EA-00EB
Pointer in the Dir-block with the entry








00EC-00EE File type: channels ?








00EF-00F1
Drive numbers of the parameters








00F2-00F3 Channel status' ?








00F4-00F7
File types and flags for Joker (*,?)








00F8 Flag for EOI / Temp for EOI ?








00F9 Buffer # of current work / Current job number ? File types table








00FA-00FE Last recently used table ?








00FF Flag: Drive #0 not ready ? 1541: $FF = drive #0 not ready (no disk); $00 = drive #0 ready.







0100 Flag: Drive #1 not ready unused? Stack area and GCR overflow area Group number of the current Record 1541: $FF = drive #1 not ready (no disk); $00 = drive #1 ready.







0101 Format DOS version (taken from tk 18 st 0) for drive #0 Mode of REL file








0102 Format DOS version (taken from tk 18 st 0) for drive #1 (unused) Current group number








0103 Unused








0104-0108 Stack area








0109-010F Sector of the Super Side-sector








0110-0116 Track of the Super Side-sector








0117-0145 Stack area 0117 018F








0146-018F Unused









0190-0191 [B0F0] Main cycle address








0192-0193 [DAFD] IRQ routine








0194-0195 [AFCA] Warm start








0196-0197 [B262] Validate








0198-0199 [8EC5] Initialize








019A-019B [B781] Partition








019C-019D [892F] Memory read/write








019E-019F [8A5D] Block commands








01A0-01A1 [898F] User








01A2-01A3 [A1A1] Position (Record)








01A4-01A5 [A956] Utility Loader (&)








01A6-01A7 [876E] Copy








01A8-01A9 [88C5] Rename








01AA-01AB [8688] Scratch








01AC-01AD [B348] New








01AE-01AF [A7AE] Error routine of the controllers








01B0-01B1 [ABCF] ATN managing








01B2-01B3 [AD5C] Data to serial bus








01B4-01B5 [AEB8] Data from serial bus








01B6-01B7 [C0BE] Controller routine








01B8-01B9 [CEDC] Format?








01BA Buffer for GCR code [A7F1] Error routine of DOS








01BB Cont buffer for GCR code / Stack area








01BC-01CD Buffer for GCR code HDRS2 Translated (physical) track & sector for each job (2 bytes per job)








01CE-01D6 SIDS Physical side for each job (1 byte per job)








01D7-01D8 Time B value (H/L)








01D9 Start up time of the motor








01DA Restore (Controller command)








01DB Seek (Controller command)








01DC Step (Controller command)








01DD Step-in (Controller command)








01DE Step-out (Controller command)








01DF Read Sector (Controller command)








01E0 Write Sector (Controller command)








01E1 Read Address (Controller command)








01E2 Read Track (Controller command)








01E3 Write Track (Controller command)








01E4 Force IRQ (Controller command)








01E5 Sector of Burst/Status / Error Code








01E6-01EA ?








01EB-01EC 1581 Format code "D" & DOS version "3"








01ED-01EE Partition size








01EF Smallest sector number found (Burst)








01F0 Largest sector number resulting (Burst)








01F1-01F9 High bytes of buffer addresses








01FA Write protection status








01FB Autoboot flag








01FC-01FE JMP $BA40: Output byte on FSM bus








01FF Free








0200-0228 Command strings buffer Input buffer for command strings Command buffer Format of command string: AB:CCCCCCCCCCCCCCCC,DE A=command letter; B=drive (0); CCCCCCC...=file name DE=disk ID







0229 ? (Possible cont of previous buffer)








022A Command code number Temp storage for command (command code) Current command number ($80…$89: block commands)








022B LINDX Logical index: Status bytes for channel #0 (secondary address) Logical index (channel 0) Track of Directory 1541 & 1551: $FF=inactive $81=open for write; $41=read/write; $01=open for read







022C Status bytes for channel #1 (secondary address) Logical index (channel 1) Last track of current partition +1







022D Status bytes for channel #2 (secondary address) Logical index (channel 2) Current file type







022E Last read/written byte for each channel ? Number of parameters before "=" (cache)








022F ? Number of parameters in the command line








0230 ? Number of parameters before "="








0231 ? Counter for Directory searching








0232 ? Pointer to the found Directory' entry








0233 ? File type from the command line








0234-0239 ? Channel status table








023A ? Channel status for Error Channel








023B-0240 ? Output bytes of channels on serial bus








0241 ? Output byte of Error channel








0242-0243 ? Number of valid bytes in the data block








0244 Pointers: last character read or written in the buffer for each channel ?








0245-0248 ?








0249 End of error message Current Recond number / Data size LO








024A Type of the active file File type / active data








024B String lenght Filename/String lenght








024C Temp channel number / Temporary secondary address Temp channel nunber (secondary address)








024D Current work with drive number / Temporary job command Current work with drive number








024E Work area for finding the best sector Work area finding the best sector








024F Buffer allocated Buffer allocated








0250 Current Recond number / Data size HI








0251 Flag: BAM changed on drive #0 Flag: BAM changed on drive #0








0252 Flag: BAM changed on drive #1 (unused?) ?








0253 Flag result of directory entry search Flag result of directory entry search 1541 & 1551: $00 = found; $FF = Not found







0254 Flag for directory output (listing) Flag for directory output








0255 Flag: waiting for a command Flag: waiting for a command








0256 LINDX use word / Bitmap of free channels Buffer allocation register See at $022B…







0257 Last used buffer Last used buffer Position of the next block in the Record








0258 Record lenght Record lenght Used by Directory routines







0259 Track of side-sector Track of side-sector Used by Directory routines







025A Sector of side-sector Sector of side-sector Used by Directory routines







025B-025D Last work (buffers) / Last job for each buffer Last work (buffers)








025E-025F Current Record size








0260-0264 Sector of Directory entry for each buffer Directory sectors (buffers)








0265 Side-sector buffer for Channel








0266-026B Index of Directory entry for each buffer / File's index in Directory (buffers) File's index in directory (buffers)








026C Error message / (counter for LED flash?) / Error word for recovery Error flag (counter for LED flash?) Current parameter lenght (see $8526)








026D Error LED mask for flashing ? Number of the found filename








026E Last program's drive number Last program's drive number Directory formatted output to SA 0








026F Last program's sector number Last sector number Current Record size








0270 Write LINDX Temp storage for channel number Track of the current Super-side sector 1541: see $022B







0271 Read LINDX ? Sector of the current Super-side sector 1541: see $022B







0272 Number of blocks (temp) Number of free blocks Latch for job codes








0273 ?








0274 Lenght of command string / Lenght of input line Lenght of input line / filename








0275 Character to interpret ?








0276 Index: end of filename in command buffer / PTR limit in comparison ?








0277 File stream 1 count / Temp Number of commas








0278 Number of filenames / File stream 2 count / Temp ?








0279 File check method / File stream 2 pointer / Temp Number of commas (again?)








027A Pointer table: Filenames Pointer to drive number








027B-027C ? Free








027D-027F ? Directory block with the file entry of Channel








0280-0283 Track of a file / Link to track of first file ?








0284 ? Position of the file entry in the Dir block








0285-0289 Sector of a file / Link to sector of first file ?








028A Wildcard flag Wildcard flag








028B File stream image / Command syntax byte Syntax flag Sector number of the last file








028C Number of drive(s) to look for Number of drives to look for Buffer (channel number)








028D Flag: looking for drive Flag: looking for drive Directory: Basic line number LO








028E Drive with last write/open error. Used as default drive number. Last drive number Directory: Basic line number HI








028F Flag: found in directory Flag: found in directory Buffer for character search








0290 Flag: found in directory / Directory sector Directory sector Pointer behind the current parameters








0291 Sector for first available file / Sector of first available entry Sector for first available file Position of the parameters in the command line








0292 Index (in Directory) for first available file (entry) Index (in directory) for first available file








0293 For the last directory entry / =0 if last block For the last directory entry








0294 Current buffer index Current buffer-index








0295 Counter: files / Counter of file entries Counter: files








0296 Flag: Name matching wildcards / Match by type of flag Flag: Name matching wild card








0297 Active operating mode (File control method) Active operating mode Values from command line (HI bytes) 1541 & 1551: R or W







0298 Flag: work return DOS error flag / Flag: work return








0299 Pointer: re-read error / Pointer for recovery Pointer: re-read error








029A Total tracks / Total track offset Total tracks








029B Pointer: BAM last update Pointer: BAM last update








029C Values from command line (LO bytes)








029D BAM: image sector (drive #0 and #1) / Track # of BAM image (drives 0/1) BAM: image sector (drive #0)








029E-02A0 ?








02A1 BAM image BAM image Jokerflag: Current filename contains "*" or "?"








02A2 Bit mask for command line test








02A3 Numer of drives








02A4 A sort of drive number during Directory load








02A5 Search result








02A6 Flag: 0 = Directory end








02A7 Access from command line (R, W, Q, M)








02A8 Error checking off








02A9-02AA Free for plain text messages








02AB-02B0 ?








02B1-02D4 Buffer for directory output / Directory buffer Buffer for directory output ?








02D5-02F8 Buffer for error messages (till $02F9?) ? ?








02F9 Flag: don't write BAM Flag: don't write BAM ? 1541 (& 1551?): set to $00 before and after each command







02FA-02FB Number of free blocks - low bytes (drives #0 and #1) Number of free blocks - low bytes (drives #0 and #1) ?








02FC-02FD Number of free blocks - high bytes (drives #0 and #1) Number of free blocks - high bytes (drives #0 and #1) ? 1541 & 1551: Since drive #1 is unused, its bytes are available







02FE-02FF Stepper motor sequence / Current phase of head stepper motor Stepper motor sequence ?








0300-03FF Buffer #0 Buffer #0 Buffer #0








0400-04FF Buffer #1 Buffer #1 Buffer #1








0500-05FF Buffer #2 Buffer #2 Buffer #2








0600-06FF Buffer #3 Buffer #3 Buffer #3








0620 Format: number of retries








0621-0622 Format: expect track capacity








0623 Format: number of read attempts



















0624-0625 Format: measured track capacity (?)








0626 Format: temp








0627 Format: number of sectors/tracks








0628 Format: current sector, verify counter








0629-06FF …cont Buffer #3








0700-07FF Buffer #4 (BAM only) Buffer #4 (BAM resident in memory) Buffer #4








0800-08FF Unconnected Unconnected Buffer #5








0900-09FF Buffer #6








0A00-0AFF Buffer #7 (BAM for tracks 0...39)








0B00-0BFF Buffer #8 (BAM for tracks 40…79)








0C00-17FF Some areas used by chips, the remaining unconnected BUFFCACHE buffer for a complete track of the disk (20 pages)









VIA1 6522 chip









1800 PB Port B Unconnected 1541: Chip for serial bus I/O See bits description ------> CB2: ATN in Device address preset switches (8+bits ex. %01 = 9) ATN acknoledge Out CLOCK out CLOCK in DATA out DATA in
1801 PA Port A (unused) Could be used for parallel cables







1802 CB Data direction register Port B 1 = Output 0=Input







1803 CA Data direction register Port A (unused)








1804 Timer 1 (lo) 1541: used for Timeout errors







1805 Timer 1 (hi)







1806 Timer 1 latch (lo)







1807 Timer 1 latch (hi)







1808 Timer 2 (lo) unused








1809 Timer 2 (hi) unused








180A Shift register








180B Auxiliary control register
Timer 1 control: 00=Timed IRQ T1 loaded; 01=Continuous IRQ; 10=One shot IRQ T1 loaded; 11=Cont. IRQ square-wave Timer 2 control: 0=timed IRQ; 1=count pulses on PB6 Shift Register control: 000=disabled 001=SH in controlled by T2; 010=SH in controlled by Phi2; 011=SH in controlled by ext CLK; 100=SH out free running at T2 rate; 101=SH out controlled by T2; 110=SH out contolled by Phi2; 111=SH out controlled by ext. CLK. 1= enable latching PB 1= enable latching PA
180C Peripheral control register
CB2 Control: 000=Input neg. active edge; 001=Independ. IRQ input neg. edge; 010=Input pos. active edge; 011=Independ.IRQ input pos. edge; 100=Handshake output; 101=Pulse output; 110=Low output; 111=High output CB1 IRQ Control: 0=Negative active edge 1=Positive active edge CA2 Control: 000=Input neg. active edge; 001=Independ. IRQ input neg. edge; 010=Input pos. active edge; 011=Independ.IRQ input pos. edge; 100=Handshake output; 101=Pulse output; 110=Low output; 111=High output CA1 IRQ Control: 0=Negative active edge 1=Positive active edge
180D Interrupt flag register
1 = IRQ occured Timer 1 Timer 2 CB1 CB2 Shift register CA1 CA2
180E Interrupt enable register If read, bit 7 always gives 1 1= set IRQ flags; 0=Clear Timer 1 Timer 2 CB1 CB2 Shift register CA1 CA2
180F Data port A (no handshake)








1810-1BFF Unconnected









VIA2 6522 chip









1C00 PB Control Port B Unconnected 1541: Chip for motor and read/write head See bits description ------> SYNC in (0=found) Bit rate D1 and D0: 00=250000 bit/s; 01=266667 bit/s; 10=285714 bit/s; 11=307692 bit/s WPS Write Protect Sense (1=on) ACT LED on drive (1=on) MTR drive motor (1=on) Step motor for head movement: directions: 00 01 10 11 00… = moves inward; 00 11 10 01 00… = moves outwards
1C01 PA Port A (GCR Data to and from read/write head)








1C02 CB Data direction register Port B 1=Output 0=Input







1C03 CA Data direction register Port A 1541: See bit description ----> (1 = Output 0=Input)



Read / write SOE Set Overflow Enable for IC 6502 Byte ready
1C04 Timer 1 (lo) 1541: IRQ Timer







1C05 Timer 1 (hi)







1C06 Timer 1 latch (lo)







1C07 Timer 1 latch (hi)







1C08 Timer 2 (lo) unused








1C09 Timer 2 (hi) unused








1C0A Shift register








1C0B Auxiliary control register
Timer 1 control: 00=Timed IRQ T1 loaded; 01=Continuous IRQ; 10=One shot IRQ T1 loaded; 11=Cont. IRQ square-wave Timer 2 control: 0=timed IRQ; 1=count pulses on PB6 Shift Register control: 000=disabled 001=SH in controlled by T2; 010=SH in controlled by Phi2; 011=SH in controlled by ext CLK; 100=SH out free running at T2 rate; 101=SH out controlled by T2; 110=SH out contolled by Phi2; 111=SH out controlled by ext. CLK. 1= enable latching PB 1= enable latching PA
1C0C Peripheral control register
CB2 Control: 000=Input neg. active edge; 001=Independ. IRQ input neg. edge; 010=Input pos. active edge; 011=Independ.IRQ input pos. edge; 100=Handshake output; 101=Pulse output; 110=Low output; 111=High output CB1 IRQ Control: 0=Negative active edge 1=Positive active edge CA2 Control: 000=Input neg. active edge; 001=Independ. IRQ input neg. edge; 010=Input pos. active edge; 011=Independ.IRQ input pos. edge; 100=Handshake output; 101=Pulse output; 110=Low output; 111=High output CA1 IRQ Control: 0=Negative active edge 1=Positive active edge
1C0D Interrupt flag register
1 = IRQ occured Timer 1 Timer 2 CB1 CB2 Shift register CA1 CA2
1C0E Interrupt enable register If read, bit 7 always gives 1 1= set IRQ flags; 0=Clear Timer 1 Timer 2 CB1 CB2 Shift register CA1 CA2
1C0F Data port A (no handshake)








1C10-1FFF Unconnected








2000-3FFF Unconnected










TIA 6523A chip (or 6525) [mapped on C16/Plus/4 memory at $FEE0 (if dev. #8) or at $FEC0 (if dev. #9)] CIA 8520A chip








4000 Unconnected Port A Register: I/O port toward the computer Bits 0…7 = Data Port A Data Register 1581: See bits description --> 0 = Disk change (will be reset after next head move) 1 = Drive LED on 1 = Error LED bright Device number DIP switches 0 = Motor on 1 = no disk inserted Side Select
4001 Port B Register: Connected to the shift register of the R/W head Bits 0, 1 = Status Port B Data Register 1581: See bits description --> ATN IN 0 = Write potec-tion active Data direc-tion of Bus driver (FSM) 0= In 1= out Automatic ATN-Response CLOCK OUT CLOCK IN DATA OUT DATA IN
4002 Port C Register: Drive control, status and sync Bits 6, 7 = Busy, Strobe Port A Direction Register 1551: See bits description --> 1581: 1=out 0=in DAV (data valid) handshake from bit 6 of $FEF2 / FEC2 of Plus/4 SYNC (0=found; 1=no sync) MODE (jumper: 0=device 8; 1=device 9) MODE (R/W head) 0=write; 1=read ACK (Acknoledge) handshake to bit 7 of $FEF2 / FEC2 of Plus/4 DEV drive mapped on Plus/4: 0=at $FEC0; 1= at $FEF0 STATUS (mapped on $FEC1 / $FEF1 on Plus/4). 01 Read timeout 10 Write timeout 11 End of data
4003 Data direction register. Port A Port B Direction Register 1551: 1=out 0=in 1581: Default = 00111010







4004 Data direction register. Port B Timer A low byte (Clock for FSM) 1551: 1=out 0=in 1581: Typical start value of Timer A: $0006







4005 Data direction register. Port C Timer A high byte (Clock for FSM) 1551: 1=out 0=in (Automatically set to %00011111 by the DOS)







4006 (Only if 6525): CR - Control Register (N/A) Timer B low byte (Interrupt timer) 1581: Typical start value: $4E20







4007 (Only if 6525): AIR - Active Interrupt Register (N/A) Timer B high byte (Interrupt timer)







4008 Unconnected Time of day (Low byte)








4009 Time of day (Middle byte)








400A Time of day (High byte)








400B Unused








400C Synchronous Serial I/O Data buffer








400D CIA Interrupt Control Register 1581: See bits description --> Warning: the CIA does not clear this register. To do it you have to read it. Default: 10011010 On Read: 1 = IRQ occured; On Write: 1 = Set IRQ flags; 0 = Clear IRQ flags ? ? FLAG1 IRQ (ATN occured) Serial port ($4C0C) IRQ (FSM) is ready Time of Day clock Alarm IRQ Timer B IRQ (Inter-rupt timer) Timer A IRQ
400E CIA Control Register A 1581: See bits description --> Default: 0x000001 Unused Serial Port ($400C) I/O mode: 1= out; 0 = in Timer A Counts: 1 = CNT signals 0 = system 02 clock Timer A Force Load: 1 = Now! (write only Strobe bit) Timer A Run Mode: 1 = one shot; 0 = continuous Timer A Output Mode to PB6: 1 = too-gle; 0= pulse Timer B Out-put on PB6: 1 = yes; 0 = no Start / Stop Timer B: 1 = start; 0 = stop
400F CIA Control Register B 1581: See bits description --> Default: 00010001 Set Alarm / TOD on Timer B: 1 = alarm; 0 = time of day Timer B Mode select: 00 = Count system 02 clock pulses; 01 = Count positive CNT transitions; 10 = Count Timer A underflow pulses; 11 = Count Timer A Underflows while CNT Timer B Force Load: 1 = Now! (write only Strobe bit) Timer B Run Mode: 1 = one shot; 0 = conti-nuous Timer B Output Mode to PB7: 1 = toogle; 0= pulse Timer B Out-put on PB7: 1 = yes; 0 = no Start / Stop Timer B: 1 = start; 0 = stop
4010-5FFF Unconnected











WD177x chip








6000 Unconnected Unconnected Command & Status Register 1581: Disk controller chip







6001 Track Register








6002 Sector Register








6003 Data Register








6004-7FFF Unconnected









ROM ROM ROM








8000-BFFF Unconnected Unconnected D.O.S.








C000-C021 D.O.S. Author signature text 1551: "DAVID G SIRACUSA CBM COPYRIGHT 84"







C022-FDE2 D.O.S.








FDE2-FF00 ROM (unused: filled $FF)








FF01-FF0D NNMI (New NMI patched to test U+/U- commands)








FF0D-FF0F Set DOS flag as 1540 compatible (U-)








FF10-FFE5 ROM (unused)








FFE6-FFE7 [C8C6] Vector to Format routine [C9A7] Vector to Format routine








FFE8-FFE9 [F98F] Vector to TRNOFF routine (turn off motor) [F13B]








FFEA-FFEB [CD5F] Vector to UBLKRD routine (U1 Block read) [CE51] Vector to UBLKRD routine (U1 Block read)








FFEC-FFED [CD97] Vector to UBLKWT routine (U2 Block write) [CE8B] Vector to UBLKWT routine (U2 Block write)








FFEE-FFEF [0500] Vector to buffer #2 (command U3) [0500] Vector to buffer #2 (command U3)








FFF0-FFF1 [0503] Vector to buffer #2 +3 (command U4) [0503] Vector to buffer #2 +3 (command U4)








FFF2-FFF3 [0506] Vector to buffer #2 +6 (command U5) [0506] Vector to buffer #2 +6 (command U5)








FFF4-FFF5 [0509] Vector to buffer #2 +9 (command U6) [0509] Vector to buffer #2 +9 (command U6)








FFF6-FFF7 [050C] Vector to buffer #2 +12 (command U7) [050C] Vector to buffer #2 +12 (command U7)








FFF8-FFF9 [050F] Vector to buffer #2 +15 (command U8) [050F] Vector to buffer #2 +15 (command U8)








FFFA-FFFB [FF01] Vector to NNMI routine [EA39] Vector to reset tables routine (command U9)








FFFC-FFFD [EAA0] Vector to DSKINT routine (command UJ) [E9B5] Vector to power up (command UJ)








FFFE-FFFF [FE67] Vector to SYSIRQ routine [F195] Vector to SYSIRQ routine









END OF MEMORY END OF MEMORY END OF MEMORY




























































HOW TO COMMAND A WORK TO THE DISK O.S.:



Bits |--->











7 6 5 4 3 2 1 0
Structure of a byte in the Command (jobs) queue: 1 = Job running

(see Exit code $10) Exit code
Command code Further bits for some 1581 commands




















EXIT CODES (after a job completion)




Operations 1) Set proper track and sector info, if needed for the job, in the parameters' array




Code Meaning




(1541: $6...$F; 1551: $8...$D 1581: $0B...$1C or $01BC…$01CD);




01 Everything OK (no error)




2) Write the command code in the Command array (1541: $0...$4; 1551: $2...$6 1581: $2...$8)




02 Header block not found




... DOS automatically will execute the command …




03 SYNC not found (No address mark)




3) Wait until bit #7 in the Command array becomes clear;




04 Data block not found




4) Read exit code in the Command array (bits #0…3)




05 CRC checksum error in data block










06 Format error (1581)



Example: (1541) We have to write the data of the buffer #2 onto disk track #9, sector #5:




07 Verify error




1) Put 9 on $000A; put 5 on $000B; 2) put $90 on $0002;




08 Disk write protected




3)Test bit #7 of address $0002. If set then wait and redo 3)




09 CRC chksum error in header block




4) Read address $0002 AND %1111. If result is 1 (%0001) then all went OK (else see table here rightmost --> )




0A (reserved)










0B ID mismatch (disk was changed)










0C Disk format not logical (1581)




INTERNAL




0D Controller IC error (1581)




COMMAND CODES this color means 1541-1551-1581 this color means: only 1581


0E Syntax error / invalid job no. (1581)










0F Disk not inserted



Code ($) Name Description Notes


10 Byte decoding error (1541)


?
80 READ Read a sector









82 RESET Reset controller and variables

DOS ERRORS (checkable by command channel or by BASIC DS/DS$ variables)






84 MOTON Turn on the motor Set a $01 in the jobs queue after the spin-up sequence is complete
Code (decimal) Description Notes
86 MOTOFF Turn off the motor Off only after the spin-down sequence is complete
00 OK


88 MOTONI Turn on the motor immediately

01 Files scratched (is an output message: not an error) Output (track #) indicates the number of erased files.
8A MOTOFFI Turn off the motor immediately

02 Partition selected (not an error) 1581: Partition command properly executed
8C SEEKPH Seek to a physical track (cylinder)

03…19 (Not an error: ignore)

8E FORMAT Format one physical track (cylinder) The head must be placed over the proper cylinder and set to write the desired side.
20 Read error (Block header not found

90 WRITE Write a sector

21 Read error (No SYNC character)

92 DISKIN Check if there is a disk inserted in the drive

22 Read error (Data block not present)

94 LEDACTON Turn on LED

23 Read error (Checksum error in data block)

96 LEDACTOFF Turn off LED

24 Read error (Byte decoding error)

98 ERRLEDON Enable error LED blinking

25 Write error (Write-Verify error)

9A ERRLEDOFF Disable error LED blinking

26 Write protect on

9C SIDE Set up the disk-side select electronics $01CE-$01D6 have the disk-side of each job
27 Read error (Checksum error in header)

9E BUFMOV Move data to/from cache-track <--> physical track Job parameters: (track)=offset inside cache; (sector)= bit#7: direction 1=disk --> cache; 0=cache --> disk; bit#6: flag cache (1=modified); bit#5: 1=do transfer; bits#4-0: number of blocks (256 bytes each) to transfer.
28 Write error (Long data block)

A0 VERIFY Verify a sector Automatically performed afer writing a block
29 Disk ID mismatch

A2 TRKWRT Update the physical track on disk by copying the Track-cache Not executed if the Track-Cache modified Flag is = 0
30 Syntax error (general syntax)

A4 SP_READ Read a physical sector from disk to buffer#0 ($0300) Track-cache is not involved, the sector is always read from the disk.
31 Syntax error (invalid command)

A6 SP_WRITE Write a physical sector from buffer#0 ($0300) to disk Track-cache is not involved
32 Syntax error (too long command)

A8 PSEEK Seek to a specified physical track

33 Syntax error (invalid filename)

AA TREAD Read logical address without transferring to the job queue buffer

34 Syntax error (no file given)

AC TWRT Write logical address without transferring from the job queue buffer

39 Syntax error (on channel #15)

B0 SEEK Find a sector 1581: Track-cache is not involved
50 Record not present error

B2 TPREAD Read a physical address without transferring to the job queue buffer

51 Overflow in record (PRINT#)

B4 TPWRT Write a physical address without transferring from the job queue buffer

52 File too large (relative files)

B6 DETWP Check if the inserted disk is write protected Result: $00 not protected; $08 protected
60 Write file already open

B8 SEEK Particular Seeks for a particular logical track Cache not updated
61 File not open

C0 BUMP Reset head and find track 1

62 File not found

D0 JUMP Execute the program in the buffer

63 File already existing

E0 EXECUTE Execute the program in the buffer after loaded from disk Before to execute, it switches drive on, then find the track
64 File type mismatch

F0 FORMATDK Format the disk Use default physical format
65 No block (B-A command) Output parameters indicate the next higher available block (0,0 stand for no further available block)





66 Illegal block coordinate






67 Illegal (system) track or sector






70 No channel available Max is 6 open files





71 Directory error (on RAM) Needs a drive initialization





72 Disk full Data blocks or Directory' entries





73 DOS mismatch (xxxxxxx) with disk format. The string xxxxx stands for the current DOS version. It is output also just after the drive initialization, in this case it is not an error. Disk was formatted with a previous DOS version and is not Write compatible.





74 Drive not ready






75 Format error






76 Controller error IC WD177x is fault





77 Selected partition illegal Wrong parameters for a legal partition




* 79 SOFTWARE DAVID SIRACUSA, HARDWARE GREG BERLIN Easter egg / hidden text message




* 7: DEDICATED TO MY WIFE LISA Easter egg / hidden text message


















1581 only






















* These messages can be output by commands "B-?" and "B-*" retrieving one byte at once until ST becomes >0. Example: PRINT#d,"B-?": GET#1,A$: PRINT A$;: IF ST=0 THEN redoGet
DISK surface maps:
For 1541 and 1551






















Tracks Sectors 1541 Sectors 1551









01 -17 21 21









18 21 (BAM & Directory) 21 (BAM & Directory)









19 - 24 19 19









25 - 30 18 18









31 - 35 17 17
















































MASTER tracks:
























Track 18; Sector 0

For 1541 and 1551
Track 40; Sector 0


For 1581















Offset (Hex) Designed area Notes

Offset (Hex) Designed area



00 - 01 Link to next tk/sector Aims to first Directory sector Tipically TK 18; ST 01
00 - 01 Link to next tk/sector



2 [$41] Flag for drive type


02 [$41] Flag for drive type



3 [$00]


03 [$00]



4 - 8F BAM (blocks allocating table) 4 bytes for each track ---> . Bitmap pattern stands with MSB as the higher sector number (ex. In 8-15: MSB is 15, LSB is 8) Byte 1: number of free blocks Byte 2: bitmap of sectors 0-7 Byte 3: bitmap of sectors 8-15 Byte 4: bitmap of sectors 16-...
04 - 15 Disk name



90 - A1 Disk name (padded with $A0 on tail)

16 - 17 Disk ID



A2 - A3 Disk ID


18 [$A0]



A4 [$A0]


19 DOS version



A5 - A6 ASCII "2A" format version


1A Disk version



A7 - AA Free Filled with [$A0]

1B - 1C [$A0] [$A0]



AB - FF Free Filled with [$00]

1D - FF Free Filled with [$00]

































Track 40; Sector 1


For 1581




















Offset (Hex) Designed area








00 - 01 Link to next part of the BAM (Tk40;St2) If still in Tk40; St2 then $00 $FF (no link).







02 Version








03 Compliment version








04 - 05 Disk ID








06 I/O byte bit7: verify on/off bit6: check header CRC on/off







07 Flag auto-loader








08 - 0F Reserved








10 - FF BAM 6 bytes for each track --> . Bitmap pattern stands with MSB as the higher sector number (ex. In 8-15: MSB is 15, LSB is 8) Byte 1: number of free blocks Byte 2: bitmap of sectors 0-7 Byte 3: bitmap of sectors 8-15 Byte 4: bitmap of sectors 16-23 Byte 5: bitmap of sectors 24-31 Byte 6: bitmap of sectors 32-39


Sheet 10: HW


HARDWARE







Release 2.1











































































































































































































































































































































BUS TIMING diagram for 264 family computers




Credits: Crown/GOTU






























































































































































































































Clock cycle in scanline (decimal) 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
Bus access in fast mode DMA (22+3) p p p p - * - * - * - S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F p R p R p R p R p R p p p p p p p p p p p p p
Bus access in slow mode DMA (14+3) - p - p - * - * - * - S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F S F p R p R p R p R p R p - p - p - p - p - p - p
Bus access in fast mode normal (65) p p p p - p - p - p - p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p R p R p R p R p R p p p p p p p p p p p p p
Bus access in slow mode normal (57) - p - p - p - p - p - p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p F p R p R p R p R p R p - p - p - p - p - p - p
Bus access in fast mode border (109) p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p R p R p R p R p R p p p p p p p p p p p p p
Bus access in slow mode border (57) - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p - p R p R p R p R p R p - p - p - p - p - p - p
Value of Horizontal Dot Counter register ($FF1E) $c4 $c6 $c8 $ca $cc $ce $d0 $d2 $d4 $d6 $d8 $da $dc $de $e0 $e2 $00 $02 $04 $06 $08 $0a $0c $0e $10 $12 $14 $16 $18 $1a $1c $1e $20 $22 $24 $26 $28 $2a $2c $2e $30 $32 $34 $36 $38 $3a $3c $3e $40 $42 $44 $46 $48 $4a $4c $4e $50 $52 $54 $56 $58 $5a $5c $5e $60 $62 $64 $66 $68 $6a $6c $6e $70 $72 $74 $76 $78 $7a $7c $7e $80 $82 $84 $86 $88 $8a $8c $8e $90 $92 $94 $96 $98 $9a $9c $9e $a0 $a2 $a4 $a6 $a8 $aa $ac $ae $b0 $b2 $b4 $b6 $b8 $ba $bc $be $c0 $c2




















































































































Bus access legend

















































































































Device


Access types













































































































Bus controlled by TED


S: reading colour/screen memory




F: reading font(/bitmap?) memory




R: refreshing RAM

































































































Bus available to CPU


p: work cycles




*: stop cycles, write access only







































































































Bus unused


-: memory location $FFFF accessed











































































































































































































































































































































































































































































































































































































































































































USER PORT PIN layout








Blue = the same connections









































































































Plus/4 C64


































































































Pin Sign
Description



I/O* Sign
Description





































































































(*) The 8 bits of Data pins are operating as all 1 GND
Ground




GND
Ground








































































input or all output. Data direction is set by both 2 +5V
+5 V DC (100 mA max)




+5V
+5 V DC (100 mA max)








































































CS and R/W status'. 3 /BRESET
Buffered system reset



O /RESET
Reset and forced cold start





































































































CS: low; R/W: low = Output 4 PB2
Data 2 (I/O port) / CST Sense on C16 (Cassette key sensor) I/O CNT1
Counter 1 from CIA #1





































































































CS: low; R/W: high = Input 5 PB3
Data 3



I/O SP1
Serial Port 1 from CIA #1





































































































CS: high: R/W: any = Isolation 6 PB4
Data 4



I/O CNT2
Counter 2 from CIA #2






































































































7 PB5
Data 5



I/O SP2
Serial port 2 from CIA #2





































































































General rule: write 1 to a bit before to read it. 8 RxC
Receive clock



I/O /PC2
Handshaking line from CIA #2






































































































9 ATN
Serial attention IN



O ATN
Serial attention IN






































































































10 +9V AC
9 V AC (+ phase) (400 mA max)




+9V AC
9 V AC (+ phase) (100 mA max)






































































































11 -9V AC
9 V AC (- phase)




-9V AC
9 V AC (- phase) (100 mA max)






































































































12 GND
Ground




GND
Ground

























































































































































































































A GND
Ground




GND
Ground






































































































B PB0
Data 0



I/O /FLAG2
Flag 2






































































































C RxD
Receive Data



I PB0
Data 0






































































































D RTS
Request To Send



O PB1
Data 1






































































































E DTR
Data Terminal Ready



O PB2
Data 2






































































































F PB7
Data 7 (I/O port)



I/O PB3
Data 3






































































































H DCD
Data Carrier Detect



I PB4
Data 4






































































































J PB6
Data 6 (I/O port)



I/O PB5
Data 5






































































































K PB1
Data 1



I/O? PB6
Data 6






































































































L DSR
Data Set Ready



I PB7
Data 7






































































































M TxD
Transmit data



O PA2
PA2






































































































N GND
Ground




GND
Ground













































































































































































































































































































































1 2 3 4 5 6 7 8 9 10 11 12


Signal direction:

any
output
















































































































input
in/out




























































































A B C D E F H J K L M N
























































































































































































































Connector layout as seen from outside the Plus/4 (see at side info for colors meanings)






















































































































































































































































































































































CPU Speed

















































































































(Courtesy of Plus4world.com) Crystal
$FF07 #6 $FF06 #4 $FF13 #1 FPS TED freq. CPU freq. Vs PAL-C64


































































































PAL
PAL
TRUE FALSE 49.78098 1,773,448 1,145,361
116%


































































































PAL
PAL
TRUE TRUE 49.78098 1,773,448 778,276
79%

































































































---> Click here to go to hardware frequencies PAL
PAL
FALSE FALSE 49.78098 1,773,448 1,692,952
172%


































































































PAL
PAL
FALSE TRUE 49.78098 1,773,448 885,305
90%


































































































PAL
NTSC
TRUE FALSE 74.07884 2,216,809 1,300,676
132%


































































































PAL
NTSC
TRUE TRUE 74.07884 2,216,809 947,024
96%


































































































PAL
NTSC
FALSE FALSE 74.07884 2,216,809 2,115,544
215%


































































































PAL
NTSC
FALSE TRUE 74.07884 2,216,809 1,106,293
112%


































































































NTSC
PAL
TRUE FALSE 40.19138 1,431,818 924,723
94%


































































































NTSC
PAL
TRUE TRUE 40.19138 1,431,818 628,352
64%


































































































NTSC
PAL
FALSE FALSE 40.19138 1,431,818 1,366,829
139%


































































































NTSC
PAL
FALSE TRUE 40.19138 1,431,818 714,764
73%


































































































NTSC
NTSC
TRUE FALSE 59.80860 1,789,773 1,050,119
107%


































































































NTSC
NTSC
TRUE TRUE 59.80860 1,789,773 764,593
78%


































































































NTSC
NTSC
FALSE FALSE 59.80860 1,789,773 1,708,014
173%


































































































NTSC
NTSC
FALSE TRUE 59.80860 1,789,773 893,182
91%





















































































































































































































CPU frequencies in modes where the display enable ("border") bit is set, are lowest guaranteed. Actual frequencies can be 1-3 cycles more per bad/DMA line depending on whether or not the CPU is executing write cycles. This has a theoretical upside potential of an additional 50 × 3 = 150 cycles per frame. The reference C64 CPU frequency is the maximum frequency with all - character as well as sprite - DMA off.



















































































































































































































































































































































































































































































































































































































































































































































































EXPANSION PORT PIN layout








Blue = the same connections









































































































Plus/4 C64

































































































(Courtesy of zimmers.net) Pin Sign
Description



I/O Sign
Description






































































































1 GRN
GrouND




GRN
GrouND






































































































2 +5






+5








































































































3 +5






+5








































































































4 /IRQ
InteRrupt reQuest I /IRQ
InteRrupt reQuest


































































































5 R/W
System Read Write line



O R/W
System Read Write line






































































































6 C1HI
External cartridge Chip selects (active LOW) O Dot Clock
Screen pixel timer (8,18 MHz)






































































































7 C2LOW (reserved)






/I-O1
($DExx)






































































































8 C2HI (reserved)






/GAME
Input ls ttl






































































































9 /CS1
Internal ROM Chip Select



O /EXROM
Input ls ttl






































































































10 /CS0
Internal ROM Chip Select



O /I-O2
($DFxx)






































































































11 /CAS
DRAM Column Address Strobe




/ROML
8K Rom/Ram decoded ($8000)






































































































12 MUX
DRAM Address MUltipleX control signal O BA
Bus Available from VIC-II






































































































13 BA
Bus Available (low for DMA)



O /DMA
Direct Memory Access






































































































14 D7
System Data



O D7
System Data






































































































15 D6
System Data



O D6
System Data






































































































16 D5
System Data



O D5
System Data






































































































17 D4
System Data



O D4
System Data






































































































18 D3
System Data



O D3
System Data






































































































19 D2
System Data



O D2
System Data






































































































20 D1
System Data



O D1
System Data






































































































21 D0
System Data



O D0
System Data






































































































22 AEC






GRN
GrouND






































































































23 EXT AUDIO
EXTernal Audio (1 V p-p full scale. AC coupled) I Not present


































































































24 PHI 2
Artificial PHI 2. Address valid rising edge. Data valid falling edge O


































































































25 GND




























































































































































































































A GRN
GrouND




GRN
GrouND






































































































B C1LOW
External cartridge chip selects (active LOW) O /ROMH
8K Rom/Ram decoded ($E000)






































































































C /BRESET
Buffered Reset



O /RESET








































































































D /RAS
DRAM Row Address Strobe



O /NMI








































































































E PHI0






PHI2








































































































F A15
System Address



O A15
System Address






































































































H A14
System Address



O A14
System Address






































































































J A13
System Address



O A13
System Address






































































































K A12
System Address



O A12
System Address






































































































L A11
System Address



O A11
System Address






































































































M A10
System Address



O A10
System Address






































































































N A9
System Address



O A9
System Address






































































































P A8
System Address



O A8
System Address






































































































R A7
System Address



O A7
System Address






































































































S A6
System Address



O A6
System Address






































































































T A5
System Address



O A5
System Address






































































































U A4
System Address



O A4
System Address






































































































V A3
System Address



O A3
System Address






































































































W A2
System Address



O A2
System Address






































































































X A1
System Address



O A1
System Address

















80



















































































Y A0
System Address



O A0
System Address






































































































Z NC






GND
GrouND






































































































AA NC






Not present


































































































BB NC









































































































CC GND
















































































































































































































































































































































1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25





























































































































































































A B C D E F H J K L M N P R S T U V W X Y Z AA BB CC











































































































































































































Connector layout as seen from outside the Plus/4







Colors meaning:

input
output




































































































Sheet 11: BASIC



BASIC 3.5 INTERPRETER TABLES









Release 2.1
















































































































































Use of the RAM








































































































Without graphic area allocated



With graphic area allocated






Click for more info on graphic area allocating Click to go to Basic GRAPHIC command


































FROM TO Reserved to (vectors between parenthesis)

FROM
TO Reserved to (vectors between parenthesis)










































$0000 $0FFF O.S. memory

$0000
$0FFF
O.S. memory










































$0800 $0BFF Colors of text screen

$0800
$0BFF
Colors/luminances of text screen










































$0C00 $0FFF Characters of text screen

$0C00
$0FFF
Characters of text screen










































($2D,2E) ($2F,$30)-1 Variables descriptors area

$1000
$17FF
---- free ----










































($2F,$30) ($31,$32)-1 Arrays descriptors area

$1800
$1FFF
Tiles' attributes of Hires screen










































($31,$32) ($33,$34)-1 --- free --- (room can be reduced by strings managing)

$2000
$3FFF
Bitmap of Hires screen










































($33,$34) ($37,$38)-1 Strings texts area (default: $xxxx…$FD00)

($2D,2E)
($2F,$30)-1
Variables descriptors area










































($37,$38) $FFFF I/O, TED, and O.S.

($2F,$30)
($31,$32)-1
Arrays descriptors area















































($31,$32)
($33,$34)-1
--- free --- (room can be reduced by strings managing)















































($33,$34)
($37,$38)-1
Strings texts area (default: $xxxx…$FD00)















































($37,$38)
$FFFF
I/O, TED, and O.S.













































































































































































































Bytes:















































BASIC line structure

Pointer to area (start): $2B, $2C (the previous byte must be $00) Pointer to area (end+1): $2D, $2E $00 Next line address (LO) Next line address (HI) Line # (LO) Line # (HI) Text of the line $00 Next sequence ($00, $00 = End of program)









































Example for 15 PRINT "ABC" $1000: 00 0C 10 0F 00 99 20 22 41 42 43 22

00 00 00






































































































































































































































































































Variables and Arrays






















































Variables/Arrays names rules:









































- 1st character must be an alphabetic letter (ex. A%, K$, R).









































- 2nd character (optional) can be an alphabetic letter or a numeral (ex. AC%, F2, GU$).









































- Only the first 2 characters of the name are computed (ex. AL$, AL4$, ALBERT$ refer to the same variable: AL$).









































- Forbidden names: all the Basic keywords, plus DS, ER, EL, ST, TI, DS$, TI$, ERR$(), RD (V364 system).









































- Legal suffixes: [any] = Numeric floating point / Names of function; [%] = Numeric integer; [$] = String.




























































































BASIC Suffix /--------------- Bytes of each variable entry: ----------------\















































V A R I A B L E S (any) Name (alfabetic) Optional 2nd character of name (alphanumeric) or $00 if missing Exponent + $80 ($00 = complete number is 0) Mantissa (binary MSB … LSB) without initial "0." . The leftmost bit is the sign (1=neg). Once read the sign bit, you have to set it to 1 in order to obtain the complete 32 bits binary mantissa
Example exponent = $95 -$80 = $15 Example mantissa = $16 $B4 $38 $00 becames 0.$96 $B4 $38 $00. The formula to obtain a decimal value from the binary mantissa is:







































Example for A2=1234567 Hex: 41 32 95 16 B4 38 00
































































































+$80
















































VARIABLES For Function Names: (DEFFNxy and FNxy) . Pointer to dedicated area: $2D, $2E The name of the function (ZH in the below example) can be the same of an already existing FP variable used independently. System is able to distinguish them. (any) Name (alfabetic) + $80 Optional 2nd character of name (alphanumeric) or $00 if missing LSB address of the Funct. Definition (first byte after =) MSB address of Funct. Definition (first byte after =) LSB address to the value of the control variable MSB address to the value of the control variable Value of the first character in the Function definition (pointed by *)
Important: The parametric value (B3 in the example) is just for interpreter reference of the command DEF. When you use FNx(y), its value can be supplied in any way. For example: constant FNx(1234), any variable (ex: FNx(k1), FNx(a%), etc.) since it is NOT obligatory to use the same variable name written in DEF FN.







































Example for DEF FN ZH(B3)=35*b3 Hex: DA 48 * *















































Z+$80 H Address to "3" of 35 Address to the value of var. B3 "3"
































































































+$80 +$80















































VARIABLES Integer: . Pointer to dedicated area: $2D, $2E Range: -32768 to +32767 % Name (alfabetic) + $80 Optional 2nd character of name (alphanumeric) +$80 ($80 if any) MSB LSB unused unused unused










































Example for D%=258 Hex: C4 80 01 02









































































































































































































+$80













































VARIABLES String: . Pointer to definition area: $2D, $2E Pointer to texts (top+1): $37, $38 Pointer to texts (bottom+1): $33, $34 length max: 255 characters each. $ Name (alfabetic) Optional 2nd character of name (alphanumeric) +$80 ($80 if any) length (0…255) LSB address of the string MSB address of the string unused unused









































Example for D5$="HELLO WORLD" Hex: 44 B5 0B F3 FC


<--- Values for below example




























































































Bytes:















































Format of the string text: The area is used downward starting from address vectored by $37,$38 (-1) that remains fixed. The vector $33,$34 indicates the address of last used byte (the next one free is at that address -1).
Text (first character) Text… Text… Text Text (last character) Address of length byte (LO) if string is valid; Length if string is obsoleted Address of length byte (HI) if string is valid; $FF if string is obsoleted.












































Example addresses --> $FCF3 …… ….. $FCFC $FCFD $FCFE $FCFF
<--- In this example: $37,$38 = $FD00; $33,$34 = $FCF3










































Example data --> Hex: 48 …… ….. 4C 44 0C 10












































Hex: 48 …… ….. 4C 44 0B FF
<--- Example in case of string obsoleted: see last 2 bytes (these ones for fast garbage-collection use)










































PETSCII: H …… …… L D


















































































































































































































































































































Suffix
Bytes:














































ARRAYS Floating point: . Pointer to dedicated area: $2D, $2E Precision: -4.294.967.304 to +4.294.967.304 Range: 2.93873588e-39(*) to 1.70141183e+38 . (*) The use of -39 as exponent could produce a value of zero in the whole number (ex. 2.93873511e-39) (any)
Name (alfabetic) Optional 2nd character of name (alphanumeric) ($00 if any) LSB memory amount of the array MSB memory amount of the array Number of dimensions (1…255) MSB elements of last dimension (rightmost) LSB elements of last (rightmost) dimension MSB, LSB elements of penultimate dimension… . ...and so on MSB and LSB of all the dimensions backward until the leftmost dimension MSB elements of first (leftmost) dimension LSB elements of first (leftmost) dimension Exponent + $80 ($00 = complete number is 0) Mantissa (binary MSB … LSB) without initial "0." . The leftmost bit is the sign (1=neg). Once read the sign bit, you have to set it to 1 in order to obtain the complete 32 bits binary mantissa Exponent + $80 ($00 = complete number is 0) Mantissa (binary MSB … LSB) without initial "0." . The leftmost bit is the sign (1=neg). Once read the sign bit, you have to set it to 1 in order to obtain the complete 32 bits binary mantissa …….. Exponent + $80 ($00 = complete number is 0) Mantissa (binary MSB … LSB) without initial "0." . The leftmost bit is the sign (1=neg). Once read the sign bit, you have to set it to 1 in order to obtain the complete 32 bits binary mantissa For more info on elements order, see below schematic (Arrays integer)





















Example for FQ(4,5,6) [5*6*7=210 elements]
Hex: 46 51 25 4 03 00 07 00 06 00 05 Value of element (0,0,0) Value of element (1,0,0)
Value of last element (0,0,6)

























'F' 'Q' $425=1061 bytes of memory 3 7 Elements for the 3rd dimension [from 0 to 6] 6 5



































































































































































































Suffix
Bytes:















































ARRAYS Integer: . Pointer to dedicated area: $2F, $30 Range: -32768 to +32767 %
Name (alfabetic) + $80 Optional 2nd character of name (alphanumeric) +$80 ($80 if any) LSB memory amount of the array MSB memory amount of the array Number of dimensions (1…255) MSB elements of last dimension (rightmost) LSB elements of last (rightmost) dimension MSB, LSB elements of penultimate dimension… . ...and so on MSB and LSB of all the dimensions backward until the leftmost dimension MSB elements of first (leftmost) dimension LSB elements of first (leftmost) dimension First dimension: MSB of element 0 First dimension: LSB of element 0 First dimension: MSB of element 1 First dimension: LSB of element 1 …….. Second dimension: MSB of element 1 Second dimension: LSB of element 1 Second dimension: MSB of element 2 Second dimension: LSB of element 2 …….. Last dimension: MSB of element 1 Last dimension: LSB of element 1 …….. Last dimension: MSB of last element Last dimension: LSB of last element























Example for E2%(4,5,6) [5*6*7=210 elements]
Hex: C5 B2 AF 01 03 00 07 00 06 00 05 Value of element (0,0,0) Value of element (1,0,0)
Value of element (0,1,0) Value of element (0,2,0)
Value of element (0,0,1)
Value of element (0,0,6)


























'E'+$80 '2'+$80 $1AF=431 bytes of memory 3 7 Elements for the 3rd dimension [from 0 to 6] 6 5



































































































































































































Suffix
Bytes:















































ARRAYS String: . Pointer to definition area: $2D, $2E Pointer to texts (top+1): $37, $38 Pointer to texts (bottom+1): $33, $34 length max: 255 characters each. The texts are stored in text string area like string-variables do (see above). $
Name (alfabetic) Optional 2nd character of name (alphanumeric) +$80 ($80 if any) LSB memory amount of the array MSB memory amount of the array Number of dimensions (1…255) MSB elements of last dimension (rightmost) LSB elements of last (rightmost) dimension MSB, LSB elements of penultimate dimension… . ...and so on MSB and LSB of all the dimensions backward until the leftmost dimension MSB elements of first (leftmost) dimension LSB elements of first (leftmost) dimension First dimension: length of the text of element 0 First dimension: address (LSB) for text of element 0 First dimension: address (MSB) for text of element 0 First dimension: length of the text of element 1 First dimension: address (LSB) for text of element 1 First dimension: address (MSB) for text of element 1 …….. Second dimension: length of the text of element 1 Second dimension: address (LSB) for text of element 1 Second dimension: address (MSB) for text of element 1 …….. Last dimension: length of the text of element 6 Last dimension: address (LSB) for text of element 6 Last dimension: address (MSB) for text of element 6
























Example for RT$(4,5,6) [5*6*7=210 elements]
Hex: 52 D4 81 02 03 00 07 00 06 00 05 Ref. of element (0,0,0) Ref. of element (1,0,0)
Ref. of element (0,1,0)
Ref. of element (0,0,6)



























'R' 'T'+$80 $281=641 bytes of memory 3 7 Elements for the 3rd dimension [from 0 to 6] 6 5














































































































































Arrays calculator

















































(Just input dimensions sizes and data-type!)
MEMORY CALCULATOR FOR ARRAYS Just input dimensions sizes and data-type!














































Dimension 1: 5 6

















































Dimension 2: 10 66

















































Dimension 3: 6 462

















































Dimension 4: 7 3696

















































Dimension 5:
3696
Mind that a dimension definition includes the 0 position too. For example















































Dimension 6:
3696
declaring 3 will allocate 4 positions (0, 1 , 2, 3).















































Dimension 7:
3696
123A 1 2 3 4
<--Ordinale





































-Please select-



Data type (i / f / s): f 5 0
1 2 3 A






































i Integer







4666 1 2 3 10






































f Floating point



Total elements: 3.696 Total memory: 18.493 (18.1 KB)

3 2 1 0
<--Potenza




































s String



(Optional) Start address (Hex): $ 123A 3
23,158 5 10 7 6











































Calculated End address: $5A76 696

2678 118 6

<--Resti












































S\/S 5A76 5 A 7 6















































18,493 18 493



















































































































































































































































































































KEYWORDS AND TOKENS


Warning: In all graphic commands: When skip writing some coordinates (then using the default ones) you must skip only one step instead of two. Example: PAINT 2,100,80,1 will be PAINT 2, ,1 instead of PAINT 2, , ,1. Equivalent DOS command









































In all DOS commands possible variables supplied as parameters must be written inside round parenthesis. For example: DIRECTORY (a$),U(b%).





































Command code $ Keyword Abbrev. Description Syntax Default values





































80 END eN End of program execution

END













































81 FOR fO Begin of a cycle. When met NEXT command, the variable x (only floating-point type) is compared with z: if lower, then a new cycle is performed. One cycle is always performed whatever are the starting variables situation (the control is calculated on NEXT command execution). FOR x=y TO z [STEP k]: … : NEXT [x[,w[,…]]]





k=1

FOR...NEXT Saved data structure (saved on BASIC stack on $07AF downward) Byte 1: $81 Bytes 2/3: Address of the first of the 5 bytes value of the (floating type) control variable (L/H) Bytes 4/8: 5 bytes of the STEP value (floating) always as negative. Byte 9: Flag: $01= Step positive; $FF= Step negative.




















82 NEXT nE End of cycle (see FOR keyword info). The optional variables allow to set only one NEXT command for more nested cycles. The order of control variables must be in the opposite order of the nesting. Example: FOR x=4… : FOR q=2… : FOR s=3….. : NEXT s,q,x NEXT [x[,y[,…]]]





the current (last) control-variable

Bytes 10/14: 5 bytes of the fix final value (floating) Bytes 15/16: Basic line-number of FOR statement (L/H) Bytes 17/18: Address of the last character of FOR statement line [00] or [:]. Warning: H/L




















83 DATA dA Begin of a DATA definition line. Some values like "," ":" or strings with keyboard (ex. "TOTAL") must be included in inverted commas. DATA n[,m[,o[,…]]]







































84 INPUT# iN Load values from a device x (disk, tape, etc.) and put them into variable(s). The command reads an entire sequence of characters until a [Return ($0D)]. If more variables are to be loaded, the single data inside the sequence must had be saved separated by commas. String data have to be associated only to string-variables. The buffer can read at max 88 characters. The device must be open. Please avoid to use inside the data string the following characters: $00 "," ":" in order to avoid undesired behaviors. Warning: Possible space-characters at beginning of the string are automatically ignored. (Ex. " ABC" will be acquired as "ABC"). INPUT# x,a[,b[,c[,…]]]













































85 INPUT
Accept values from keyboard and put them into variable(s). Multiple values must be separated by ",". The symbol ":" acts ignoring all the rest (*). A prompt text "tttt" (immediate value, not from a variable) can be shown. System prints a "?" and the cursor flashes waiting for keys. [Return] will end the input. If some variables (b, c,... in the syntax example) are not loaded yet, system prints further "??". If are typed more values than assigned variables, system prints "?EXTRA IGNORED". If a string text is input instead of a numeric value, system prints "?REDO FROM START" and the entire data have to be re-inserted. The buffer can read at max 88 characters. Warning: a) If you press at once [Return] without before having pressed other keys, the possible previous content of the variable is confirmed. b) Possible space-characters at beginning of the string are INPUT ["tttt";]a[,b[,c[,…]]]








































automatically ignored. (Ex. " ABC" will be acquired as "ABC"). (*) Trick: In order to input a single string containing "," or ":" you should execute the following commands before the INPUT: POKE 1319,34: POKE 1320,34: POKE 1321, 20: POKE 239,3.






































86 DIM dI Define array(s) and dimensions. (Max 255 dimensions)

DIM a(x[,y[,z[,…]]]) [,b(x[,y[,z[,…]]])] [,…]





x,y,z = 10,10,10 (when used an array element without a DEF)






































87 READ rE Read values from DATA lines and store onto variables

READ a[,b,c,…]













































88 LET
Assign a value to a variable (the keyword can be omitted)

[LET] x=n













































89* GOTO gO Jump program execution to line-number n

GOTO n





n=0






































8A RUN rU Start execution of program after cleaning all variables. If present, the parameter n indicates the line-number from where to start. RUN [n]





n=0






































8B IF
Conditioned execution

IF x boolean-cond y THEN [GOTO] n[: ELSE n]





x boolean-cond y = only one variable. The result is TRUE when variable <>0. Example: IF z THEN n






































8C RESTORE reS Reset DATA pointer to a DATA line. If no line-number is supplied, then the first the system will aim the first DATA command of the program. RESTORE [n]





n=0






































8D GOSUB goS Jump to subroutine

GOSUB n








GOSUB Saved data structure (saved on BASIC stack $07AF downward) Byte 1: $8D Bytes 2/3: Basic line-number of the GOSUB statement (L/H) Bytes 4/5: Address of the first character of the line-number specified in the GOSUB statement (L/H) . [ex. GOSUB 32145: address of the "3"]




















8E RETURN reT Return from subroutine

RETURN





























8F REM
Write a comment line. "tttt" can be any sequence of characters. REM [ttt…]





























90 STOP stO Halts the execution of program

STOP





























91 ON
Conditioned vectored execution. The program execution jumps to one of the line-numbers indicated, depending on the values of x (1 -> First line-number; 2 -> second line-number, etc.). If the value of x is greater than the number of parameters supplied, then the execution goes to the next line. ON x GOTO/GOSUB n[,m,o,…]













































92 WAIT wA Pause execution depending on a memory value. System checks the memory location x, EORring it with value z (if present), then ANDing it with parameter y. If result is zero, redo the execution. WAIT x, y [,z]





z=0






































93 LOAD lO Load the program b from external device x. The optional parameter y, when set to 1 causes the program is loaded in the same memory address it was when saved. Not needed device was open. Only in case of Tape: If the file was SAVEd with option [,1] or [,3] the program is anyway loaded into its old position even if [,0] flag is supplied with the LOAD command. Running time: if this command is executed in running time then, after the loading, the system automatically restarts the execution from the first statement of the just loaded program. Even if the variables are not affected by this operation a special care must be applied when the new program is larger than the old one, because it could have overwritten the variables' area. LOAD [b] [,x] [,y] b="*"; x=1; y=0 OS96: x=9; y=0; (but no more tape). Ex: the new command "LA b" stands for LOAD b,8,1






































94 SAVE sA Save the program from memory to external device x with name b (max 16 characters). Not needed device was open. The optional parameter y affects only saving on Tape. Meanings: 0 = no action; 1 = always load in the same address it was saved; 2 = Add an EOT flag (End of Tape: no further tape search); 3 = both 1 and 2 flags. SAVE b [,x] [,y] x=1 y=0 OS96: x=9






































95 VERIFY vE Verify, comparing with memory, a saved program. (if b="*" then last filename is used) VERIFY [b [,x]] [,1] [b="*",x=1] [,0] OS96: x=9






































96 DEF FN dE Define a user function FN(). Parameters: b=name of the function (2 chars like a FP-variables name); y=parameter to pass to. Once defined, the function can be called inside any math expression, and supplying with the parametric value. Example: DEF FNa2(k)=1/SQR(k). After defined, you can use the function FNa2, just invoking it supplying a value for the parameter; ex.: PRINT FNa2(25) or even PRINT FN a2(x%) where x%=25. The output will be 0,20 like 1/SQR(25). Warning: Both the name of the function (a2 in the example) and the parameter (k in the example) used in DEF FN are not standard variables but only local referrings. Then you can quietly use their name for other purposes in other parts of your program as standard FP-variables. DEF FNb(y)= math-expression or string-expression (that can include a parametric value symbolized by y)







































97 POKE pO Force a value onto a memory location

POKE a,b







































98 PRINT# pR Save variables/constants onto external device x. The values are sent to the device sequentially as they are. In order to retrieve them (by command INPUT#) you have to take care of: 1) Do not exceed 88 characters before to store a [Return]; 2) Separate different data by storing "," or ":" between them. In this way they will be assigned to different variables by INPUT#. 3) Do not use "," in the list of data to store. Infact, like for PRINT, this causes the skip to next TAB position, adding space-characters. 4) ":" "," $00 are interpreted as terminator-characters then the following character will be not read by INPUT#. If this is the case, the only way to read them are by GET#. 5) If at end of the command you put a ";" then nothing is send; if do not then a [Return] is added. PRINT# x,[y[,z[…]]][;]







































99 PRINT ? Print data onto screen. The data to be print can be either variables contents, constants, or results of math calcolus'. Special signs at end of the statement: "," = skip to next tabulation (at 0,10, 20,30) used to order data. ";" = maintain the position just after last printed datum; [Nothing] = go to new line (Return). Printing numbers has a dedicated pattern: ["-" or "space"]value[CrsrRight]. Then for example PRINT 12;-4,567,-3 will obtain: 12 -4 567 -3.In order to overcome this system setting, for example if you want to print a number within brackets, you have to do: PRINT n; [CrsrLeft]")"; then calculate the number of ciphers by the formula int(log(n)/log(10)+1), where n is the printed number, and tab back to print the first bracket. PRINT [TAB(x)][;][SPC(y)][;]a[,/;b[,/;c[,…]]][,/;]







































9A CONT cO Continue after a STOP. If used inside a program, the command will stop the running until a [STOP] key is hit. CONT













































9B LIST lI (l + shift-i) List program in memory. Parameters: n=start line; m=end line LIST [n][-][m] first line-number - last line-number






































9C CLR cL Purge all the variables. The stack is reset too, then a possible working cycle (FOR...NEXT, DO...LOOP) is reset. RESTORE is set to the first DATA line since the begin of the BASIC program. CLR













































9D CMD cM Force a temporarly default output device. The parameter x sets the (already open) device# where to deviate the output of PRINT / LIST / DIRECTORY commands. A "PRINT# x" command will stop the deviation. CMD x







































9E SYS sY Execute m.l. code starting from address a. The values of uP registers must be supplied as follows: $7F2: .A $7F3: .X $7F3: .Y $7F3: .SR The segment of code must be end with a RTS, then the control is passed to the Basic interpreter. Meant that the same memory locations above described will bring out the values of the registers, as they are after the code execution. SYS a













































9F OPEN oP Open an I/O channel/device. Parameters: x = Logical name; y = Device type or filename; z = secondary address OPEN x,y [,z [,a]]







































A0 CLOSE clO Close an I/O channel/device

CLOSE x







































A1** GET GET# gE 1) GET Read one character from the keyboard. If no key was pressed the result is a null string (""). 2) GET# (tokens: $A1 $23) read one byte from the (open) device x. Contrary to INPUT#, this command does allow to read any character, then control-codes too. Parameters: x = (already open device); b = variable (numeric or string). Warning: the execution of GET will clear a possible active CMD setting the output to the standard device. 1) GET b 2) GET# x,b







































A2 NEW
Reset Basic pointers and clear current program and all variables. NEW













































A3 TAB( tA Horizontal tabulation for PRINT. Warning: if used with PRINT# then spaces are sent (instead of cursor right). TAB(x) --> see PRINT for syntax







































A4 TO
Destination for various commands (DRAW, GO, RENAME, etc.) TO













































A5 FN
Function FN x(y). See more info in DEF command DEF FNx(y)=….. in DEFinition; FNx(y) in calculation

Jump to DEF FN command




































A6 SPC( sP Like TAB( but printing x spaces

SPC(x) --> see PRINT for syntax







































A7 THEN tH Second part of IF…THEN statement. The code after THEN is executed if the condition results true. In this case, a possible [:ELSE m] in the same line is ignored. The parameter n could be either a line-number to jump to, or other commands. IF x boolean-cond y THEN n [:ELSE m]







































A8 NOT nO Boolean operator NOT

NOT(a)







































A9 STEP stE Optional step for FOR…NEXT command

FOR x=y TO z [STEP k]: … : NEXT [x[,w[,…]]] k=1






































AA +
Math operator +

a+b













































AB -
1) Math operator - (subtraction) 2) negative sign 1) a-b 2) -b







































AC *
Math operator *

a*b













































AD /
Math operator /

a/b













































AE

Math operator ^

a^b













































AF AND aN Boolean operator AND

a AND b







































B0 OR
Boolean operator OR

a OR b







































B1 >
Logic operator >

a>b













































B2 =
Logic operator =

a=b













































B3 <
Logic operator <

a<b













































B4 SGN sG Math function SGN()

SGN(a)







































B5 INT
Math function INT()

INT(a) - Warning of the bug (click here)







































B6 ABS aB Math function ABS()

ABS(a)







































B7 USR uS User function USR(). Execute a new function written by the user (SUBroutine in Machine Code). On memory cells $501,$502 must be set the address (L/H) where the code resides (not greater than $7FFF). Parameter info: if the parameter (y) is a numeric value (or a variable), then system stores it in floating-point AC #1. -- If the parameter (y) is a string variable, the system will store in $61,$62,$63 the string element (length; text-address L/H). -- If the parameter (y) is a string-array, then system will store in $5F,$60 the address of the first byte of the array header, and in $64,$65 the address of the string element (length; text-address L/H). USR(y)







































Working info: Even if it is possible to supply the function with either a numeric or a string value, the result must be always a numeric value. Then, if your routine is planned for different uses (strings / screen / etc.) you must exit with a dummy numeric value (Example of last codes of the routine LDA #$00; STA $61; STA $0D; RTS).






































B8 FRE fR Function FRE() The output is the number of free memory bytes (bottom_strings_area)-(end_of_arrays). This function when executed, also performs a so called garbage-collection that is cleaning the strings-area from obsoleted strings in order to gain room. FRE(d) (d=dummy value)







































B9 POS
Return the position of the cursor in the logical screen line POS(d) (d=dummy value)







































BA SQR sQ Math function SQR()

SQR(x)







































BB RND rN Funtion RND() to generate random values. The function outputs a floating point value between 0…1. In order to have a greater range just multiply it by the max wanted value (example dice: INT(RND(x)*6). Parameters: 0=random number based on HW clock; 1 = Random sequence from a fix start value (the random sequence is always the same one, even after a reset); -1 = Set a new fix start value for the random sequence (this will be the same until a reset). RND(x)







































BC LOG
Math function: e-based logaritm

LOG(x)







































BD EXP eX Math function: e^x

EXP(x)







































BE COS
Math function Cosine

COS(x)







































BF SIN sI Math function Sine

SIN(x)







































C0 TAN
Math function Tangent

TAN(x)







































C1 ATN aT Math function Arctangent

ATN(x)







































C2 PEEK pE Read the value of a memory byte (only from RAM) PEEK(x)







































C3 LEN lE Returns the length of string b

LEN(b)







































C4 STR$ stR Convert the value x to a string Warning: the sign character: [-] if negative; [ ] if positive, will always be the first character of the string. STR$(x)







































C5 VAL vA Convert string b to a value The function extracts the first numeric characters from the string until the first non-numeric character is found. If no numeric characters is found before the first non-numeric one, then result will be 0 (no error output). Examples: VAL("53BJK")=53; VAL("-2YHT345")=-2; VAL("DJT")=0. VAL(b)







































C6 ASC aS Return the ASCII code of the first character of string b ASC(b)







































C7 CHR$ cH Return a character supplying its ASCII code x CHR$(x)







































C8 LEFT$ leF Extract leftmost x characters from the string a. (x=0 allowed). LEFT$(b,x)







































C9 RIGHT$ rI Extract rightmost x characters from the string a (x=0 allowed). RIGHT$(b,x)







































CA MID$ mI There are 2 uses of this command: 1) Extract y characters from the string c starting from x-th position; If x exceeds the string length no sequence is extract; if y is greater than the remaining characters, only those are extracted. If y is not defined, then all the remaining characters are extracted. (y=0 allowed). 2) Modify the string d by overwriting its original characters with the whole string e, starting from z-th position. The resulting string d length remains the original one, then be sure that: [z + length of string e -1] =< [length of string d]. 1) b=MID$(c,x[,y]) 2) MID$(d,z[,y])=e 1) y=string_length-x+1 2) y is ignored






































CB* GO LA
1) Part of GO TO alternate command (instead of GOTO); 2) OS96: Load the program b, from device x, onto the same memory position it was saved. 1) GO TO n 2) OS96: LA b [,x] x=8






































CC RGR rG Return the current graphic mode (0…4)

RGR(d) (d=dummy value)







































CD RCLR rC Return the current color-code for ink x. (in case of text-screen, the ink #1 means the foreground color of the screen initialization, not the actual color of cursor). RCLR(x) - (Warning of the bug)







































CE RLUM rL Return the current luminance for ink x. (in case of text-screen, the ink #1 means the foreground luminance of the screen initialization, not the actual luminance of cursor). RLUM(x)







































CF JOY jO Return the movement code of joystick x (x: 1, 2). The returned values are: 1=up; 2=right-up; 3=right; 4=Right-down; 5=Down; 6=Left-down; 7=Left; 8=Left-up. Previous values +128 = Fire button pressed. JOY(x)







































D0 RDOT rD Return info about current graphic cursor. Parameters: 0= x-coord; 1= y-coord; =2 ink. RDOT(x)







































D1 DEC
Convert the hexadecimal string b to a decimal value. The max length of string is 4 characters ("FFFF"). DEC(b) (Warning: bug in Austrospeed)







































D2 HEX$ hE Convert the decimal value x into a hexadecimal string. Parameter x can be from 0 to 65535 (no negative value). HEX$(x) (Warning: bug in Austrospeed)







































D3 ERR$ eR Decode the BASIC error-code x into its description. ERR$(x)







































D4 INSTR inS Search for the sequence c inside the string b starting from x-th character. The result is the position in the string, or 0 if not found. Optional parameter x can set the start of search inside the string b. This allows to find out further occurrences, not just the first one. Examples: INSTR("remember","e")=2; INSTR("remember","e",5)=7. INSTR(b,c[,x]) x=1






































D5 ELSE eL Alternative part of IF…THEN statement for the case false. (Beware the ":"). m = line-number to jump to, or other commands. IF x boolean-cond y THEN n [:ELSE m]







































D6 RESUME resU Continue program after an error was TRAPped. Parameters: . [any] = The same line that caused the error is re-executed; [line#] = Program restart from line#; [NEXT] = program continues executing the line following that one with the error. RESUME [n/NEXT] [any]






































D7 TRAP tR Intercept Basic errors and jump to the line# n. If line# is not supplied the TRAPing is disabled. TRAP [n]. (Warning: bug in Austrospeed)







































D8 TRON trO Print the line-number of each line to be executed. TRON







































D9 TROFF troF Disable the tracing started by TRON

TROFF







































DA SOUND sO Play a sound on voice x (1…3), with frequency-code y and z/50" duration. (Voices 1, 2 are tones, #3 is white noise). Voices #3 uses the channel of Voice #2 then it is not possible to play them together. During the playing duration, BASIC process continues by executing the next commands. If another SOUND command is met for the same voice, system waits for the completion of the first one, before to start to play the second one. A playing sound can be immediately finished by sending the command SOUND x,0,0. Warning: the VOL command acts to all the voices at once. If you want to select different levels of volume for each single voice you have to use twice the same SOUND command in order to force a waiting before to process the second VOL keyword. (Ex. how to set VOL 8 for voice 1 and VOL 4 for voice 2: VOL 8: SOUND 1,500,99: SOUND 1,500,1: VOL 4: SOUND 2,700,100). SOUND x,y,z

Jump to Notes table



































DB VOL vO Set the volume of sound (0= silence ... 8= loud). VOL x







































DC AUTO aU Autowrite linenumber during Basic lines typing, with x as increment. No argument sets AUTO off. AUTO [x] 10






































DD PUDEF pU The string b sets the 4 characters to be used in PRINT USING mask. Order is: 1) filler; 2) separator; 3) decimal point; 4) currency. If the string b is shorter than 4 characters only the first ones are changed in the mask. See on USING command for more info. PUDEF b Default: [space] [,] [.] [$], that is " ,.$".
Jump to USING




































DE GRAPHIC gR Set the graphic mode and, if not already done, allocate the graphic area at $2000-$3FFF. Basic area will be set since $4000. Parameters: x= 0:Text; 1:Hires; 2:Hires+text; 3:Multicolor; 4:Multicolor+text); y = 1 clears the screens (both text and hires) and sets cursor at 0,0; CLR = deallocates the graphic area and switches (without clearing) to Text screen. Warning: if a Basic error occours, system will automatically switch to Text screen (like GRAPHIC 0,0). GRAPHIC x [,y]/CLR y=0






































DF PAINT pA Fill the graphic area with a color. Parameters: x = ink; y,z = coordinates where painting starts; m = 0 painting stops when mets the same ink color (x); = 1 painting stops when mets any other ink color . PAINT [x] [,[y,z] [,m]] x=1; y,z=current position; m=0






































E0 CHAR chA Print text on screen (also in Hires/Multicolor modes). Parameters: x = ink; y,z = coordinates (column 0...39,line 0...24); b = text string; m = 1: reverse when Graphic screen modes. Graphic screen: When executed in multicolor screen mode, the output resolution of the text is downgraded (suggestion: substitute all the capital "i" with "Shift-B"). The memory value on $02E4 selects the charset to be used ($D0 = Set#1 Capital letters/Semigraphics; $D4 = Set#1 Capital letters/Lowercase). All the control-characters do not work in the graphic screens and are converted into visible characters (by subtracting $96?) Only reverse can be obtained adding ",1" as optional parameter [,m]. If either graphic modes 2 or 4 is on, then the printing will always be over the Hires screen even if aimed to the lower 5 text lines (you must change to Graphic modes 1 or 3 to see the text). CHAR [x] ,y,z,b [,m] x=1; m=0






































--> Special background colors can be obtained (in multicolor screen) by using ink parameter (x) = 0. In this case, the background will be the current Color ink #2 while the Foreground will be colored by ink #1. The same case, but adding ",1" to the command (parameter m) will obtain the background colored with ink #3 [See dedicated table at Graphic-Modes page]. Multicolor mode texts: if color x is 1 then the colors of the cell (4x8 pixels) are set with color1 and color 2, but the characters are drawn using only color1 on background color 0. Warning: CHAR command resets possible screen windows.





































E1 BOX bO Draw a box in graphic screen. Parameters: x=ink; y,z=corner coord.; j,k=opposite corner coord.; m=inclination (0…359); n=filling with ink x (1: yes). Warning: inside the parameters, the corner coordinates can indifferently be either set the top-left or the bottom-right. ----> When is specified only one corner, the missing coordinates are taken by the current position of the graphic cursor (ex. BOX 1,y,z). See on DRAW command reference for the info regarding the coordinates (click the link). BOX [x],y,z [, [j,k],[m] ,n]





x=1; j,k= current position; m=0; n=0
Go to DRAW command




































E2 CIRCLE cI Draw a polygon, a circle, or an elilpse. Parameters: x=ink; y,z=coord. of the center; j=horiz.ray; k=vert.ray; m=start arc; n=end arc; p=inclination (0..359); q= sides angle*. (*) q=360/number_of_sides (120=triangle; 90=square; 72=pentagon; <5=circle/elipse; Default: 2; Max accepted value: 255). . -- Angle values are reduced to the range 0...359 then, for example, an angle parameter of 365 is considered 5. -- After execution of CIRCLE, the cursor position is at top pixel of the figure. For example CIRCLE ,100,50,20: position at end: 100,30. See on DRAW command reference for the info regarding the coordinates (click the link). CIRCLE [x] [,y,z] [,[j] [,[k] [,[m] [,[n]] [,[p]] [,[q]] ]]





x=1; x,y=current position; j=1,k=(j); m=0; n=359; p=0; q=2
Go to DRAW command




































E3 GSHAPE gS Print on graphic screen a saved square bitmap area. Parameters: b=string-variable with data; x,y = coordinates of top-left corner; z=mode: 0 = standard; 1=reversed; 2=Ored; 3=ANDed; 4=XORed. The y-coordinate is updated after printing, but the x-coordinate does not. This allows a sequential printing of more variables without any further LOCATE command. (Ex. FOR i=0 to 5: GSHAPE A$(i): NEXT) GSHAPE b [, [x,y]] ,z





x,y=current position. . GSHAPE after a previous GSHAPE: x=the same; y=bottom line printed +1.






































E4 SSHAPE sS Save in a string-variable a square area of bitmap screen. Parameters: b=string-variable; x,y = coordinates of top-left corner; j,k= coordinates of bottom-right corner. Warning: total data, included end-line codes cannot exceed 255 bytes. After saving, the coordinates of graphic cursor are those of the bottom-right corner. SSHAPE b,x,y[,[j,k]] (Warning: the bug) j,k=current position






































E5 DRAW dR Draw a line (or a dot) on graphic screen. Parameters: x=ink; y,z=starting coordinates; m,n=ending coordinates. ---If only y,z are indicated, then a single dot is drawn. If y,z are missing, the start coordinates are those of current position. ---The syntax DRAW TO m,n can be multiple, like DRAW TO m1,n1 TO m2,n2 TO m3,n3... ---If the keyword TO is missing, the command will print only dot(s) assuming the parameters as x,y[,x1,y1[,x2,y2]]... (ex, DRAW 1,20,30 will print one dot; DRAW 1,20,30, 65,40 will print 2 dots). DRAW [x] [y,z] [TO m,n] [...[TO m2,n2]...] x=1; y,z=current position






































Every graphic coordinate can be indicated as: - Absolute value (ex. DRAW 1 TO 120,90 draws a line to y=120 z=90 grid position); - Distance from current position (ex. DRAW 1 TO +35,-70 draws a line to [current y position + 35] and to [current z position - 70]); - Polar coord. system (ex. DRAW 1 TO +30;25 draws a line long 30 pixels inclined of 25 degrees). THESE RULES ALSO APPLY TO "BOX" AND "CIRCLE" COMMANDS.






































E6 LOCATE loC Locate the graphic cursor at y,z coordinates

LOCATE y,z













































E7 COLOR colO Set color [y] and luminance [z] for ink x. Colors goes from 1 to 16, luminance from 0 to 7. Ink#0 is background; #1 is foreground; #2 and #3 are for multicolor graphics; #4 is screen border. COLOR x,y,z













































E8 SCNCLR sC Clear anytype of screen (both ones in case of split). The cursor is set at 0,0 coordinates for text or hires screen. In case of split screen, the text cursor is set on position 0,20. SCNCLR













































E9 SCALE scA Scale all following measures in graphic commands to standard range 0-1023. This can be useful to avoid differences between Hires and Multicolor definitions. Parameter x: 1=on; 2=off. Warning: the verified ranges are: Hires: 1022x1021; Multicolor: 1020x1021. SCALE x













































EA HELP heL List the Basic line, blinking its part with last error. The blinking affects possible further (even if correct) commands until end-of-line. HELP













































EB DO
Begin of DO…LOOP cycle. The commands between DO and LOOP are reexecuted if condition UNTIL is false, or if WHILE condition is true. EXIT can allow to interrupt the cycle and to jump (like a GOTO, but uncharging the cycle stack) to the commands after LOOP. DO [UNTIL/WHILE bool-condition] … [: ...EXIT] :LOOP [UNTIL/WHILE bool-condition]


DO Saved data structure (saved on BASIC stack $07AF downward) Byte 1: $EB Bytes 2/3: Basic line-number of DO statement (L/H) Bytes 4/5: Address of the last character of the DO statement [$00] or [:]






















EC LOOP loO End of DO…LOOP cycle (see DO for more info)

DO [UNTIL/WHILE bool-condition] … [: ...EXIT] :LOOP [UNTIL/WHILE bool-condition]







































ED EXIT exI Exit from DO…LOOP cycle (see DO for more info)

DO [UNTIL/WHILE bool-condition] … [: ...EXIT] :LOOP [UNTIL/WHILE bool-condition]







































EE DIRECTORY diR Show on screen the directory of disk-drive #y. Parameters: b=filter string (wildcards [*] [?] allowed) (=S / =P / =R allow to filter by filetype); x=disk unit 0/1; y=device number. The parameters can be supplied in any order. Example: DIRECTORY "hel*=p",U(9) will list all the program files of device #9 with filename starting with "hel" (hello.prg, help.prg, etc.). DIRECTORY [b] [,Dx] [,Uy]





b="*"; x=0; y=8 $





































EF DSAVE dS Save the Basic program from memory to disk-drive. Parameters: b=filename (max 16 chars); x=disk unit 0/1; y=device number. The parameters can be supplied in any order. DSAVE b [,Dx] [,Uy]





x=0; y=8






































F0 DLOAD dL Load a Basic program from disk-drive to memory. Parameters: b=filename (max 16 chars, wildcards [*] [?] allowed); x=disk unit 0/1; y=device number. The parameters can be supplied in any order. Running time: if this command is executed in running time then, after the loading, the system automatically restarts the execution from the first statement of the just loaded program. Even if the variables are not affected by this operation a special care must be applied when the new program is larger than the old one, because it could have overwritten the variables' area. DLOAD b [,Dx] [,Uy]





x=0; y=8






































F1 HEADER heA Format a disk. The parameter c, if supplied, causes a full format (all possible data will be destroyed). if missing, then only the BAM and directory will be erased, giving the hope that proper smart programs could attempt to restore the data :) Parameters: b=diskname (max 16 chars); c=disk ID (2 characters); x=disk unit 0/1; y=device number. The parameters can be supplied in any order. HEADER b ,Dx [,Ic] [,Uy]





c=current ID (disk must be already formatted); y=8 N





































F2 SCRATCH scR Scratch one/more file/s from disk-drive. Parameters: b=filename (max 16 chars, wildcards [*] [?] allowed); x=disk unit 0/1; y=device number. The parameters can be supplied in any order. The DOS channel shows the code #1 (not an error) and, as track-number, the number of deleted files. SCRATCH b [,Dx] [,Uy]





x=0; y=8 S





































F3 COLLECT colL Rebuild the BAM of a disk and clear garbage (file not closed, fragments, etc.) Parameters: x=disk unit 0/1; y=device number. The parameters can be supplied in any order. COLLECT [Dx] [,[ON] Uy]





x=0; y=8 V





































F4 COPY coP Copy a file from disk to disk Parameters: b=source filename; c=destination filename; x=disk unit 0/1; y=device number. Warning: if the device is not a double-drive, you must set a different filename for the destination (c). COPY b [Dx] TO c [Dz] [,[ON] Uy]





x=0; y=8; z=0 C





































F5 RENAME renA Rename a file on disk Parameters: b=old filename; c=new filename; x=disk unit 0/1; y=device number. Tip: This command can be used to check the existence of a file: just type RENAME b TO c and then test the DOS error: 62=File not found; 63=File exists. RENAME [Dx,] [[ON] Uy,] a TO b





x=0; y=8 R





































F6 BACKUP / BANK bA Copy a disk in a double-drive device. Parameters: x=source drive; y=destination drive; z=disk unit 0/1. OS96: Set working memory bank x=bank no. (0...3) BACKUP Dx TO Dy [[ON] Uz] BANK x z=8 B





































F7 DELETE deL Delete Basic line(s) from the program in memory. Parameters: n=start line; m=end line DELETE [n][-][m]





n=first line-number; m=last line-number. (At least one must be present).






































F8 RENUMBER renU Renumber the Basic-lines of the program in memory, and updating destination of GOTOs/GOSUBs. Parameters: x=new number of first line; y=increment; z=current number from which perform modifications RENUMBER [x] [,[y] [,z]] (Warning of the bug) x=10; y=10; z=first line-number






































F9** KEY kE Set/Show function keys. Parameters: x=function-key number (1…8 [8=Help]); b=string to be associate (max 128 bytes long). If no parameter is entered then the list of current set function keys is shown on screen. KEY [x,b]













































FA MONITOR mO Enter in Monitor environment. Warning: exiting from Monitor environment will reset any possible alternate Charset, but does not restore Charset ROM reading (type MONITOR [return] >FF12 C4 [return] to solve the situation). MONITOR













































FB USING usI Print data with a defined format. Parameters: b=mask (symbols: [.] [,] [$] and the filler character can be redefined by PUDEF command); x=values to fit the mask. Symbols for the mask: # : character of cypher; . : decimal point; , : separator inside number; $ : currency; = : center text; > : right justify text; + : print the value sign even if positive (negative is always printed); ^^^^ = scientific notation (ex. "##^^^^";3400 will print "34e+02"). --- If the number of values is greater than those inside the mask, the mask if repeated. Ex. PRINT USING "##.# ##";12.37,"ab",4,56 will print: 12.4 ab 4.0 56. --- If a numeric value does not fit in its mask, a sequence of "*" PRINT USING b;x [,x2[,…]] [;]







Jump to PUDEF







































is printed; if a text string does not fit in its mask, it is truncated (ex. USING "#### ###";"abcdef",1234 will be output as "abcd ***"). --- If the text/value is shorter than the mask the unused places are printed with the filler character (default: [space]). The filler character can be modified by PUDEF command.














































FC UNTIL uN Condition for DO…LOOP cycles (reexecute cycle if condition is false) DO [UNTIL/WHILE bool-condition] … [: ...EXIT] :LOOP [UNTIL/WHILE bool-condition]







































FD WHILE wH Condition for DO…LOOP cycles (reexecute cycle if condition is true) DO [UNTIL/WHILE bool-condition] … [: ...EXIT] :LOOP [UNTIL/WHILE bool-condition]







































FE

This is an escape code in order to access to a lower level table of tokens (model C364 speaking software commands)














































FE 01 RATE
Set the spell speed. x = 1...10. It seems to not work on Yape emulating the C364 system. It was noticed that its token (FE 01) is sometimes automatically prefixed to other tokens by the Basic editor (for example you type VOC command, and the system codes FF 01 FF 02). RATE x







































FE 02 VOC
Set the base-address of additional external words vocabulary. x = decimal address of the additional pre-loaded vocabulary. Remember that its index, to be supplied with SAY command, has to be added by 1024. The role of y parameter is unknown. (32768 for C64 Magic Voice vocabulary data [LOAD "vocab.c64" ,8, 1]) VOC x[,y]







































FE 04 RDY
This function returns the value -1 (true) if the speak-system is ready to spell the first or another word. Warning: the variable name RD is no more available for plain Basic operations. RDY







































FE 0A SAY
Say the word specified by either parameter b (word) or x. Parameter x aims the built-in list of words (0...260) or the external loaded list (1024...). Ex.1: SAY "commodore"; Ex.2: SAY 84; Ex.3 SAY 1025. (List of embedded words here below). SAY b/x







































--- S P E C I A L C A S E S ---






































* GOTO $CB, $A4 Token obtained by GO+TO single tokens. It is equivalent to GOTO (not available if OS96 ROM is present) GOTO n













































** GETKEY $A1 $F9 Token obtained by GET+KEY single tokens. The command allows to wait for a key hit. The system suspends the program execution until a key is pressed (without to prompt the "?"). When done, its value is stored in the variable b (numeric or string type) and program execution continues (without to wait for the Return-key). In case of multiple key pressings only the first one is stored. Note that any keyboard press is passed to the variable, then control characters too (ESC, cursors, CTRL+keys, CBM+keys, etc.) as string type value. For example: CURSOR-LEFT is passed as $9D; CBM+1 is passed as $81. GETKEY b


































































































Legend:



















































Basic 2.0 (C64)


















































Basic 3.5 (C16/C116/Plus4)


















































OS96 Commands of OS96 ROMs (by Solder)


















































364 O.S. Commands of model 364 ROMs (IC T6721A)




























































































































































BASIC ERRORS

Click here for info about the bug when an alternative font is enabled



C364 embedded speaking words [Credits: Bo Zimerman and Richard Atkinson]
































































































Number Description
Notes



Index Word C64 MagicVoice



































1 TOO MANY FILES
Max 10 open files are allowed.




red = the 29 new words not present in MagicVoice Red = the 4 words of MV not present in C364; Blue = words present in C364 but with a different index



































2 FILE OPEN
The file/device was already open. Maybe you used a logical file-number already in use.







































3 FILE NOT OPEN
To access a file or a device you have to previously open it



0
zero


zero



































4 FILE NOT FOUND
File not existing in this device. For TAPE: an EOT signal was detected.



1
one


one



































5 DEVICE NOT PRESENT
Device not existing, not connected, or not turned on.



2
two


two



































6 NOT INPUT FILE
That file/device cannot send data (for example a printer)



3
three


three



































7 NOT OUTPUT FILE
That file/device cannot receive data (for example a keyboard)



4
four


four



































8 MISSING FILE NAME
You have to write the filename in the command



5
five


five



































9 ILLEGAL DEVICE NUMBER
That device cannot perform that operation (for ex. save to a printer). See device codenames in I/O table tab.



6
six


six



































10 NEXT WITHOUT FOR
Each cycle FOR must be terminated by a NEXT even if nested. A NEXT command can end more than one cycle, by indicating the control-variables (in opposite order).



7
seven


seven



































11 SYNTAX ERROR
Wrong syntax for the command, math parenthesis, typo in command name, etc. - The byte preceeding tha Basic-area doesn't contain $00.



8
eight


eight



































12 RETURN WITHOUT GOSUB
You attempted to return from a subroutine where you entered without a GOSUB.



9
nine


nine



































13 OUT OF DATA
There are no (no more) DATA elements to be read. To reset the DATA pointer, use RESTORE command.



10
ten


ten



































14 ILLEGAL QUANTITY
A parameter supplied with the command is out-range.



11
eleven


eleven



































15 OVERFLOW
The result of math calcolus (or partial) exceeds the greater/lower numeric limit (from 2.93873588e-39 to 1.70141183e+38).



12
twelve


twelve



































16 OUT OF MEMORY
There is no more free RAM for variable management, or you have used too many levels of the stack (GOSUB, FOR, DO). Try FRE(0) to compress the strings.



13
thir


thir



































17 UNDEF'D STATEMENT
The line-number supplied as destination of the program jump (GOTO, THEN, etc.) does not exist.



14
fif


fif



































18 BAD SUBSCRIPT
You refer to an array' element that does not exist. (Default DIM creates a 10x10x10 array).



15
twenty


twenty



































19 REDIM'D ARRAY
You cannot reDIM an array, even if created by default.



16
hundred


hundred



































20 DIVISION BY ZERO
Division by zero is impossible.



17
thousand


thousand



































21 ILLEGAL DIRECT
This command can be executed only inside a running program.



18
million


million



































22 TYPE MISMATCH
The parameter had to be a string but you supplied with a number or viceversa.



19
teen


teen



































23 STRING TOO LONG
A string cannot be longer than 255 characters (included possible control codes).



20
ty In Yape "ty" does not work; 20 does.

ty



































24 FILE DATA
Data coming from the tape-device were badly read.



21
a


a



































25 FORMULA TOO COMPLEX
Too many parenthesis or the math expression is too long. Split it into two parts.



22
b


b



































26 CAN'T CONTINUE
After a STOP, you can CONTinue only if you did not modify any Basic line (to read and modify variables is allowed).



23
c


c





































27 UNDEF'D FUNCTION
Before to use a FNx() you have to define by command DEF FNx().



24
d


d





































28 VERIFY
The program in memory does not coincide with the one stored in the device.



25
e


e





































29 LOAD
The load operations went wrong.



26
f


f





































30 BREAK
a STOP command was executed.



27
g


g





































31 CAN'T RESUME
The command RESUME can be used if a TRAP command is on, and when an error happened.



28
h


h





































32 LOOP NOT FOUND
Each cycle DO… must have a corresponding LOOP. Maybe nesting problems.



29
i


i





































33 LOOP WITHOUT DO
Each cycle DO… must have a correspondant LOOP. Maybe nesting problems



30
j


j





































34 DIRECT MODE ONLY
This command cannot be executed inside a running program.



31
k


k





































35 NO GRAPHIC AREA
Before to use graphic commands you must allocate the graphic area by command GRAPHIC.



32
l


l





































36 BAD DISK
The disk cannot be formatted (wrong type). Or you try the fast formatting (HEADER without ID) in a disk that was never formatted before.



33
m


m













































34
n


n













































35
o


o













































36
p


p





































BASIC PROGRAMMING TRICKS ;-)






37
q


q













































38
r


r





































1) IF A<>0 can be reduced to IF A (warning: this trick must not be applied with multiple variables, ex. IF A% AND B% does not work)






39
s


s





































2) GOTO 0 can be reduced to GOTO.






40
t


t





































3) ....: GOTO 1000: here any string as comment is accepted without a REM (also works with ....: RETURN: here).






41
u


u





































4) DATA ... , ... : here any string as comment is accepted without a REM.






42
v


v





































5) NEXT x,y can be entered as NEXT: NEXT (it runs faster).






43
w


w





































6) IF ... THEN GOTO 2000 can be reduced to IF ... THEN 2000.






44
x


x





































7) ? FRE(n) is useful to pack string area by eliminating old useless strings (not a true trick).






45
y


y





































8) To check if a file is existing: "RENAME a$ TO a$" (a$=filename). Results DS=62 file does not exist; DS=63 file exists.






46
z


z





































9) CHAR ,x,y,"[CLR]" to clear screen and cancel all possible windows (x,y any legal value).






47
(silence)


(silence)





































10) "IF ev = 0 THEN e= -1: ELSE e = 0" can be reduced to: "e=ev=0".






48
add


add





































11) Flip 0<->1 in a variable. "IF a%=1 then a%=0: ELSE a%=1" can be reduced to: "a%=abs(a%-1)".






49
subtract


subtract





































12) INPUT command accepts a string containing "," or ":", if you execute the following commands before the INPUT:






50
divide


divide






































POKE 1319,34: POKE 1320,34: POKE 1321, 20: POKE 239,3.





51
divided


divided













































52
equals


equals













































53
less


less













































54
minus


minus













































55
more


more













































56
number


number













































57
plus


plus













































58
remainder


remainder













































59
it


it













































60
at


at













































61
when


when













































62
has


has













































63
times


times













































64
apostrophe


apostrophe













































65
word


word













































66
er


er













































67
est


est













































68
ing


ing













































69
ssss Designed for plurals. In Yape emulator it does not work as "ssss"; it produces silence as 69. This sound is not produced by the syntesiser being based on the noise generator of the T6721A ssss











































70
th


th













































71
all


all













































72
me


me













































73
my


my













































74
that


that













































75
their


their













































76
they're


they're













































77
this


this













































78
what


what













































79
which


which













































80
who


who













































81
your


your













































82
you're


you're













































83
answer


answer













































84
commodore


commodore













































85
end


end













































86
point


point













































87
thing


thing













































88
question


question













































89
turn


turn













































90
am


am













































91
are


are













































92
be


be













































93
can


buy











































94
correct


can













































95
did


correct













































96
do


did













































97
does


do













































98
done


does













































99
find


done













































100
get


find













































101
have


get













































102
help


have













































103
is


hear











































104
know


help













































105
like


is













































106
presents


know













































107
read


like













































108
say


presents













































109
see


read













































110
start


say













































111
step


see













































112
use


start













































113
wait


use













































114
want


wait













































115
was


want













































116
won


was













































117
write


won













































118
here


write













































119
high


here













































120
how


high













































121
there


how













































122
too


there













































123
where


too













































124
why


where













































125
uh


why













































126
an


uh













































127
and


an













































128
as


and













































129
but


as













































130
by


but













































131
for


by













































132
from


for













































133
if


from













































134
in


if













































135
large


in













































136
next


large













































137
not


next













































138
of


not













































139
off


of













































140
on


off













































141
or


oh











































142
ready


on













































143
same


or













































144
than


ready













































145
the


same













































146
thuh


than













































147
then


the













































148
to


thuh













































149
until


then













































150
with


to













































151
very


with













































152
bye


very













































153
hi


bye













































154
please


hi













































155
thank


please













































156
yes


thank













































157
bad


yes













































158
good


bad













































159
sorry


good













































160
wrong


sorry













































161
after


wrong













































162
most


after













































163
because


most













































164
no


because













































165
out


no













































166
send


out













































167
talk


send













































168
any


talk













































169
each


any













































170
enter


each













































171
error


enter













































172
many


error













































173
every


many













































174
again


every













































175
now


again













































176
small


now













































177
terrific


small













































178
try


terrific













































179
letter


try













































180
first


letter













































181
second


first













































182
third


second













































183
color


third













































184
pink color













































185
black


black













































186
white


white













































187
red


red













































188
cyan


cyan













































189
purple


purple













































190
green


green













































191
blue


blue













































192
yellow


yellow













































193
orange


orange













































194
brown


brown













































195
light


grey











































196
he


light













































197
our


he













































198
she


our













































199
we


she













































200
you


we













































201
come


you













































202
give


come













































203
put


give













































204
set


put













































205
take


set













































206
were


take













































207
may


were













































208
over


until











































209
dark


may













































210
command


over













































211
computer


dark













































212
control


command













































213
cursor


computer













































214
disk


control













































215
down


cursor













































216
game


disk













































217
key


down













































218
left


game













































219
load


key













































220
name


left













































221
pen


load













































222
play


name













































223
press


play













































224
program


press













































225
right


program













































226
run


right













































227
save


run













































228
side


save













































229
stop


stop













































230
symbol


symbol













































231
tape


tape













































232
up


up













































233
weight


weight













































234
angle


hour











































235
draw

















































236
circle

















































237
degrees

















































238
square

















































239
triangle

















































240
hour

















































241
print

















































242
dots

















































243
back

















































244
box

















































245
hide

















































246
repeat

















































247
forward

















































248
length

















































249
list

















































250
both

















































251
clear

















































252
file

















































253
go

















































254
her

















































255
his

















































256
look

















































257
problem

















































258
some

















































259
them

















































260
things











































Sheet 12: EDIT


EDITOR

Release 2.1










Logical and physical lines: Physical lines are the screen horizontal rows of the current window. For example the whole screen allows 25 physical lines. A logical line is, on the contrary, a logical sequence of characters that can extend over one ore more physical lines (for example 3 BASIC lines each of them 50 characters long, will extend over 6 physical lines). The system takes care of the position of the logical lines by the Logical Link Table (at $07EE ... $07F1).













Windowing: A window is a part of the screen, where to work. For example when you want that the scrolling of a text will affect only a part of the screen while the title remains still. You can do it by ESC+T and ESC+B. Since the cursor too will act only inside the window, it is possible to create funther windows, but each time smaller than the current one. Beware: all the commands act only inside the current window. Commands:






[HOME][HOME] = Enlarge the window(s) to the whole screen (40x25) without to clear it. Warning: the logical link table will be destroyed.






[ESC][T] = Set the top left corner of the window.






[ESC][B] = Set the bottom right corner of the window.






$07E5, $07E6, $07E7, $07E8 = coordinates of current window (down, up, left, right)













System scrollings: System performs 2 automatic scrollings: 1) When the cursor moves forward after the rightmost position of the logical line, then a new empty clear line (non-reversed spaces) is inserted and all the following lines are shifted down (the previous bottom line text is lost); 2) When the cursor moves forward after the bottom-rightmost corner of the window (or down from any position of the bottom line), a shift up of all the lines is performed and a new empty line (non-reversed spaces) appears as the bottom line (the previous top line is lost). This feature can be disabled by ESC+M (see below).





















ESC codes






Use: press [ESC] key, then the alphabetical letter




Command Logical or Physical line affecting Action Description Warnings


ESC-A L Insert mode on Allow to insert characters inside a logical line. All rightmost characters are automatically shifted. Beware that the max lenght of the Basic input buffer is 88 characters. If the inserted characters are in the last logical line, and scroll 2 is off (ESC-M), when a shifted characted achieves the rightmost bottom corner, the following inserted characters do overwrite the existing ones.


ESC-B P Bottom right of a window Set the bottom right corner of a screen window. Logical link table is destroyed


ESC-C L Insert mode off Cancel the ESC-A feature. All next inserted characters will overwrite the existing ones.



ESC-D L Delete line Erase a logical line and shift up the following ones.



ESC-I L Insert line Insert a new physical line in the cursor position, and shift down the following ones (the previous bottom line text is lost). The logical link table is properly updated. The cursor goes to the leftmost position of the just inserted new physical line. Since the logical link table is updated, you can insert a new physical line inside a logical line (for example between 1st and 2nd physical lines belonging the same logical line). A "string too long error" will output if you exceed the Basic input buffer (88 characters).


ESC-J L Go to begin of line Move the cursor to the first character of the current logical line.



ESC-K L Go to end of line Move the cursor to the last character of the current logical line.



ESC-L P Vertical scrolling on Re-enable system scrolling #2 (see above paragraph "System Scrollings")



ESC-M P Vertical scrolling off Disable system scrolling #2 (see above paragraph "System Scrollings")



ESC-N P Standard screen Set the screen size to 25 lines x 40 columns, remove possible existing windows, and clear the whole screen.



ESC-O L/P Standard writing Reset standard writing after quotation-mode or insert-mode.



ESC-P L Erase from begin to cursor Erase all the characters from begin of the logical line to the current cursor position (included).



ESC-Q L Erase from cursor to end Erase all the characters from the current cursor position to the end of the logical line (included).



ESC-R P Reduced screen Clear the screen and set the dimension to 23 lines x 38 columns.



ESC-T P Top left of window Set current cursor position as the top left corner of a screen window. Logical link table is destroyed


ESC-V P Scroll screen up 1 line All the screen lines will be shifted up of 1 physical line. If the first logical line was extended on more physical lines, it will result corrupted.



ESC-W P Scroll screen down 1 line All the screen lines will be shifted down of 1 physical line. If the last physical line was occupied by a logical line extended over more physical lines, it will result truncated.



ESC-X --- No operation This command was planned in order to complete the sequence in case of a wrong pressing of the [ESC] key. Actually each alphabetical letter, not listed above, obtains the same result.





























MONITOR environment




The Monitor Environment lets you to perform some Machine Language programming and read/modify/transfer single bytes or areas of memory.














BUGS:







Command Description Solution


* T When asked to copy a source area to a destination area that is partially included in the source (Ex. Copy from $2000,$2300 to $2250...). The destination area will have wrong values from $2250 to $2300. The bug does not affect an inverse tranfer (in the example: Copy from $2250,$2550 to $2000...). 1) Copy segment in a far (temp) area (not laid); 2) Copy from new (temp) area to the wished destination.


** X The "X" (Exit) Command reloads the address of the standard characters table, but does not set TED banking on Rom. Then if an alternative character set is in use (residing in RAM) the screen becomes unreadable. Type (without to see what you're writing): >FF12 C4: [RETURN]


















COMMANDS:







MONITOR or mO [Return] from BASIC environment to enter into the environment














Command Syntax (all the input values in Hex with no refix). The commas can be substituted by spaces. Description


A A nnn Assemble a line of 6510 machine language code (nnn=legal code and possible operands).




C C xxx,yyy,zzz Compare the contents of the area at address xxx-yyy with another area starting from address zzz and shows the addresses having a different value.




D D [xxx[,yyy]] Disassemble from address xxx [to yyy if present] or, if any parameter, 15 bytes starting from current address




F F xxx,yyy,z Fill the area from address xxx to address yyy with the value z (00...FF),




G G [xxx] Execute the code from address xxx (or from current address if not entered)




H H xxx,yyy,z Hunt the specified memory area for the value "z" and shows the addresses where is found.




L L "filename",z Load a file from device "z" and relocate it in memory at the same address it was saved from.




M M [xxx[,yyy]] Show an area of memory as hex bytes and has PETSCII characters (96 bytes if end address is not specified).




R R Show current values of the PC and 6510' registers.




S S "filename",z,xxx,yyy Save the memory section from xxx to yyy (both Hex values) to device z, as a file named "filename". Address position is automatically saved.



* T T xxx,yyy,zzz Transfer a segment of memory from xxx to yyy to the new location zzz (Beware the bug). (Click here to go to bug description)



V V "filename",z Verify the content of file "filname" on device z, with the corresponding values in memory (using the address stored in the file).



** X X Exit from Monitor environment (Beware the bug). (Click here to go to bug description)



> >xxx,z[,w[,k[,...]]] Poke values (max 8 single Hex bytes) in memory, starting from address zzz.




; ;xxx,z[,w[,k[,...]]] Modify the value of the PC and eventually some 6510' registers.












Possible errors after the execution of one of the above commands follow the I/O Error codes

The cell $07F8 in RAM acts as a flag to read from RAM ($80) or from ROM ($00) for address greater than $7FFF.


(Click here to go to the table)











Sheet 13: Credits




The Ultimate Plus/4 map



























by S\_/S of [FIRE] crew




Updating 2.1 - Main news































More info on FOR...NEXT Basic command















More info on USR() Basic function.















1581: More info about internal commands codes















1581: Corrected a mistake on internal command code A6

If you need something that does not exist, build it!

Added RGB codes on COLOR table (Graphic-modes sheet)

I've always dreamed to achieve a complete map of the O.S. of Plus4, but no support was available during the "golden era".

Better info on possible blackscreen when TED is set with some combo of HiRes / MultiClr / Extend modes.

In the present years, with 'net and with a new cooperating thinking, instead of the competing one, I searched and collected a lot of

Text Multicolor mode: there was an error about bit #3 of Attributes area (Graphic-modes sheet).

documents and information from people and sites around the world. Then I merged all them, after added what I discovered by myself;

Added a new column in the RAM sheet, showing the size (in bytes) of some areas.

the result is this Map. I put it onto XLS format, so that everybody could sort the lines on preferred order (address, type, name, …)

In PETSCII table, highlighted the area with symbols allowed for Extended Color graphic mode.

and easy do searches on it.

Added colors for different signal direction on UserPort scheme

Maybe some descriptions could result not too clear, because of my English, sorry :)

Added schematic of the Expansion port

I have to say that I found many conflicting descriptions across the documents: Where not solved, I have included all them.

Basic LOAD and DLOAD commands: added info about their run-time execution















$F3B5-F40B: Better info on O.S. routines to set standard keyboard colors and standard Function keys texts















RAM $025C info regarding the CAN'T CONTINUE message and management















Some fixes and adds on 1541 Drive map







I thank for the appreciated collaboration:

New detailed info on O.S. Map referring INPUT command execution







Nightbird, JimH, MikeD, Csabo, JamesC, Litwr, CameronK, MikeZ., Ninja, Gaia, Marko Mäkelä, TLC, Tibor Biczo, gerliczer and all other friends that helped me in this work.

Added new tables on Disk Drives sheet: Surface map and Master tracks maps









Added a new trick concerning the INPUT command















Modified the description of the variable names in the DEF FN variables (BASIC page - Variables)














More info on RAM about the BASIC stack ($7C... and $07AF...)

You can contribute to a next issue of THE ULTIMATE Plus4 Map:










Explained the data-block structures used by GOSUB, FOR, DO inside the Basic buffer (BASIC page - Commands)

Simply, write me any info, news, discovery you do/did/will know about Plus/4 O.S.










CLR Basic command: more info about FOR...NEXT and RESTORE.

and, of course signal to me any possible bug (and English mistakes). Thanx.










CONT Basic command: use inside a program

My e-mail: svs.fire@gmail.com










SYS Basic command: added info about input/output values for registers.













GET Basic command: allowing number or string as variable. More info in the case of active CMD.
A













Added more hyperlinks between connected arguments.















Compressed the Disk-Drives Memory List in order to have smaller rows.















































































































































































































































































































































































































































































































... and lots minor improvements and corrections.