From 99f6e167eaa903d280647a77b7dc83ab4c7532d1 Mon Sep 17 00:00:00 2001 From: Fey Naomi Schrewe Date: Tue, 14 Oct 2025 19:02:51 +0200 Subject: [PATCH] feat: add simple macro for opcodes --- host/assembler/opcodes.fnl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/host/assembler/opcodes.fnl b/host/assembler/opcodes.fnl index 25403ce..d187c2c 100644 --- a/host/assembler/opcodes.fnl +++ b/host/assembler/opcodes.fnl @@ -1,5 +1,10 @@ (local util (require :host.util)) +(macro construct-code [& forms] + `(bor + ,(unpack + (icollect [i n (ipairs forms)] `(lshift ,(. n 1) ,(. n 2)))))) + (local conditions {:equal 0x0 :not-equal 0x1 :carry 0x2