Implemented Y instruction for task loading
This commit is contained in:
@@ -426,7 +426,7 @@ struct EquiCtx* equi_find_next_task() {
|
||||
}
|
||||
|
||||
/* Task loader method */
|
||||
struct EquiCtx* equi_load_task(ushort progStart, ushort len) {
|
||||
struct EquiCtx* equi_load_task(ushort len, ushort progStart) {
|
||||
ushort tid = equi_find_free_task_slot();
|
||||
struct EquiCtx *taskptr = &ram.tasks[tid]; /* refer to the next available entry */
|
||||
taskptr->msp = taskptr->rsp = taskptr->lsp = taskptr->cltp = 0; /* init stacks and CLT */
|
||||
@@ -658,7 +658,7 @@ void equi_main_loop() {
|
||||
case INS_PERSIST_WRITE: /* ( blk len maddr -- status) */
|
||||
pushMain(persistOp(pfd, popMain(), popMain(), popMain(), 1));
|
||||
break;
|
||||
case INS_TASKLOAD: /* ( len addr -- ) */
|
||||
case INS_TASKLOAD: /* ( addr len -- ) */
|
||||
newtaskptr = equi_load_task(popMain(), popMain());
|
||||
newtaskptr->active = 1;
|
||||
break;
|
||||
@@ -743,7 +743,7 @@ int main(int argc, char* argv[]) {
|
||||
cputc(LF); /* echo LF */
|
||||
}
|
||||
ram.cmdbuf[++ram.ibp] = INS_QUIT; /* end program with INS_QUIT */
|
||||
curtask = equi_load_task((ushort)ram.cmd_start, ram.ibp + 1); /* load the code as task 0 */
|
||||
curtask = equi_load_task(ram.ibp+1, (ushort)ram.cmd_start); /* load the code as task 0 */
|
||||
ram.taskid = curtask->id; /* actualize the current task id */
|
||||
curtask->active = 1; /*activate the current task */
|
||||
equi_main_loop(); /* and run the interpreter loop */
|
||||
|
||||
Reference in New Issue
Block a user