Major changes inlude: * Bit the bullet and now instructions have their length hard-coded * Move from_utf8 object parsing to be done by their objects (instead of a Parser god object) * A list of AST sections are assembled into an Object using the new vm::obj::assemble module. * Changed the object layout some in the spec, and adjusted code to match this. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
36 lines
452 B
NASM
36 lines
452 B
NASM
data $0x1000 .. $0x2000 {
|
|
}
|
|
|
|
code $0x0 {
|
|
main:
|
|
storeimm %r00, $0xDEAD
|
|
storeimm %r01, $16
|
|
|
|
shl %r00, %r01
|
|
|
|
storeimm %r01, $0xBEEF
|
|
or %r00, %r01
|
|
|
|
storeimm %r01, $0xDEADBEEF
|
|
|
|
storeimm %r00, failure
|
|
storeimm %r01, ok
|
|
cmpeq %r00, %r01
|
|
|
|
jz %r00
|
|
|
|
jmp %r01
|
|
|
|
failure:
|
|
storeimm %status, $1
|
|
halt
|
|
|
|
ok:
|
|
|
|
.export main
|
|
}
|
|
|
|
meta {
|
|
entry: main
|
|
}
|