.macros
%square-and-sum
mul %1 %1
muk %2 %2 ;---- should be mul
add %1 %2
%end
%add-ten
add %1 10
"%end
.code
mov :a 0
mov :b 1
squareandsub(:a, :b) ;---- Should be square-and-sum (meant to be call to macro above)
mov :c 2
prn :b
call foo
mul :c :b
cmp :a :b
ffne quax ;---- Should be jne
mul :c 10
;; function :: quax
quax:
nop
cdlk bar ;---- should be call bar
pop :d
pop :e
prn :d
prn :e
xor :b :b
end
;; function :: foo
foo:
inc :b
xxx ;---- Random wrong instruction
ret
;; function :: bar
bar:
add :a 7
sub :c 1
push 3
push 4
wet ;---- Should be ret
.data
xyz 123
Parser outputs:
3: Invalid instruction `muk`. Did you mean mul?
12: Invalid macro call `squareandsub(:a, :b)`. Did you mean square-and-sum?
18: Invalid instruction `ffne`. Did you mean jne?
22: Invalid instruction `cdlk`. Did you mean call?
31: Invalid instruction `xxx`. Did you mean xor?
38: Invalid instruction `wet`. Did you mean ret?