PB - 1000
 

 

Site Home

PB-1000 Home

Informations

The ASM codes

The Memory

The Disassembler

Programs

Hardware


Memory data storage

 

- Case of "ANS" : (result of last calculation)

nb = (+/-) m x 10 ^ (exp)

This number is stored on 8 bytes from adress ANSAD: &H6D08

Stored on 8 bytes in BCD (Binary Coded Decimal), in the folowing order:

Mantisse
Exp. code
Value code
byte1
byte2
byte3
byte4
byte5
byte6
byte7
byte8
BDC
BDC
BDC
BDC
BDC
BDC
hexa.
hexa.
==== increasing memory adresses ====>

nb = (+/-) m x 10 ^ (exp)

- 6 bytes : mantisse 12 figures starting by the number whose power is the smallest.

- 1 byte : exponent code

exp = Exp. code if b > 0
exp = Exp. code - 100 if b < 0

- 1 byte : value code :

&H01 : if nb positive and nb >= 1
&H00 : if nb positive and 0 =< nb < 1
&H05 : if nb négative and -1 < nb < 0
&H06 : if nb négative and nb < -1

nb value
...
-1
...
0
...
1
...
value code
&H06
&H05
&H00
&H01
ex:
-1.2568 -0.9487 0.2985 1.001

- If we type bytes in reverse order from memory, it gives:
value code
Exp. code
Mantisse : m
byte 8
byte 7
byte6
byte5
byte4
byte3
byte2
byte1
a
b
           

nb = m x 10 ^ (exp)

- If the number is a negative power ( -1 < nb < 1 ) then:

nb = m x 10 ^ (-exp) with exp = 100 - b

WARNING: The byte &H59 represents the string "95". Thus the number "1234567891" will have the mantisse &H10 &H89 &H67 &H45 &H23 &H01.

To check it, type "1234567891" + "ENTER" on the PB-1000 then ask for a memory dump from &H6D08 by typing:

"MON"+"ENTER"
then
"D6D08"+"ENTER".

The PB-1000 prints the adresseof the requested byte then it's value and the value of the seventh others : "6D08 10 89 67 45 23 01 09 01"

Examples:

1 ==> 00 00 00 00 00 01 00 01
value code = 01: nb positive >= 1
exp. code = 00
mantisse = 01 00 00 00 00 00
nb = 01,00 00 00 00 00 x 10 ^ (00) = 1 x 10 ^ 1= 1

123 ==> 00 00 00 00 23 01 02 01
value code = 01: nb positive >= 1
exp. code = 02
mantisse = 01 23 00 00 00 00
nb = 01.23 00 00 00 00 x 10 ^ (02) = 1.23x10^2 = 123

123456 ==> 00 00 60 45 23 01 05 01
value code = 01: nb positive >= 1
exp. code = 05
mantisse = 01 23 45 60 00 00
nb = 01.23456 x 10 ^ (05) = 1.23x10^2 = 123456

- 987654 ==> 00 00 40 65 87 09 05 06
value code = 06: nb négative < -1
exp. code = 05 ==> exp = (
mantisse = 09 87 65 40 00 00
nb = -09.87654 x 10^(05) = -9.87654x10^2 = - 987654

- 0.1234567895 ==> 50 89 67 45 23 01 99 05
value code = 05: nb négative entre -1 et 0
exp. code = 99 ==> exp = ( 99 - 100 ) = -1
mantisse = 01.234567895
nb = -1.234567895 x 10 ^ (-1) = -1.234567895 x 10^2 = - 0.1234567895

Notice:
- If "value code" = 00 then nb = m x 10 exp (Exp code) : Positive number raised to a negative power: 0.001...
- si "value code" = 05 then nb = - m x 10 exp(Exp code -100) :negative number raised to a negative power: -0.001...

 

- NUMBERS IN MEMORY

- On 8 bytes as for "ANS" but:

6 bytes + 1 quartet : mantisse
1 byte : exp code
1 quartet : sign code

Mantisse
Exp code
Sign
byte 1
byte 1
byte 1
byte 1
byte 1
byte 1
byte 1
byte 1
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB

 


Airbug.two 2002