moizumi99 / m99_riscv_emulator

Simple RISC-V emulator
Other
16 stars 1 forks source link

Formatting issue with printf #2

Closed yuppox closed 4 years ago

yuppox commented 4 years ago

Hello,

There seems to be an issue with printf formatting properties. I compiled a test program using the xPack gcc binaries:

#include "stdio.h"

int main()
{
    int x;

    for(x=0; x<30; x++)
        printf("%d ", x);

    printf("\n");

    return 0;
}

The output on qemu:

$ ./riscv32-linux-user/qemu-riscv32 ./test
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

The output from m99_riscv_emulator:

Execution start
0 1 2 3 4 5 6 7 8 9 1  1  1  1  1  1  1  1  1  1  2  2  2  2  2  2  2  2  2  2
Return value: 0.
yuppox commented 4 years ago

Fixed in my pull request.