| cmdDBG_STEP | Index |
Command Code:
Host-to-Stem Packet:
| 0 | 1 | 2 | 3 | 4 | 5 | |||||
| address | 4 | cmdDBG_STEP | ProcID | Opcode | OpData |
| ProcID - | Index of a VM process. Range is 0-3. |
| Opcode - | VM instruction opcode. |
| OpData - | 0-2 bytes of data for VM instruction. |
Reply Packet:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |||||||||
| address | 8 | cmdDBG_STEP | ProcID | DBGSTAT | PCH | PCL | SPH | SPL | FLAGS |
| ProcID - | Index of a VM process. Range is 0-3. |
| DBGSTAT - | Status of debugging process. |
| PCH - | High byte of 16-bit program counter. |
| PCL - | Low byte of 16-bit program counter. |
| SPH - | High byte of 16-bit stack pointer. |
| SPL - | Low byte of 16-bit stack pointer. |
| FLAGS - | Contents of flag register. |
Description:
This command executes a single instruction in an active debugging process. A process ID that is out of range will generate an error message. A process ID for an inactive process or an active process that is not in debug mode will generate an error message.
The reply packet is tagged with the cmdDBG_STEP code. It contains the process ID, debug status, program counter, stack pointer, and flag register.
The DBGSTAT is 0 if the operation completes normally. It is 1 if the process exits after an error or normal execution of an exit opcode. The bits in the FLAGS byte are described below.
| Bit | Name | Function |
| 7 | VMLIVE | Set if process is active. |
| 6 | VMBLK | Set if process is sleeping. |
| 5 | VMWAIT | Set if process is waiting for input from a device. |
| 4 | VMERR | Set if last operation caused an error. |
| 3 | VMNEG | Set if result of last flag-modifying operation was negative. |
| 2 | VMZERO | Set if result of last flag-modifying operation was zero. |
| 1 | VMC | Set if result of last flag-modifying operation set carry flag. |
| 0 | VMDBG | Set if process is running in DEBUG mode. |