The Memory of PC-1350


Index


The program area



Line structure:

3 bytes (x,y,z), data, return (Chr 13)
x,y: line number = x*256+y
z: length of data (return included)
End of program Chr (255)
If a byte in the data of a line has an ASCII code above 127 it will appear as a BASIC command.

Variable structure (DIM):

7 bytes (a,b,c,d,e,f,g), Data
In PEEK 28423+256* PEEK 28424 the start address of the variables is stored.
Variables are written from behind, this means that a new variable is written before the older variables. The start address points to the header of the newest variable.
You can rename variables using POKE!

Header structure:

7 bytes lengthy

Example:
G$(5,5)*3
a: 71 = G: variable name
b: 160 = String
c: 0 = 1.Byte * 256
d: 111 = + 2.Byte = Overall length + 3 (because of following DIM values)
e: 5 = Dim 5
f: 5 = , 5
g: 3 = * 3
DATA: 71 = 1. character 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:

There are 5 columns with each 30 pixels width in 4 lines á 8 pixels. Each stripe of 8 pixel is like a "GPRINT" byte, the value 1 will set the top pixel and 128 the bottom pixel! The distance of the memory locations of each column is 512 bytes.

  SHARP  POCKET COMPUTER PC-1350
1: 28672..28701
1: +512
29184..29213
1: +1024
29696..29725
1: +1536
30208..30237
1: +2048
30720..30749
2: 28736..28765
2: 29248..29277
2:
29760..29789
2:
30272..30301
2:
30784..30813
3: 28702..28731
3: 29214..29243
3:
29726..29755
3:
30238..30267
3:
30750..30779
4: 28766..28795
4: 29278..29307
4:
29790..29819
4:
30302..30331
4:
30814..30843

The symbols RUN, PRO, SHIFT, SML are set in byte 30780:

BitSymbol
0Shift
1Def
2-
3-
4Run
5Pro
6Japan. symbols left: Makes the keys work odd!
7Sml



System area:

-System variables (each 8 bytes long):
VarAddressHBLB
Z2769610848
Y2770410856
X2771210864
W2772010872
V2772810880
U2773610888
T2774410896
S27752108104
R27760108112
Q27768108120
P27776108128
O27784108136
N27792108144
M27800108152
L27808108160
K27816108168
J27824108176
I27832108184
H27840108192
G27848108200
F27856108208
E27864108216
D27872108224
C27880108232
B27888108240
A27896108248
The first byte of each variable is CHR 245 when containing a string or CHR 0 when containing a number. If the string is shorter than 7 characters, a Chr(0) is added at the end!

-  Reserve mode data: 28527:A:first reserve entry, Chr (alphabetical number) marks beginning (A=1,S=19,D=4,...,' '=27,'='=28), then data without any ending code. Example: [1,254,34],[19,...],...
Order:ASDFGHJKL'='' 'MNBVCXZ, empty entries are not stored (not even the start code 1-28!). End of reserve mode area: 28671

-  System addresses:

LBHBDescription
2841728418Points to the byte 255 before the BASIC area
2841928420Points to the byte 255 after the BASIC area
2842328424Points to the defined variable area
28503-Input buffer: The last pressed key
28426bis 28432Password in ASCII code
28435-2: WAIT active, 6: WAIT inactive
28436-0-31: Password inactive, 32-63 password active
2844828449Points to the next byte after the last executed BASIC command
28336bis 28415In-/Outputbuffer 80 bytes
27904bis 27999Display buffer in ASCII codes
28166281671. FOR NEXT: Points to the byte before the address of the loop variable
28168bis 281741. FOR NEXT: End count of loop in BCD format
28175bis 281811. FOR NEXT: STEP value in BCD format
28182281831. FOR NEXT: Points to the byte after the FOR .. TO (STEP) block
28184281852. FOR NEXT: Points to the byte before the address of the loop variable
28186bis 281922. FOR NEXT: End count of loop in BCD format
28193bis 281992. FOR NEXT: STEP value in BCD format
28200282012. FOR NEXT: Points to the byte after the FOR .. TO (STEP) block
28202282033. FOR NEXT: Points to the byte before the address of the loop variable
28204bis 282103. FOR NEXT: End count of loop in BCD format
28211bis 282173. FOR NEXT: STEP value in BCD format
28218282193. FOR NEXT: Points to the byte after the FOR .. TO (STEP) block
28220282214. FOR NEXT: Points to the byte before the address of the loop variable
28222bis 282284. FOR NEXT: End count of loop in BCD format
28229bis 282354. FOR NEXT: STEP value in BCD format
28236282374. FOR NEXT: Points to the byte after the FOR .. TO (STEP) block
28238282395. FOR NEXT: Points to the byte before the address of the loop variable
28240bis 282465. FOR NEXT: End count of loop in BCD format
28247bis 282535. FOR NEXT: STEP value in BCD format
28254282555. FOR NEXT: Points to the byte after the FOR .. TO (STEP) block
28459-Number of the running FOR..NEXT loop: 6=0, 24=1, 42=2, 60=3, 78=4, 96=5
28460-Number of the running GOSUB..RETURN block: 144=0, 146=1, 148=2, ... 164=10
2881628817Return address for the 1. GOSUB..RETURN block
2881828819Return address for the 1. GOSUB..RETURN block
2882028821Return address for the 1. GOSUB..RETURN block
2882228823Return address for the 1. GOSUB..RETURN block
2882428825Return address for the 1. GOSUB..RETURN block
2882628827Return address for the 1. GOSUB..RETURN block
2882828829Return address for the 1. GOSUB..RETURN block
2883028831Return address for the 1. GOSUB..RETURN block
2883228833Return address for the 1. GOSUB..RETURN block
2883428835Return address for the 1. GOSUB..RETURN block
2885128852WAIT interval
30780-Display symbols (see above)

-  The ROM: The PC-1350 has a ROM, which contains the operating system. The ROM of the CPU is at &0000 to &1FFF, the external ROM at &8000 to &FFFF. If you know the system calls you can use functions of the system in your programs!

TokenCommandCALL address
153ABS2954
158ACS2954
161AND2954
225AREAD50108
164ASC2954
157ASN2954
159ATN2954
236BASIC47228
196BEEP49403
204CALL49455
229CHAIN38348
168CHR$2954
201CLEAR47787
183CLOAD38439
188CLOSE64131
206CLS55564
191CONSOLE34143
178CONT50136
150COS2954
182CSAVE38055
207CURSOR55441
220DATA50108
155DEG35307
193DEGREE49983
203DIM48466
156DMS35314
216END49897
147EXP2954
213FOR48612
230GCURSOR60134
224GOSUB49137
198GOTO49075
231GPRINT59439
195GRAD49999
212IF49736
173INKEY$2954
223INPUT50168
152INT2954
171LEFT$2954
166LEN2954
214LET49255
232LINE58798
180LIST50355
181LLIST50605
145LN2954
190LOAD62275
146LOG2954
226LPRINT50526
175MEM2954
184MERGE38480
170MID$2954
177NEW48040
217NEXT48782
163NOT2954
211ON50007
187OPEN63806
238OPEN$2954
162OR2954
179PASS47838
221PAUSE52835
167PEEK2954
174PI2954
233POINT2954
205POKE49498
235PRESET60044
222PRINT53217
234PSET60053
194RADIAN49991
192RANDOM49400
219READ49563
215REM49796
228RESTORE49695
227RETURN49807
172RIGHT$2954
160RND2954
176RUN47664
189SAVE62055
154SGN2954
149SIN2954
148SQR2954
209STEP4332
218STOP49934
169STR$2954
151TAN2954
237TEXT47434
210THEN4332
208TO4332
200TROFF49942
199TRON49938
202USING50481
165VAL2954
197WAIT49946

The token is the value of the byte which represents this command in a BASIC line.

CALL addresses

AddressDescriptionChanged registersChanged int. RAM
4618Getkey: If you press a key the ASCII code will be stored at 28503 and in AP,Q,DP,I,A,B,X,Y,K,L,V2..23,92
3003Inkey: If you press a key the code will be stored at [++Y]P,Q,DP,A,B,X,Y,K,L,V10..21,23,34,37..39,55..63,92
53958Print: Prints the ASCII characters from the display buffer like CURSOR(K,A), A=1,2 are the lower two lines and A=3,4 the upper.P,Q,DP,A,B,X,Y,K,L,W2..39
32852LPrint: Prints the characters in internal RAM addresses 16..39 on the CE-126P. Chr(13) makes a new line.P,Q,DP,A,B,K,L2,3,8,9,92..95
1240Off: Switches the computer off. Switch it on again with On/Brkallall
2379Beep short: If the bit 0 in A is set, 2 kHz else 4 kHz. To stop the beeper use LIP 95, ANIM 239, OUTCP,Q,A2,95
49430Beep long: Beeps with 4 kHz and doesn't need to be stopped.unknownunknown




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