From 729a19a6b7e636a8af3a15f7fe5204cc0d59dbf7 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 23 Jul 2025 18:38:09 -0400 Subject: oasm: Add initial support for labels A label is like a pin on a map with a number attached to it. OASM keeps track of a number referred to as the psuedo instruction pointer (PIP). This value is initially zero by default and is incremented every instruction. The purpose of this value is to pin a location in the code and mark it to be at a specific address so that further references to that label would be translated to the previous PIP value at the time of encountering the label. Signed-off-by: Ian Moffett --- usr.bin/oasm/parse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr.bin/oasm/parse.c') diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c index 673fbcd..113671f 100644 --- a/usr.bin/oasm/parse.c +++ b/usr.bin/oasm/parse.c @@ -49,6 +49,8 @@ static const char *tokstr[] = { [ TT_DEC ] = "dec", [ TT_MOV ] = "mov", [ TT_IMM ] = "", + [ TT_LABEL] = "