Updated Hardware (markdown)

Simon Fortier 2017-11-08 20:26:25 -05:00
parent c46d7bcd3f
commit dcd0b16643

@ -1,9 +1,28 @@
* Support up to 65535 hardware devices 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.
* HWQ
* HWI
* HWN
- Drill The **HWQ** (Hardware Query) instruction can be used to get information about the hardware connected at an address.
Exemple:
```assembly
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 = 0
```
The **HWI** (Hardware Interupt) instruction sends an interrupt to the hardware device at the specified address
```assembly
; Get the current held item id
INVENTORY_HW equ 0x0006 ; An inventory module is connected at address 0x006
MOV A, 1 ; The Inventory hardware expects 1 (POLL) or 2 (CLEAR)
HWI INVENTORY_HW
; B = current held item id
```
### Hardware Devices:
- [Drill](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Drill)
- Inventory - Inventory
- Laser - Laser
- Legs - Legs