Implement HIGH() and LOW() operators

They work with the 16-bit registers BC, DE and HL, returning the
corresponding 8-bit register. HIGH() works with AF as well, returning A.

They also work with any kind of constant or symbol, generating a RPN
patch in the object file if the value is not defined at assembly time.

They work with macro arguments as well.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-04-06 22:40:34 +01:00
parent bfcef01211
commit a6a47ff66d
5 changed files with 92 additions and 17 deletions

View File

@@ -69,6 +69,8 @@ rpn_DIV(struct Expression * expr, struct Expression * src1,
void
rpn_MOD(struct Expression * expr, struct Expression * src1,
struct Expression * src2);
void rpn_HIGH(struct Expression * expr, struct Expression * src);
void rpn_LOW(struct Expression * expr, struct Expression * src);
void rpn_UNNEG(struct Expression * expr, struct Expression * src);
void rpn_UNNOT(struct Expression * expr, struct Expression * src);
UWORD rpn_PopByte(struct Expression * expr);