x64: # opcodes
parent
9f76a7b250
commit
5d073dcce5
|
@ -519,6 +519,18 @@ fn (mut g Gen) stmt(node ast.Stmt) {
|
|||
ast.ForStmt {
|
||||
g.for_stmt(it)
|
||||
}
|
||||
ast.HashStmt {
|
||||
words := it.val.split(' ')
|
||||
for word in words {
|
||||
if word.len != 2 {
|
||||
verror('opcodes format: xx xx xx xx')
|
||||
}
|
||||
b := C.strtol(word.str, 0, 16)
|
||||
// b := word.byte()
|
||||
// println('"$word" $b')
|
||||
g.write8(b)
|
||||
}
|
||||
}
|
||||
ast.Module {}
|
||||
ast.Return {
|
||||
g.gen_exit()
|
||||
|
@ -531,6 +543,8 @@ fn (mut g Gen) stmt(node ast.Stmt) {
|
|||
}
|
||||
}
|
||||
|
||||
fn C.strtol() int
|
||||
|
||||
fn (mut g Gen) expr(node ast.Expr) {
|
||||
// println('cgen expr()')
|
||||
match node {
|
||||
|
|
Loading…
Reference in New Issue