mirror of
				https://github.com/simon987/Much-Assembly-Required.git
				synced 2025-11-04 10:06:54 +00:00 
			
		
		
		
	
						
							Page:
							Hardware
						
						
					
					
							Pages
							
							
								(Hardware) Battery
							
								(Hardware) Clock
							
								(Hardware) Construction Arm
							
								(Hardware) Core
							
								(Hardware) Drill
							
								(Hardware) Floppy Drive
							
								(Hardware) Hologram Projector
							
								(Hardware) Inventory
							
								(Hardware) Keyboard
							
								(Hardware) Laser
							
								(Hardware) Legs
							
								(Hardware) LiDAR
							
								(Hardware) Radio Receiver
							
								(Hardware) Random Number Generator
							
								(Hardware) Universal Com Port
							
								(Installation) Arch Linux
							
								(Installation) Windows
							
								(Snippet) Constants
							
								(Snippet) Dump memory to disk
							
								(Snippet) Keyboard controlled robot
							
								(Snippet) Manhattan distance
							
								(Snippet) Move in a random direction
							
								Assembler directives
							
								Assembly program examples
							
								Basic Assembly tutorial
							
								Biomass
							
								Blueprint
							
								CPU
							
								Collaboration Guide
							
								Day Night Cycle and solar Energy
							
								Debugging
							
								Game Universe
							
								Hacked NPC
							
								Hardware
							
								Home (old)
							
								Home
							
								Instruction Encoding
							
								Instruction Set
							
								Items
							
								Learn by Examples
							
								NPC Factory
							
								Non Player Character (NPC)
							
								Project structure
							
								Radio Tower
							
								Random Access Memory
							
								Road Map
							
								The Cubot Manuals
							
								The Game Universe
							
								Useful Code Snippets
							
								Users' Repositories
							
								World
							
						
					 Clone
	
					12 
					
				
						Hardware
						
				
							
							Borys64 edited this page 2020-02-17 02:31:53 +00:00 
						
					Table of Contents
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 = 0
The 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 
Hardware Devices:
| 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 |