summaryrefslogtreecommitdiff
path: root/usr.bin/oasm/emit.c
AgeCommit message (Collapse)Author
3 daysoasm: Add encoding for MRO type instructionsIan Moffett
This commit introduces encoding logic for 4 additional instructions: - MROB (Mask Register Over [byte]) - MROW (Mask Register Over [word]) - MROD (Mask Register Over [dword]) - MROQ (Mask Register Over [qword]) This instruction is used to fill a register with a specific length of zeros or ones. For example, to fill a register (e.g., x2) with 16-bits of 1s: -- !! !! Clear bits x2[7:0]... Mrrp,, !! mrow!! !! mrow x2, #1 -- Similarly, an operand of zero sets it to zero. For example, to clear an entire 64-bit register with zeros. Something like this can be done: -- mroq x1, #0 -- Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Add encoding for BR instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Add encoding logic for "DIV" instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Introduce encoding for MUL instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: 'osxm64' -> 'osmx64'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Add encoding logic for "SUB" instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: Parse and encode the "HLT" instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: Implement encoding for 'ADD' instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Remove extra whitespaceIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Remove extra newlineIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Handle increment/decrement operationsIan Moffett
Implement the initial encoding logic for INC/DEC instructions. Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Fix typoIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Don't use TAILQ_FOREACH for processingIan Moffett
In order to have more control over the flow at which we grab the next tokens, we should roll our own loop by hand using TAILQ_FIRST() and TAILQ_NEXT() Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: Add initial codegen emit sourcesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>