mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46:43 +00:00
Updated Hardware (markdown)
parent
c46d7bcd3f
commit
dcd0b16643
29
Hardware.md
29
Hardware.md
@ -1,9 +1,28 @@
|
||||
* Support up to 65535 hardware devices
|
||||
* HWQ
|
||||
* HWI
|
||||
* HWN
|
||||
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.
|
||||
|
||||
- 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
|
||||
- Laser
|
||||
- Legs
|
||||
|
Loading…
x
Reference in New Issue
Block a user