Add "if" as alias for "branch"
This commit is contained in:
parent
227dcc662e
commit
cc3d576112
@ -7,8 +7,14 @@
|
||||
#:select (write-u8 write-bytevector))
|
||||
#:export (assemble))
|
||||
|
||||
(define *aliases*
|
||||
'((if . branch)))
|
||||
|
||||
(define (or-alias inst)
|
||||
(or (assq-ref *aliases* inst) inst))
|
||||
|
||||
(define (lookup-instruction inst)
|
||||
(define inst-obj (assq inst *instruction-set*))
|
||||
(define inst-obj (assq (or-alias inst) *instruction-set*))
|
||||
(if inst-obj
|
||||
inst-obj
|
||||
(error (format #f "could not find instruction ~a" inst))))
|
||||
|
Loading…
Reference in New Issue
Block a user