x64: # opcodes

pull/4627/head
Alexander Medvednikov 2020-04-27 21:38:53 +02:00
parent 9f76a7b250
commit 5d073dcce5
1 changed files with 14 additions and 0 deletions

View File

@ -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 {