add db overwrite
This commit is contained in:
parent
f2d0630f20
commit
481dc56522
13
asm/test.py
13
asm/test.py
|
@ -459,6 +459,19 @@ class DataTest(unittest.TestCase):
|
||||||
self.assertEqual(ex(), ffi.RunRet.STOP)
|
self.assertEqual(ex(), ffi.RunRet.STOP)
|
||||||
self.assertEqual(ex.getdat(0), [5,6,7,8,9])
|
self.assertEqual(ex.getdat(0), [5,6,7,8,9])
|
||||||
self.assertEqual(ex.getdat(1), [0x10,0x11,0x12,0x13])
|
self.assertEqual(ex.getdat(1), [0x10,0x11,0x12,0x13])
|
||||||
|
def test_alloc_repeat_jump_skip(self):
|
||||||
|
p = Program()
|
||||||
|
p.parse_lines([
|
||||||
|
"db d0 [1,2,3,4]",
|
||||||
|
"db d1 [10,11,12,13]",
|
||||||
|
"j .end",
|
||||||
|
"db d1 [5,6,7,8,9]",
|
||||||
|
".end"
|
||||||
|
])
|
||||||
|
ex = ffi.Environment(p())
|
||||||
|
self.assertEqual(ex(), ffi.RunRet.STOP)
|
||||||
|
self.assertEqual(ex.getdat(0), [1,2,3,4])
|
||||||
|
self.assertEqual(ex.getdat(1), [0x10,0x11,0x12,0x13])
|
||||||
|
|
||||||
class SCEnv(ffi.Environment):
|
class SCEnv(ffi.Environment):
|
||||||
def syscall(self, s):
|
def syscall(self, s):
|
||||||
|
|
2
creole.c
2
creole.c
|
@ -559,7 +559,7 @@ enum creole_run_ret creole_step(struct creole_env *env, creole_word *sc)
|
||||||
|
|
||||||
switch (ins.opcode) {
|
switch (ins.opcode) {
|
||||||
case CREOLE_DB:
|
case CREOLE_DB:
|
||||||
break;
|
env->dats[ins.w[0]] = ins.datapt;
|
||||||
case CREOLE_PUSH:
|
case CREOLE_PUSH:
|
||||||
check(read_val(env, &ins, 0, &a1));
|
check(read_val(env, &ins, 0, &a1));
|
||||||
check(creole_push(env, a1));
|
check(creole_push(env, a1));
|
||||||
|
|
Loading…
Reference in New Issue