Sharp Pocket Computer 1360 - Competence Center
Tricks and secret addresses in the Sharp PC-1360 memory
Clues about how to find interesting memory addresses of the PC-1360
To really understand my tips and get to find yours, you will have to know the memory map for the Sharp PC-1360 :
Notice : almost all numbers will be given in hexadecimal format. The numbers in hexadecimal will be preceeded with a & sign, to distinguish them from decimal numbers. For example : &3F (hexadecimal) is equal to 63 (decimal).
ROM (Read Only Memory)
The ROM is divided in two :
- The Internal ROM in the CPU that contains the "heart" of the PC's Operating System.
- The External ROM which is divided into 8 blocks of the same size, 16 Kb each. These "Banks" will include all routines and programs to manage BASIC interpreter and all its instructions, the displaying of characters, etc...
It is important to know that the result given by the PEEK instruction for Internal ROM in CPU is not the real value of the requested bytes, but only the high byte of the requested address. To reverse engineer this ROM, you will need to use my
ToolBox program that includes a special Machine Language Routine for reading the ROMs of the PC.
Here are some interesting calls to the Internal ROM :
- CALL &0000 : resets the PC
- CALL &0035 : power off the PC
- CALL &13C4 : stops the LCD display
- CALL &13C8 : starts the LCD display
Here is an interesting area of Bank #0 of External ROM : starting at address &58E9 we can find the description of all Basic instructions, in a table having the following structure :
Basic Instruction | Address | Extra Code (?) | Basic Token Code | HB (?) | LB (?) | ASCII Letters of Instruction |
---|
ASC | &58E9 | 19 | 208 | 0 | 0 | 65 83 67 |
---|
AND | &58F0 | 3 | 161 | 0 | 0 | 65 78 68 |
---|
ABS | &58F7 | 3 | 153 | 0 | 0 | 65 66 83 |
---|
ATN | &58FE | 3 | 159 | 0 | 0 | 65 84 78 |
---|
ASN | &5905 | 3 | 157 | 0 | 0 | 65 83 78 |
---|
ACS | &590C | 3 | 158 | 0 | 0 | 65 67 83 |
---|
AREAD | &5913 | 37 | 99 | 24 | 78 | 65 82 69 65 68 |
---|
... | ... | ... | ... | ... | ... | ... |
---|
External RAM (Random Access Memory)
It is in this part of the memory that the LCD display is managed. But not only, other informations can also be set.
- Special LCD information
- Management of Radian, Degree or Gradian
- Main display (150 x 32 pixels)
Basically, the LCD is mapped in 4 lines of 8 vertical pixels each (4 x 8 = 32 pixels). Each group of 8 vertical pixels is included in a byte.
The LCD is mapped horizontally in 5 columns of 30 bytes (5 x 30 = 150 pixels) according to the following matrix (double mapping with a distance of 256 bytes between same column, and 512 bytes distance between two columns).
| Column #1 | Column #2 | Column #3 | Column #4 | Column #5 |
Line #1 | Map #1 Map #2 | &2800..&281D &2900..&291D | &2A00..&2A1D &2B00..&2B1D | &2C00..&2C1D &2D00..&2D1D | &2E00..&2E1D &2F00..&2F1D | &3000..&301D &3100..&311D |
Line #2 | Map #1 Map #2 | &2840..&285D &2940..&295D | &2A40..&2A5D &2B40..&2B5D | &2C40..&2C5D &2D40..&2D5D | &2E40..&2E5D &2F40..&2F5D | &3040..&305D &3140..&315D |
Line #3 | Map #1 Map #2 | &281E..&283B &291E..&293B | &2A1E..&2A3B &2B1E..&2B3B | &2C1E..&2C3B &2D1E..&2D3B | &2E1E..&2E3B &2F1E..&2E3B | &301E..&303B &311E..&313B |
Line #4 | Map #1 Map #2 | &285E..&287B &295E..&297B | &2A5E..&2A7B &2B5E..&2B7B | &2C5E..&2C7B &2D5E..&2D7B | &2E5E..&2E7B &2F5E..&2F7B | &305E..&307B &315E..&317B |
Column #n = 512 + Column #n-1
Map #2 = 256 + Map #1
Notice : Each character is made of 6 bytes, so up to 150 / 6 = 25 characters could be shown on the LCD. But the editor (both in Run Mode and in Pro Mode) only displays 24 characters, the first 6 bytes never being used by the editor.
- Graphics display
In commands like LINE(X1,Y1)-(X2,Y2) and PSET(X1,Y1), here is where the information for coordinates can be found :
| Address |
---|
X1 | [&30A8] + 256 x [&30A9] |
---|
Y1 | [&30AC] + 256 x [&30AD] |
---|
X2 | [&30AA] + 256 x [&30AB] |
---|
Y2 | [&30AE] + 256 x [&30AF] |
---|