-
Notifications
You must be signed in to change notification settings - Fork 90
Hardware
Borys64 edited this page Feb 17, 2020
·
12 revisions
The game's microprocessor can handle up to 65535 hardware devices connected to addresses 0x0000-0xFFFF. Hardware devices can interact with the CPU, its memory and its registers.
The HWQ (Hardware Query) instruction can be used to get information about the hardware connected at an address.
Example:
MOV A, 0x0005
HWQ A
; The hardware id of the hardware at address 0x0005 is stored in the B register
; If there is no hardware device connected at this address, B = 0The HWI (Hardware Interupt) instruction sends an interrupt to the hardware device at the specified address
INVENTORY_HW equ 0x0006 ; An inventory module is connected at address 0x006. Define a constant
MOV A, 1 ; The Inventory hardware expects 1 (POLL) or 2 (CLEAR)
HWI INVENTORY_HW
; B = current held item id | Device | Default Address |
|---|---|
| Legs | 0x0001 |
| Laser | 0x0002 |
| LiDAR | 0x0003 |
| Keyboard | 0x0004 |
| Drill | 0x0005 |
| Inventory | 0x0006 |
| Random number generator | 0x0007 |
| Clock | 0x0008 |
| Hologram Projector | 0x0009 |
| Battery | 0x000A |
| Floppy Drive | 0x000B |
| Radio Receiver | 0x000C |
| Universal Com Port | 0x000D |
| Core | 0x000E |
| Shield | 0x000F |
| Construction Arm | 0x0010 |