|
@@ -27,7 +27,7 @@ static void btAdd(const char* format, ...) {
|
|
static void btFillBase() {
|
|
static void btFillBase() {
|
|
buffer[0] = '\0';
|
|
buffer[0] = '\0';
|
|
bIndex = 0;
|
|
bIndex = 0;
|
|
- btAdd("| %6d | %5d |", readIndex, line);
|
|
|
|
|
|
+ btAdd("| %6d | %5d |", readIndex - 1, line);
|
|
}
|
|
}
|
|
|
|
|
|
static void btRead(void* buffer, int length) {
|
|
static void btRead(void* buffer, int length) {
|
|
@@ -64,7 +64,7 @@ static void btAddFiller() {
|
|
static void sPrintLine() {
|
|
static void sPrintLine() {
|
|
btRead(&line, 2);
|
|
btRead(&line, 2);
|
|
printf("| %6d |-------|----------------------|------------|------------|\n",
|
|
printf("| %6d |-------|----------------------|------------|------------|\n",
|
|
- readIndex);
|
|
|
|
|
|
+ readIndex - 3);
|
|
}
|
|
}
|
|
|
|
|
|
static void btPrintOp(const char* op) {
|
|
static void btPrintOp(const char* op) {
|
|
@@ -100,11 +100,11 @@ static void btPrintFloat(const char* op) {
|
|
}
|
|
}
|
|
|
|
|
|
static void btPrintString(const char* msg) {
|
|
static void btPrintString(const char* msg) {
|
|
|
|
+ btFillBase();
|
|
int length = 0;
|
|
int length = 0;
|
|
btRead(&length, sizeof(int));
|
|
btRead(&length, sizeof(int));
|
|
char* s = (char*)(code->code + readIndex);
|
|
char* s = (char*)(code->code + readIndex);
|
|
readIndex += length;
|
|
readIndex += length;
|
|
- btFillBase();
|
|
|
|
btAddOperation(msg);
|
|
btAddOperation(msg);
|
|
btAdd(" %10s |", s);
|
|
btAdd(" %10s |", s);
|
|
btAddFiller();
|
|
btAddFiller();
|
|
@@ -180,4 +180,4 @@ void btPrint(ByteCode* bt) {
|
|
while(readIndex < code->length) {
|
|
while(readIndex < code->length) {
|
|
btConsumeOperation();
|
|
btConsumeOperation();
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|