The memory of PC-1403


Index


The program memory



Line structure:

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 ~ .

Variable structure:

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.

Header structure:

7 bytes length

Example:
G$(5,5)*3
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

Meaning of the second header byte:

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

Data of a variable:

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).

Access to the display:

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!

  SHARP  PC-1403H
1: 12288..12292
2: 12293..12297
3: 12298..12302
4: 12303..12307
5: 12308..12312
6: 12313..12317
7: 12333..12337
8: 12338..12342
9: 12343..12347
10: 12318..12322
11: 12323..12327
12: 12328..12332
13: 12396..12392 *
14: 12391..12387 *
15: 12386..12382 *
16: 12411..12407 *
17: 12406..12402 *
18: 12401..12397 *
19: 12381..12377 *
20: 12376..12372 *
21: 12371..12367 *
22: 12366..12362 *
23: 12361..12357 *
24: 12356..12352 *
*) These characters are accessed backwards!

The symbols SML, MATRIX, STAT and left and right from CAL and PRO are accessed in byte 12348 or 12604:

BitSymbol
0ht (jap. symbols)
1/|\ (jap. symbol)
2SML
3STAT
4MATRIX
5right from PRO
6left from CAL
7-

The symbols BUSY, RUN, PRO, CAL, SHIFT, HYP, DEF are accessed in byte 12349 or 12605

BitSymbol
0BUSY
1DEF
2SHIFT
3HYP
4PRO
5RUN
6CAL
7-

The symbols E, M, ( ), DE, G, RAD and PRINT are accessed in byte 12412 or 12668:

BitSymbol
0E
1M
2( )
3RAD
4G
5DE
6PRINT
7-



System area:

-System variables (each 8 bytes long):
VarAddressHBLB
Z6427225116
Y6428025124
X6428825132
W6429625140
V6430425148
U6431225156
T6432025164
S6432825172
R6433625180
Q6434425188
P6435225196
O64360251104
N64368251112
M64376251120
L64384251128
K64392251136
J64400251144
I64408251152
H64416251160
G64424251168
F64432251176
E64440251184
D64448251192
C64456251200
B64464251208
A64472251216
The first byte of each variable is either CHR 245 when the variable is a string or CHR 0 when it is a number. If the variable is shorter than 7 character, a Chr 0 marks the end!

-  System addresses:

LBHBDescription
6528165282The BASIC start 255
6528365284The BASIC end 255
6528565286The last MERGEd block
6528765288The variable start
65290bis 65296Password in ASCII code
65367-Input buffer: The last pressed key
65299-2: WAIT on, 6: WAIT off
65300-0-31: Password off, 32-63 Password on
6531265313Points after the last executed BASIC command
65200bis 65279Input-/Output buffer 80 bytes
65120bis 65143Display buffer in ASCII code
6535165352WAIT interval

-  The ROM: 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!

CALL addresses

AddressDescription
1208Switch the display on: Shows manipulations immediately.
1226Switch computer off (use BRK/ON to switch it on!)
1200Short BEEP
1248Chirps




Copyright © Simon Lehmayr (Parts of my page were made with the help of Laurent Duveau)
If this page has no navigation, click here.
Impressum