diff --git a/emul.exe.stackdump b/emul.exe.stackdump new file mode 100644 index 0000000..605ba5d --- /dev/null +++ b/emul.exe.stackdump @@ -0,0 +1,23 @@ +Exception: STATUS_ACCESS_VIOLATION at rip=001801A4281 +rax=0000000184429320 rbx=8080808080808080 rcx=FEFEFEFF0F000003 +rdx=00000000FFFFC981 rsi=FEFEFEFEFEFEFEFF rdi=00000000FFFFCDF0 +r8 =0000000184429321 r9 =000000000000004C r10=FEFEFEFEFF0F0000 +r11=FEFEFEFEFF4F4E4E r12=0000000000000000 r13=0000000000000000 +r14=0000000000000000 r15=0000000000000000 +rbp=00000000FFFFC900 rsp=00000000FFFFC8C8 +program=C:\cygwin64\home\takayun\dev\emul\emul.exe, pid 3840, thread main +cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B +Stack trace: +Frame Function Args +000FFFFC900 001801A4281 (003FECFD45B, 000FFFFC930, 00100402720, 000FFFFC930) +000FFFFC900 00100402CEB (00000000016, 00000000008, 00000000004, 000FFFFCA10) +000FFFFC930 00100401E57 (00000000016, 000FFFFCAB0, 00000000001, 00180347688) +000FFFFCA10 00100402020 (0000000003A, 0010042904C, 00000000000, 00600038550) +000FFFFCB10 0010040211C (00000000016, 00100409AAC, 00000000000, 00100000040) +000FFFFCB50 00100402484 (00000000015, 00100429041, 00000000000, 4C204C4542414C3A) +000FFFFCBD0 00100403220 (00000000039, 00000000000, 2F656D6F682F3D5F, 00000000000) +000FFFFCC10 0010040118B (000FFFFCC60, 300010F0100FF00, 00180047B61, 000FFFFD680) +000FFFFCCC0 00180047BD2 (00000000000, 00000000000, 00000000000, 00000000000) +00000000000 0018004591C (00000000000, 00000000000, 00000000000, 00000000000) +000FFFFFFF0 001800459B4 (00000000000, 00000000000, 00000000000, 00000000000) +End of stack trace diff --git a/emul_inst_exec.c b/emul_inst_exec.c index 79312bf..2f2d103 100644 --- a/emul_inst_exec.c +++ b/emul_inst_exec.c @@ -473,12 +473,12 @@ break; case LW : temp_op[0] = emul_inst_dec_get_next_operand(); - temp_op[1] = emul_inst_dec_get_next_operand(); + temp_op[1] = emul_inst_dec_get_next_immediate(); emul_inst_exec_lw(temp_op[0], temp_op[1]); break; case SW : temp_op[0] = emul_inst_dec_get_next_operand(); - temp_op[1] = emul_inst_dec_get_next_operand(); + temp_op[1] = emul_inst_dec_get_next_immediate(); emul_inst_exec_sw(temp_op[0], temp_op[1]); break; //case MOVE: diff --git a/test_asm/char_output.asm b/test_asm/char_output.asm new file mode 100644 index 0000000..b599388 --- /dev/null +++ b/test_asm/char_output.asm @@ -0,0 +1,11 @@ +addi $s1 $zero 65 +addi $s2 $zero 90 + +:CRLF +:LABEL LOOP +addi $s1 $s1 1 +:OUTPUT $s1 + +bne $s2 $s1 LOOP +:INPUT $t0 +:EXIT diff --git a/test_asm/input_loop.asm b/test_asm/input_loop.asm index 3060370..b6e8a83 100644 --- a/test_asm/input_loop.asm +++ b/test_asm/input_loop.asm @@ -1,7 +1,7 @@ :DUMP DEBUG0 :RUN -addi $s0 $zero 33 +addi $s0 $zero 27 :LABEL LOOP :INPUT $s1