3 bytes (x,y,z), data bytes, Chr 13
x,y: line number = x*256+y
z: Length of data block (Chr 13 counts, too!)
End of program marked with 255
A byte with the ASCII code >= 128 in the data area of a line represents a BASIC command!
A byte with the code 239 is a BASIC command, too. This command is defind by the following byte!
The pocket computer prints unknown commands as ~ .
7 bytes (a,b,c,d,e,f,g), data
In the pointer PEEK 65287+256* PEEK 65288 the first address of the variablen is defined.
Variables are written from behind, this means when you DIM a new variable it is written before the others and the start is moved to a smaller value. The start pointer points to the header of the newest variable.
Variables can be renamed using POKE. So you can write protect them (until CLEAR is used) poking an invalid name like Chr 32 or "!", etc.
7 bytes length
a: 71 = Variable name, here G
b: 160 = String
c: 0 = HB of length of the complete variable
d: 111 = LB of length + 3 (because the rest of the header has 3 bytes)
e: 5 = Dim 5
f: 5 = , 5
g: 3 = * 3
DATA: 71 = 1. character of data
1-26 = Stringarray, 2 character name with second character = Chr (Byte+64)
193-218 = Number array, 2 character name with second char = Chr (Byte-128)
129-154 = String, 2 character name [Chr (Byte-64)] variable (like NE$="test") always 16 bytes lengthy
65-90 = Number, 2 character name [Chr (Byte)] (like AA=0) always 8 byte lengthy
128: One character name number array
160: One character name string array
Strings contain each character as a byte in ASCII code, Chr(0) is the end of a string. The Chr(0) is not used when the text is as long as the variable is dimensioned.
Numbers are stored in the BCD format. Each number needs 7 bytes.
In an array the single variables are following without any divider character. The position of such a variable is calculated using the header data. In a twodimensional array the arrays are following in a similar way: DIM B$(1,2)*1: B$(0,0) B$(0,1) B$(0,2) B$(1,0) B$(1,1) B$(1,2).
The line with its 24 characters can be accessed using PEEK and POKE: When a BASIC program is running the display is switched off. You must use CALL 1208 to switch it on again to show your manipulations. The memory for the display has 5 bytes for each character. The first 7 bits are the 7 pixels height of each column. You can access the same display 256 bytes later, too!
The symbols SML, MATRIX, STAT and left and right from CAL and PRO are accessed in byte 12348 or 12604:
|0||ht (jap. symbols)|
|1||/|\ (jap. symbol)|
|5||right from PRO|
|6||left from CAL|
|-||System variables (each 8 bytes long):|
The PC-1403 has a ROM, which contains the operating system.
The ROM of the CPU is always at &0000 to &1FFF, the rest is banked in &4000 to &7FFF.
If you know system CALLs, you can improve your programs!|