FX-602P $WikiTagline
 

The following memory map describes the addresses used by peek and poke.

FromToDescription
00000879Data registers — 8 bytes each, in following order: 00-09,F,10-19,1F,...
08802046Used by system routines
20478191Program memory. Programs are sorted in memory by creation time and are not fragmented.
  81929979Unused.
99809998Pseudo addresses used for system tests - will delete memory of addressed.
99999999Centronics output port. Anything written here will be send to the centronics port.

Data registers

Numbers are stored in data memory in BCD (binary-coded decimal) form: each decimal digit is stored as hexadecimal digit. First byte of each register is unsigned exponent. If first byte's first digit is A, then the register contains number in fraction form (integer part, numerator and denominator). Second byte's second digit contains signs (exponent sign / mantissa sign: "+/+"-1, "−/+"-0, "+/−"-6, "−/−"-5), first digit contains 12th mantissa digit. Note about exponent: if first byte is 97h and second byte's second digit is 0 or 5, then exponent is "−3", not "−97". The order of mantissa digits is following: 1st — 8th byte's 2nd digit, 2nd — 7th byte 1st digit, etc. If one of the digits is hexadecimal B — it is fraction separator (between integer and numerator or between numerator and denominator).

System Routines

The following table contains the know addresses of data used by the system routines.

FromToDescription
08910891Set-up cassette interface speed. See the original manual for details.
08920893Set-up RS232 interface. See the original manual for details.
12411242an address of last byte used by programs, increased by two, is stored here (in HEX, correct decimal result is "PEEK 1241 + PEEK 1242 × 256 =").
12441244number of currently executed program or subprogram (in BCD: 16 means program number is 10).
12451246address of the first byte of current program's body (in HEX).
12511251number of items in subroutine stack (BCD).
12521384subroutine stack data: one item uses 7 bytes, with maximum of 19 items; item's first byte is program number (BCD), second and third — entrance address (address of the first byte of GSB-to-next-program-in-stack command), fifth and sixth — this program's body first byte address.
13921407Upper Display Line.

Program memory

Each program's first byte contains number from 0 to 9 (program number), or 234 (it means that program number is more than ten; in this case program number's last digit is the following byte).

Next byte may contain 236, which means that program is protected by password (next 4 bytes). The password (if exists) is followed by program body (note: if the program has a password, then addresses 1245 and 1246 contain the address of the byte with 236 in it, so the example of self-modifying program will not work correctly if it is password-protected, because it doesn't coun't this address change).

The last byte of the last program is followed by the byte with 255.

Pseudoaddresses