adding hardware devices

Arthur Paulino 2018-01-03 10:51:24 -03:00
parent e4812cfd6a
commit e00a15e2c2

@ -2,9 +2,43 @@
An image showing the Cubot's parts (CPU, registers and hardware) followed by brief descriptions.
# Hardware Specifications
# Hardware
Details about the hardware with minimal code examples on how to use them.
The Cubot'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.
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
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
```
## Hardware Devices
- [Hologram Projector](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Hologram-Projector)
- [Drill](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Drill)
- [Inventory](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Inventory)
- [Laser](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Laser)
- [Legs](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Legs)
- [LiDAR](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-LiDAR)
- [Keyboard](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Keyboard)
- [Battery](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Battery)
- [Random number generator](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Random-Number-Generator)
- [Clock](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Clock)
- [Floppy Drive](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Floppy-Drive)
- [Universal Com Port](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Universal-Com-Port)
- [Radio Receiver](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Radio-Receiver)
# The MAR-CPU