Skip to content

Commit

Permalink
interpreter/ast: add Extern instruction for #1
Browse files Browse the repository at this point in the history
  • Loading branch information
pdarragh committed Jun 30, 2022
1 parent 7e30b1c commit df85e9f
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions interpreter/ast.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,27 @@
(define-instructions instructions ...))]))

(define-instructions
(Label (x) check:label-symbol)
(Ret () check:none)
(Call (x) check:target)
(Mov (dst src) check:src-dest)
(Add (dst src) check:arith)
(Sub (dst src) check:arith)
(Cmp (a1 a2) check:src-dest)
(Jmp (x) check:target)
(Je (x) check:target)
(Jne (x) check:target)
(Jl (x) check:target)
(Jg (x) check:target)
(And (dst src) check:src-dest)
(Or (dst src) check:src-dest)
(Xor (dst src) check:src-dest)
(Sal (dst i) check:shift)
(Sar (dst i) check:shift)
(Push (a1) check:push)
(Pop (a1) check:register)
(Lea (dst x) check:lea))
(Extern (x) check:label-symbol)
(Label (x) check:label-symbol)
(Ret () check:none)
(Call (x) check:target)
(Mov (dst src) check:src-dest)
(Add (dst src) check:arith)
(Sub (dst src) check:arith)
(Cmp (a1 a2) check:src-dest)
(Jmp (x) check:target)
(Je (x) check:target)
(Jne (x) check:target)
(Jl (x) check:target)
(Jg (x) check:target)
(And (dst src) check:src-dest)
(Or (dst src) check:src-dest)
(Xor (dst src) check:src-dest)
(Sal (dst i) check:shift)
(Sar (dst i) check:shift)
(Push (a1) check:push)
(Pop (a1) check:register)
(Lea (dst x) check:lea))

(provide (struct-out Offset))
(struct Offset (r i) #:transparent)
Expand Down

0 comments on commit df85e9f

Please sign in to comment.