Description:
Pop a Brainstem command packet off the top of the stack and execute the command. The top byte on the stack must be the size of the command packet. The first byte in a command packet is the destination address. If this address matches the address of the Brainstem running the process, the command goes directly into the command queue. If the addresses do not match, the command is routed over the IIC bus to a different Brainstem module. The second byte in a command packet is the number of data bytes in the command. This size must be two less than the total command packet size.
Pseudo Code:
cmdSize = stack[sp - 1]
{command goes onto command queue}
sp = sp - cmdSize
pc = pc + 1
Flags Affected:
Possible Errors:
Example:
popcmd
Before
| stack | | | top | | 1 | 0x05 | | 2 | 0x42 | | 3 | 0x41 | | 4 | 0x17 | | 5 | 0x03 | | 6 | 0x02 | | 7 | 0x23 | | 8 | 0x68 | | 9 | 0x26 | | | bottom |
|
| | After
| stack | | | top | | 1 | 0x23 | | 2 | 0x68 | | 3 | 0x26 | | | bottom |
|
|
version: 1.0, build 80903
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado. All rights reserved.