Permalink
Browse files

update m0 tests to use new deref_* ops

  • Loading branch information...
1 parent 983bc85 commit 80eecc20beb830529aba2f99b15de7eecae390a5 Jimmy Zhuo committed Apr 4, 2012
@@ -8,7 +8,7 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
@@ -23,12 +23,12 @@
addi_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
addi_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
@@ -11,30 +11,30 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
set_imm N0, 0, 3
- deref N0, CONSTS, N0
+ deref_n N0, CONSTS, N0
set_imm N1, 0, 4
- deref N1, CONSTS, N1
+ deref_n N1, CONSTS, N1
add_n N2, N1, N0
set_imm N3, 0, 5
- deref N3, CONSTS, N3
+ deref_n N3, CONSTS, N3
sub_n N4, N3, N2
goto_if addn_nok, N4
goto addn_ok, x
addn_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
addn_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
@@ -8,7 +8,7 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
@@ -23,12 +23,12 @@
and_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
and_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
@@ -12,12 +12,12 @@
set_imm I0, 0, 0
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# I1 is the arg count
set_imm I1, 0, ARGC
- deref I1, INTERP, I1
+ deref_i I1, INTERP, I1
# I2 is the expected arg count
set_imm I2, 0, 6
@@ -28,13 +28,13 @@
argc_nok:
set_imm S0, 0, 3
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
goto argv_test, x
argc_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
goto argv_test, x
@@ -44,20 +44,20 @@ argv_test:
set_imm I0, 0, 0
set_imm I1, 0, 1
set_imm S0, 0, ARGV
- deref S0, INTERP, S0
- deref S0, S0, I1
+ deref_s S0, INTERP, S0
+ deref_s S0, S0, I1
# TODO: test S0 eq 'kittens'
argv_nok:
set_imm S0, 0, 5
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
goto end, x
argv_ok:
set_imm S0, 0, 4
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
goto end, x
@@ -8,7 +8,7 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
@@ -26,12 +26,12 @@
ashr_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
ashr_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
@@ -9,15 +9,15 @@
set_imm I0, 0, 1
set_imm I1, 0, 0
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
set_imm S1, 0, 2
- deref S1, CONSTS, S1
+ deref_s S1, CONSTS, S1
print_s I0, S1, x
set_imm P0, 0, 0
- deref P0, CONSTS, P0
+ deref_p P0, CONSTS, P0
goto_chunk P0, I1, x
.chunk "the_second_chunk"
@@ -27,11 +27,11 @@
.metadata
.bytecode
set_imm S1, 0, 1
- deref S1, CONSTS, S1
+ deref_s S1, CONSTS, S1
print_s I0, S1, x
set_imm P0, 0, 0
- deref P0, CONSTS, P0
+ deref_p P0, CONSTS, P0
goto_chunk P0, I1, x
.chunk "chunk3"
@@ -41,11 +41,11 @@
.metadata
.bytecode
set_imm S1, 0, 1
- deref S1, CONSTS, S1
+ deref_s S1, CONSTS, S1
print_s I0, S1, x
set_imm P0, 0, 0
- deref P0, CONSTS, P0
+ deref_p P0, CONSTS, P0
goto_chunk P0, I1, x
.chunk "4thchunk"
@@ -54,7 +54,7 @@
.metadata
.bytecode
set_imm S1, 0, 0
- deref S1, CONSTS, S1
+ deref_s S1, CONSTS, S1
print_s I0, S1, x
exit I1, x, x
@@ -11,7 +11,7 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
@@ -20,7 +20,7 @@
# N1 = 99.0 (from constants segment)
set_imm N1, 0, 3
- deref N1, CONSTS, N1
+ deref_n N1, CONSTS, N1
# N2 = 99 (from convert_i_n)
convert_i_n I2, N1, x
@@ -31,12 +31,12 @@
convert_i_n_nok1:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
convert_i_n_ok1:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# I1 = -23
@@ -46,7 +46,7 @@ convert_i_n_ok1:
# N1 = -23.0 (from constants segment)
set_imm N1, 0, 4
- deref N1, CONSTS, N1
+ deref_n N1, CONSTS, N1
# N2 = -23 (from convert_i_n)
convert_i_n I2, N1, x
@@ -57,12 +57,12 @@ convert_i_n_ok1:
convert_i_n_nok2:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
convert_i_n_ok2:
set_imm S0, 0, 5
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
@@ -9,12 +9,12 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
set_imm N0, 0, 3
- deref N0, CONSTS, N0
+ deref_n N0, CONSTS, N0
set_imm N1, 0, 99
sub_i N0, N0, N1
@@ -23,12 +23,12 @@
deref_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
deref_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
@@ -8,7 +8,7 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
@@ -23,12 +23,12 @@
divi_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
divi_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
@@ -11,30 +11,30 @@
.bytecode
set_imm S0, 0, 0
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
set_imm I0, 0, 1
print_s I0, S0, x
set_imm N0, 0, 3
- deref N0, CONSTS, N0
+ deref_n N0, CONSTS, N0
set_imm N1, 0, 4
- deref N1, CONSTS, N1
+ deref_n N1, CONSTS, N1
div_n N2, N0, N1
set_imm N3, 0, 5
- deref N3, CONSTS, N3
+ deref_n N3, CONSTS, N3
sub_n N4, N3, N2
goto_if divn_nok, N4
goto divn_ok, x
divn_nok:
set_imm S0, 0, 1
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
divn_ok:
set_imm S0, 0, 2
- deref S0, CONSTS, S0
+ deref_s S0, CONSTS, S0
print_s I0, S0, x
# This code isn't really PASM, but the highlighting works well.
Oops, something went wrong.

0 comments on commit 80eecc2

Please sign in to comment.