new vm: next steps
This commit is contained in:
parent
3e0899359b
commit
02c86567ee
2 changed files with 10 additions and 3 deletions
|
|
@ -25,12 +25,17 @@ proc codeListing(c: PCtx, result: var string) =
|
|||
result.addf("\t$#\tr$#, r$#, r$#", ($opc).substr(3), x.regA,
|
||||
x.regB, x.regC)
|
||||
else:
|
||||
result.addf("\t$#\tr$#, r$#", ($opc).substr(3), x.regA, x.regBx)
|
||||
result.add(" #")
|
||||
result.addf("\t$#\tr$#, r$#", ($opc).substr(3), x.regA, x.regBx-wordExcess)
|
||||
result.add("\t#")
|
||||
result.add(toFileLine(c.debug[i]))
|
||||
result.add("\n")
|
||||
inc i
|
||||
|
||||
proc echoCode*(c: PCtx) =
|
||||
var buf = ""
|
||||
codeListing(c, buf)
|
||||
echo buf
|
||||
|
||||
proc gABC(ctx: PCtx; n: PNode; opc: TOpcode; a, b, c: TRegister = 0) =
|
||||
assert opc.ord < 255
|
||||
let ins = (opc.uint32 or (a.uint32 shl 8'u32) or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue