Programming Virtual Hardware Devices
Programming Virtual Hardware Devices
You can set the state of each lamp by setting its bit:
Only 12 low bits of a word are used (0 to 11), last bits (12 to
15) are unused.
For example:
IN AX, 4
IN AL, 7
decimal binary
action
value value
0 00000000 do nothing.
0 00000000 nothing
bit
description
number
zero when there is no new data in data register, one when there is new
bit #0
data in data register.
zero when robot is ready for next command, one when robot is busy doing
bit #1
some task.
zero when there is no error on last command execution, one when there is
bit #2 an error on command execution (when robot cannot complete the task:
move, turn, examine, switch on/off lamp).
example:
MOV AL, 1 ; move forward.
OUT 9, AL ;
MOV AL, 3 ; turn right.
OUT 9, AL ;
MOV AL, 1 ; move forward.
OUT 9, AL ;
MOV AL, 2 ; turn left.
OUT 9, AL ;
MOV AL, 1 ; move forward.
OUT 9, AL ;
keep in mind that robot is a mechanical creature and it takes
some time for it to complete a task. You should always
check bit#1 of status register before sending data to port
9, otherwise the robot will reject your command and "busy!"
will be shown. See also robot.asm in c:\emu8086\
examples.
Creating Custom Robo-World Map
If you click the robot button and place robot over existing
robot it will turn 90 degrees counter-clock-wise. To manually
move the robot just place it anywhere else on the map.
If you click lamp button and click switched-on lamp the lamp
will be switched-off, if lamp is already switched-off it will be
deleted. Click over empty space will create a new switched-
on lamp.