diff options
Diffstat (limited to 'sample/toyvm.cpp')
-rw-r--r-- | sample/toyvm.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sample/toyvm.cpp b/sample/toyvm.cpp index 1e558ff..dff0cb7 100644 --- a/sample/toyvm.cpp +++ b/sample/toyvm.cpp @@ -5,8 +5,8 @@ mem_ 4byte x 65536 - ���٤Ƥ�̿���4byte���� - ¨�ͤ�����16bit + all instructions are fixed at 4 bytes. + all immediate values are 16-bit. R = A or B vldiR, imm ; R = imm @@ -109,7 +109,7 @@ public: reg[r] -= imm; break; case PUT: - printf("%c %8d(0x%08x)\n", 'A' + r, reg[r], reg[r]); + printf("%c %8u(0x%08x)\n", 'A' + r, reg[r], reg[r]); break; case JNZ: if (reg[r] != 0) pc += static_cast<signed short>(imm); @@ -294,7 +294,7 @@ lp: p = t; n--; if (n != 0) goto lp; - printf("c=%d(0x%08x)\n", c, c); + printf("c=%u(0x%08x)\n", c, c); } int main() |