Implemented Y instruction for task loading
This commit is contained in:
@@ -248,6 +248,7 @@ enum EquiInstructions {
|
|||||||
INS_PORTIO='P',
|
INS_PORTIO='P',
|
||||||
INS_PERSIST_WRITE='}',
|
INS_PERSIST_WRITE='}',
|
||||||
INS_PERSIST_READ='{',
|
INS_PERSIST_READ='{',
|
||||||
|
INS_TASKLOAD='Y', /* run and activate a new task */
|
||||||
INS_QUIT='Q'
|
INS_QUIT='Q'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -442,6 +443,7 @@ struct EquiCtx* equi_load_task(ushort progStart, ushort len) {
|
|||||||
void equi_main_loop() {
|
void equi_main_loop() {
|
||||||
uchar instr;
|
uchar instr;
|
||||||
ushort lhash, pbuf, pbuf2;
|
ushort lhash, pbuf, pbuf2;
|
||||||
|
struct EquiCtx *newtaskptr;
|
||||||
/* try to open the persistent sandbox file */
|
/* try to open the persistent sandbox file */
|
||||||
FILE *pfd = fopen(PERSIST_FILE, "r+b");
|
FILE *pfd = fopen(PERSIST_FILE, "r+b");
|
||||||
while(1) { /* iterate over the instructions in the command buffer */
|
while(1) { /* iterate over the instructions in the command buffer */
|
||||||
@@ -656,6 +658,10 @@ void equi_main_loop() {
|
|||||||
case INS_PERSIST_WRITE: /* ( blk len maddr -- status) */
|
case INS_PERSIST_WRITE: /* ( blk len maddr -- status) */
|
||||||
pushMain(persistOp(pfd, popMain(), popMain(), popMain(), 1));
|
pushMain(persistOp(pfd, popMain(), popMain(), popMain(), 1));
|
||||||
break;
|
break;
|
||||||
|
case INS_TASKLOAD: /* ( len addr -- ) */
|
||||||
|
newtaskptr = equi_load_task(popMain(), popMain());
|
||||||
|
newtaskptr->active = 1;
|
||||||
|
break;
|
||||||
default: /* all characters not processed before are invalid instructions */
|
default: /* all characters not processed before are invalid instructions */
|
||||||
trapout(INVALID_INSTRUCTION);
|
trapout(INVALID_INSTRUCTION);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user