add waveform disarm

This commit is contained in:
Peter McGoron 2023-03-23 20:41:52 +00:00
parent 22674528da
commit c18db4be57
4 changed files with 17 additions and 7 deletions

View File

@ -217,7 +217,8 @@ class Instruction(Enum):
CLOOP_READ = 16, "_render_default", ArgType.VAL, ArgType.REG, ArgType.REG
CLOOP_WRITE = 17, "_render_default", ArgType.VAL, ArgType.VAL, ArgType.VAL
WF_LOAD = 18, "_render_default", ArgType.VAL, ArgType.DAT
WF_EXEC = 19, "_render_default", ArgType.VAL, ArgType.VAL
WF_ARM = 19, "_render_default", ArgType.VAL, ArgType.VAL, ArgType.VAL
WF_DISARM = 22, "_render_default", ArgType.VAL
SENDVAL = 20, "_render_default", ArgType.VAL
SENDDAT = 21, "_render_default", ArgType.DAT

View File

@ -62,9 +62,10 @@ static const struct {
defop(CLOOP_READ, 2, TYPE_VAL, TYPE_REG, TYPE_NONE),
defop(CLOOP_WRITE, 2, TYPE_VAL, TYPE_VAL, TYPE_NONE),
defop(WF_LOAD, 2, TYPE_VAL, TYPE_IMM, TYPE_NONE),
defop(WF_EXEC, 3, TYPE_VAL, TYPE_VAL, TYPE_NONE),
defop(WF_EXEC, 3, TYPE_VAL, TYPE_VAL, TYPE_VAL),
defop(SENDVAL, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE),
defop(SENDDAT, 1, TYPE_IMM, TYPE_NONE, TYPE_NONE)
defop(SENDDAT, 1, TYPE_IMM, TYPE_NONE, TYPE_NONE),
defop(WF_DISARM, 1, TYPE_VAL, TYPE_NONE, TYPE_NONE)
};
/*************************************************************************
@ -678,10 +679,15 @@ enum creole_run_ret creole_step(struct creole_env *env, creole_word *sc)
check(read_val(env, &ins, 1, &a1));
upsilon_load_waveform(env, a0, a1);
break;
case CREOLE_WF_EXEC:
case CREOLE_WF_ARM:
check(read_val(env, &ins, 0, &a0));
check(read_val(env, &ins, 1, &a1));
upsilon_exec_waveform(a0, a1);
check(read_val(env, &ins, 2, &a2));
upsilon_arm_waveform(a0, a1, a2);
break;
case CREOLE_WF_DISARM:
check(read_val(env, &ins, 0, &a0));
upsilon_arm_waveform(a0);
break;
case CREOLE_SENDVAL:
check(read_val(env, &ins, 0, &a0));

View File

@ -53,9 +53,10 @@ enum creole_opcode {
CREOLE_CLOOP_READ = 16,
CREOLE_CLOOP_WRITE = 17,
CREOLE_WF_LOAD = 18,
CREOLE_WF_EXEC = 19,
CREOLE_WF_ARM = 19,
CREOLE_SENDVAL = 20,
CREOLE_SENDDAT = 21,
CREOLE_WF_DISARM = 22,
CREOLE_OPCODE_LEN
};

View File

@ -25,6 +25,8 @@ creole_word upsilon_control_loop_write(creole_word high_val,
creole_word code);
creole_word upsilon_load_waveform(struct creole_env *env, creole_word slot,
creole_word db);
creole_word upsilon_exec_waveform(creole_word slot, creole_word dac);
creole_word upsilon_arm_waveform(creole_word slot, creole_word dac,
creole_word wait);
creole_word upsilon_disarm_waveform(creole_word slot);
creole_word upsilon_sendval(creole_word num);
creole_word upsilon_senddat(struct creole_env *env, creole_word db);