Programming

The PC1403 basically supports the inbuilt BASIC programming language. Therefore it offers two modes: The programming mode, where the basic source code can be entered and the running mode, used for running and debugging programs.

Tip: Saving RAM
For saving RAM space, you should always use tokens for the BASIC commands. They are accessible via SHIFT – key and only use two bytes instead of X bytes (depending on the commands length) if typed char by char.

You may find the most supported BASIC commands in the manual – most, but not all. Sharp forgot – or simply denied – to mention the most powerful commands, opening the doors to Assembler programming:

Note: Keep attention!
Using the following commands with random parameters can end up in an inconsistent state, which needs the PC1403 to be reseted – all data in the RAM will get lost – save more, save often! (That might be the reason, why Sharp didn’t publish them in their manuals)

Peek and Poke

These two commands enable to set / get values to / from a specific memory address and are therefore quite powerful and your door to system programming.

PEEK(address)
Returns the 8 bit value, stored in the memory at address (16 bit, of course).

POKE address, value1 [, valueX...]
Stores the 8 bit value1 at the 16 bit memory address address. If a list of values is parsed, the address will be incremented automatically.

Peek and Poke already enhance the BASIC interpreter’s functionality enormously. For Assembler programming, you’ll need the Call command too:

Call

The call command can be used for calling an assembler program directly e.g. ROM functions.

CALL address
Calls executable code, starting at the 16 bit memory address address.

Finally, you now have the basic credentials to do all the nice coding stuff which takes advantage of the non default settings of your PC1403. For some source code samples, take a look at those articles.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

*