progress on debugging bf.dsa
This commit is contained in:
+6
-10
@@ -20,6 +20,7 @@ _init_stack:
|
|||||||
start:
|
start:
|
||||||
// load the start of the program into rg0
|
// load the start of the program into rg0
|
||||||
lwi program, rg0
|
lwi program, rg0
|
||||||
|
lwi data, rg1
|
||||||
|
|
||||||
// rg0 is our instruction pointer
|
// rg0 is our instruction pointer
|
||||||
// rg1 is our data pointer
|
// rg1 is our data pointer
|
||||||
@@ -41,11 +42,11 @@ loop_start:
|
|||||||
ldb rg0, rg3
|
ldb rg0, rg3
|
||||||
|
|
||||||
|
|
||||||
// pusha 2
|
pusha 2
|
||||||
// push rg3
|
push rg3
|
||||||
// call print::print_byte
|
call print::print_byte
|
||||||
// pop zero
|
pop zero
|
||||||
// popa 2
|
popa 2
|
||||||
|
|
||||||
// switch on the instruction
|
// switch on the instruction
|
||||||
// all cases will return to either loop_start or loop_end
|
// all cases will return to either loop_start or loop_end
|
||||||
@@ -69,11 +70,6 @@ loop_start:
|
|||||||
jeq end
|
jeq end
|
||||||
|
|
||||||
// if we get here, we don't know what the instruction is
|
// if we get here, we don't know what the instruction is
|
||||||
lwi error, rg0
|
|
||||||
push rg0
|
|
||||||
call print::print
|
|
||||||
pop zero
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
lwi error, rg2
|
lwi error, rg2
|
||||||
pusha 2
|
pusha 2
|
||||||
|
|||||||
Reference in New Issue
Block a user