aboutsummaryrefslogtreecommitdiffstats
path: root/csc/encoding.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-07-29 17:52:54 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-29 17:52:54 -0700
commit762431b0f0a6ead18a93a05c0f3269dca5b8fef1 (patch)
tree068057d0da92aa852fd4674477f7f50784e7f652 /csc/encoding.csc
parentHandle the (csc builtins) library separately. (diff)
downloadchromatopelma-762431b0f0a6ead18a93a05c0f3269dca5b8fef1.tar.zst
Insert an exit op at the end of the program.
Diffstat (limited to 'csc/encoding.csc')
-rw-r--r--csc/encoding.csc5
1 files changed, 3 insertions, 2 deletions
diff --git a/csc/encoding.csc b/csc/encoding.csc
index 7da5370..f6a003d 100644
--- a/csc/encoding.csc
+++ b/csc/encoding.csc
@@ -164,8 +164,9 @@
(arg->le-bytes w word)
(arg->le-bytes w (list 'local ptr))
(arg->le-bytes w offset))
- (('exit)
- (make-opcode w 13 #f #f))
+ (('exit code)
+ (make-opcode w 13 (is-const? code) #f)
+ (arg->le-bytes w code))
(_ (error "invalid opcode" opcode))))