From 3ab5f07bac34bc9de5b9038407353c707f3f4c2f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 21 Jul 2025 09:17:30 -0400 Subject: oasm: Parse and encode the "HLT" instruction Signed-off-by: Ian Moffett --- usr.bin/oasm/include/oasm/emit.h | 1 + usr.bin/oasm/include/oasm/lex.h | 1 + 2 files changed, 2 insertions(+) (limited to 'usr.bin/oasm/include') diff --git a/usr.bin/oasm/include/oasm/emit.h b/usr.bin/oasm/include/oasm/emit.h index f4b4f77..b0a2fd1 100644 --- a/usr.bin/oasm/include/oasm/emit.h +++ b/usr.bin/oasm/include/oasm/emit.h @@ -60,6 +60,7 @@ #define OSMX64_SLL 0x11 /* Shift left logical operation */ #define OSMX64_SRL 0x12 /* Shift right logical operation */ #define OSMX64_MOV_IMM 0x13 /* Data move operation from IMM */ +#define OSMX64_HLT 0x14 /* Halt the processor */ /* * OSMX64 register definitions diff --git a/usr.bin/oasm/include/oasm/lex.h b/usr.bin/oasm/include/oasm/lex.h index 28ad52c..6ffaf79 100644 --- a/usr.bin/oasm/include/oasm/lex.h +++ b/usr.bin/oasm/include/oasm/lex.h @@ -95,6 +95,7 @@ typedef enum { TT_SUB, /* 'sub' */ TT_MUL, /* 'mul' */ TT_DIV, /* 'div' */ + TT_HLT, /* 'hlt' */ /* Register ops */ TT_MOV, /* 'mov' */ -- cgit v1.2.3