Expressions Syntax Reference
Spectaculator has a C-like syntax for expressions used in the debugger.
Note
Constants, functions and variables are case-insensitive.
Expressions are evaluated using normal mathematical order of precedence. Use parentheses to override.
Constants
Name |
Description |
|---|---|
S_FLAG |
Sign Flag ($80). |
Z_FLAG |
Zero Flag ($40). |
F5_FLAG |
Bit 5 of flags register ($20). Unused. |
H_FLAG |
Half carry ($10). |
F3_FLAG |
Bit 3 of flags register ($08). Unused. |
P_FLAG |
Parity/Overflow Flag ($04) |
V_FLAG |
Synonym for Parity/Overflow Flag ($04) |
N_FLAG |
Add/Subtract Flag ($02) |
C_FLAG |
Carry Flag ($01) |
Operators
Operator |
Description |
|---|---|
* / + - |
Multiply, divide, add and subtract. |
% |
Modulus |
- |
Unary minus. |
== |
Equal to. |
!= |
Not equal to. |
< |
Less than. |
> |
Greater than. |
<= |
Less than or equal to. |
>= |
Greater than or equal to. |
! |
Logical NOT. |
&& |
Logical AND. |
|| |
Logical OR. |
& |
Bitwise AND. |
| |
Bitwise OR. |
^ |
Logical XOR. |
~ |
Negate. |
<< |
Shift left. |
>> |
Shift right. |
Note
There is no dereference operator, *. Use the
rb()orrw()functions instead.
Functions
Function |
Description |
|---|---|
rb(expr) |
Returns the 8-bit byte value at the memory address |
rw(expr) |
Returns the 16-bit word (little-endian) value at the memory address |
rwb(expr) |
Returns the 16-bit word (big-endian) value at the memory address |
Variables
Name |
Description |
|---|---|
AF |
AF Register pair. |
BC |
BC Register pair. |
DE |
DE Register pair. |
HL |
HL Register pair. |
AF' |
AF' Register pair. |
BC' |
BC' Register pair. |
DE' |
DE' Register pair. |
HL' |
HL' Register pair. |
IX |
IX index register. |
IY |
IY index register. |
PC |
Program Counter. |
SP |
Stack Pointer. |
I |
Interrupt vector register. |
R |
Memory refresh register. |
A |
A Register. |
F |
Flags Register. |
B |
B Register. |
C |
C Register. |
D |
D Register. |
E |
E Register. |
H |
H Register. |
L |
L Register. |
A' |
A' Register. |
F' |
Alternate Flags Register. |
B' |
B' Register. |
C' |
C' Register. |
D' |
D' Register. |
E' |
E' Register. |
H' |
H' Register. |
L' |
L' Register. |
IXH |
High byte of IX index register. |
IXL |
Low byte of IX index register. |
IYH |
High byte of IY index register. |
IYL |
Low byte of IY index register. |
IM |
Interrupt Mode (0,1 or 2). |
IFF1 |
Interrupt Flip Flop (1). |
IFF2 |
Interrupt Flip Flop (2). |
NMIREQ |
True if there is a pending non-maskable interrupt request. |
INTREQ |
True if there is a pending maskable interrupt request. |
HALTED |
True if the Z80 is currently HALTed. |