string index
This commit is contained in:
parent
e5c0460dc9
commit
7347582bfe
1 changed files with 6 additions and 6 deletions
12
c4.c
12
c4.c
|
|
@ -54,9 +54,9 @@ next()
|
|||
printf("%d: %.*s", line, p - lp, lp);
|
||||
lp = p;
|
||||
while (le < e) {
|
||||
printf("%8.4s", "LEA ,IMM ,JMP ,JSR ,BZ ,BNZ ,ENT ,ADJ ,LEV ,LI ,LC ,SI ,SC ,PSH ,"
|
||||
"OR ,XOR ,AND ,EQ ,NE ,LT ,GT ,LE ,GE ,SHL ,SHR ,ADD ,SUB ,MUL ,DIV ,MOD ,"
|
||||
"OPEN,READ,CLOS,PRTF,MALC,MSET,MCMP,EXIT," + *++le * 5);
|
||||
printf("%8.4s", &"LEA ,IMM ,JMP ,JSR ,BZ ,BNZ ,ENT ,ADJ ,LEV ,LI ,LC ,SI ,SC ,PSH ,"
|
||||
"OR ,XOR ,AND ,EQ ,NE ,LT ,GT ,LE ,GE ,SHL ,SHR ,ADD ,SUB ,MUL ,DIV ,MOD ,"
|
||||
"OPEN,READ,CLOS,PRTF,MALC,MSET,MCMP,EXIT,"[*++le * 5]);
|
||||
if (*le <= ADJ) printf(" %d\n", *++le); else printf("\n");
|
||||
}
|
||||
}
|
||||
|
|
@ -451,9 +451,9 @@ main(int argc, char **argv)
|
|||
i = *pc++; ++cycle;
|
||||
if (debug) {
|
||||
printf("%d> %.4s", cycle,
|
||||
"LEA ,IMM ,JMP ,JSR ,BZ ,BNZ ,ENT ,ADJ ,LEV ,LI ,LC ,SI ,SC ,PSH ,"
|
||||
"OR ,XOR ,AND ,EQ ,NE ,LT ,GT ,LE ,GE ,SHL ,SHR ,ADD ,SUB ,MUL ,DIV ,MOD ,"
|
||||
"OPEN,READ,CLOS,PRTF,MALC,MSET,MCMP,EXIT," + i * 5);
|
||||
&"LEA ,IMM ,JMP ,JSR ,BZ ,BNZ ,ENT ,ADJ ,LEV ,LI ,LC ,SI ,SC ,PSH ,"
|
||||
"OR ,XOR ,AND ,EQ ,NE ,LT ,GT ,LE ,GE ,SHL ,SHR ,ADD ,SUB ,MUL ,DIV ,MOD ,"
|
||||
"OPEN,READ,CLOS,PRTF,MALC,MSET,MCMP,EXIT,"[i * 5]);
|
||||
if (i <= ADJ) printf(" %d\n", *pc); else printf("\n");
|
||||
}
|
||||
if (i == LEA) a = (int)(bp + *pc++); // load local address
|
||||
|
|
|
|||
Loading…
Reference in a new issue