-
Notifications
You must be signed in to change notification settings - Fork 3
ZLoader Commands
Summary of each of the (current) commands available in ZLoader 1.18.4
NOTE the current command set is somewhat obscure comprising short character codes, eg D
for dump memory DM
for dump memory block, DI
for disassemble. This worked when there were a limited number of functions however as it's grown the command set has become a bit of a pain to remember, also resulting in somewhat inefficient code. The (hopefully) next version will replace the command parser with a sensible word based system with an 'alias' mechanism so people can add their own short codes.
Table 1 shows commands available in the 'default' (on boot) mode, table 2 shows replacement/additional commands available in the debugger mode. To switch between the two modes use the T
command.
Command | Description |
---|---|
BO | Boot from Raspberry Pi. Loads the default image configured on the Pi. Download is via the block protocol. This is the fastest way to develop new code |
BO- | As BO but don't execute the code |
BOS? | List executable images registered on the SDCard (Note 4) |
BOS [n] | Boot one of the SDCard images (default to the first image) |
BOS- [n] | As BOS but don't execute the loaded code |
C | Show configuration parameters stored in the RTC NVRAM |
C n=i | Set config parameter n to value i, which can be 0/1/YES/NO |
DI [addr] | Disassemble from addr or next block if ommitted |
DM [addr] | Display memory block |
DN | Display the NVRAM in the RTC chip |
DT [datetime] | Display (set) the date/time from the RTC. Date/time format: See below |
D | Dump the next memory block in the same mode as the last D command (DI/DM) |
F add len val | Fill len bytes from address add with value val
|
H | Clear screen |
I p | Input value from port p
|
L | Load Intel Hex format code from the terminal. Not executed |
LF | Load a binary from from the Raspberry Pi connected to SIO port 2 |
LH | Load a Intel Hex formatted file from from the Raspberry Pi connected to SIO port 2 |
M addr | Modify memory from address |
O port val | Output val to port , both values 8 bit hex |
P [blk=page] | Display and optionally change application memory page mapping. blk is 0-3, page is 0-FF (hex) |
SM | Display the current logical drive mappings. Each drive is 4MB and mapped to one of the logical drives A-P |
SM drv dsk | Map logical drv to dsk . drv is a letter from A-P, dsk is the drive number (4MB drives starting from 0) |
SD sadr | Dump sect sector (512 bytes) - see note 1 for description of SDCard addresses |
SW sadr | Write a sector (512 bytes) to an SDCard - see note 1 for description of SDCard addresses |
T | Toggle between command and debug modes |
WI sadr strt end | Write data from application space to SDCard. The sadr is the location on the disk to which data is to be written. It's either an absolute address (32 bit hex number) or a relative address to a specific drive (eg 100:A). In both cases the address is a 512byte sector address. |
WB id DELETE | Delete the identified bootable image record |
WB id {desc} | Add an entry to the bootable image menu. See detailed description to understand {desc} and bootable images |
Note 1: sadr
is either an absolute sector address or a sector offset from a logical drive:
- Sector address: 32 bit hex number n the SDCard, eg
1F
addresses the 512 bytes from 3E00 to 3FFF. - Relative address:
sector:drive
where sector is the sector offset from the start of the mapped drive anddrive
is the mapped drive letter A-P
Note 2: ZLoader supports logical drives named A thru P. Each of these logical letters can be mapped to any 4MB 'page' on the SDCard. By default letter A addresses the second 4MB on the card, leter B the third 4MB etc.
Note 3: The first 4MB of space of the SDCard is reserved for use by ZLoader to store configuration data and things like boot tables.
Note 4 ZLoader reserves the first 4MB of SDCard storage or its own use. The first 512 bytes is used for a 'boot table'. This allows executable images such as CP/M to be installed on the SDCard and loaded/run into memory.
Table 2: Debug commands. In debug the following commands override the commands above:
Command | Description |
---|---|
B XXXX | Set a breakpoint at address XXXX |
G [addr] | Run until breakpoint, with optional start address |
N [n] | Execute the next n instructions, stepping over subroutines |
R RR=val | Set the value of a register. Standard names apply. Can't currently set alternative register set. |
S [n] | Execute the next n instructions (default 1), stepping into subroutines |