Giter Site home page Giter Site logo

Comments (3)

TheThirdOne avatar TheThirdOne commented on June 1, 2024

I cannot reproduce this error. I used the code:

li a7, 10
ecall

Please share a short program that shows this bug for you.

from rars.

zhijieshi avatar zhijieshi commented on June 1, 2024

OS: Windows 11.
Java version:

java 17.0.1 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

Assume a file e.s has the following code.


        .data
msg:    .asciz  "Hello, world!\n"

        .text
main:
        lui     a0, 0x10010     # a0 = the address of msg. hard-coded
        addi    a7, zero, 4     # a7 = 4, the system call number for printing a string
        ecall                   # system call

        # system call 10: exit with code 0
        addi    a7, zero, 10    # a7 = 10
        ecall                   # system call

Here is the command and the output, using RARS 1.5.

java -jar .\rars1_5.jar e.s a0 a7 
RARS 1.5  Copyright 2003-2019 Pete Sanderson and Kenneth Vollmar

Hello, world!

Program terminated by calling exit
a0      0x10010000
a7      0x0000000a

Here is the command and the output when RARS 1.6 is used. The values of a0 and a7 are not printed. The line "Program terminated by calling exit" is also different.

java -jar .\rars1_6.jar e.s a0 a7
RARS 1.6  Copyright 2003-2019 Pete Sanderson and Kenneth Vollmar

Hello, world!

Here is the command and the output when me option is used with RARS 1.6.

java -jar .\rars1_6.jar e.s a0 a7 me
RARS 1.6  Copyright 2003-2019 Pete Sanderson and Kenneth Vollmar

Hello, world!

Program terminated by calling exit
a0      0x10010000
a7      0x0000000a

from rars.

kpiche avatar kpiche commented on June 1, 2024

Noticed that RARS doesn't output registers if your program prints anything:

$ cat reg1.asm 
.text
        li      a1, 0x1234
        li      a0, 65          # printchar A
        addi    a7, zero, 11
        ecall
$
$ rars a1 reg1.asm
RARS 1.6  Copyright 2003-2019 Pete Sanderson and Kenneth Vollmar

A$ 

With no printchar call:

$ cat reg2.asm 
# rars nc a1 reg2.asm
.text
        li      a1, 0x1234
$ 
$ rars a1 reg2.asm
RARS 1.6  Copyright 2003-2019 Pete Sanderson and Kenneth Vollmar


Program terminated by dropping off the bottom.
a1      0x00001234
$ 

from rars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.