diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml
new file mode 100644
index 00000000..1c7f5c93
--- /dev/null
+++ b/.github/workflows/makefile.yml
@@ -0,0 +1,32 @@
+name: Makefile CI
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - run: sudo apt-get update && sudo apt-get install openjdk-17-jdk-headless
+ - uses: actions/checkout@v4
+ - run: git fetch origin --tags --unshallow
+ - run: git submodule update --init
+ - run: ./build-jar.sh
+ - run: ./build-jar-flatlaf.sh
+ - uses: actions/upload-artifact@v4
+ with:
+ path: '*.jar'
+ - run: ./test.sh
+ - uses: softprops/action-gh-release@v2
+ if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/test-ci'
+ with:
+ files: rars-flatlaf.jar
+ tag_name: 'lastest'
+ make_latest: true
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 00000000..383700b3
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,46 @@
+name: maven
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ maven:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'zulu'
+ cache: maven
+ - name: Build with Maven
+ run: mvn --batch-mode --update-snapshots verify site
+ - uses: actions/upload-artifact@v4
+ if: success() || failure() # always run even if the previous step fails
+ with:
+ name: maven-target-${{ matrix.os }}
+ path: target/
+ - run: mkdir staging && cp target/*.jar staging
+ - uses: actions/upload-artifact@v4
+ with:
+ name: Package-${{ matrix.os }}
+ path: staging
+
+ event_file:
+ name: "Event File"
+ runs-on: ubuntu-latest
+ steps:
+ - name: Upload
+ uses: actions/upload-artifact@v4
+ with:
+ name: Event File
+ path: ${{ github.event_path }}
diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml
new file mode 100644
index 00000000..be729611
--- /dev/null
+++ b/.github/workflows/report.yml
@@ -0,0 +1,34 @@
+name: Test Results
+on:
+ workflow_run:
+ workflows: ["maven"]
+ types:
+ - completed
+permissions: {}
+jobs:
+ test-results:
+ name: Test Results
+ runs-on: ubuntu-latest
+ if: github.event.workflow_run.conclusion != 'skipped'
+
+ permissions:
+ checks: write
+ # needed unless run with comment_mode: off
+ pull-requests: write
+ # required by download step to access artifacts API
+ actions: read
+
+ steps:
+ - name: Download and Extract Artifacts
+ uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
+ with:
+ run_id: ${{ github.event.workflow_run.id }}
+ path: artifacts
+
+ - name: Publish Test Results
+ uses: EnricoMi/publish-unit-test-result-action@v2
+ with:
+ commit: ${{ github.event.workflow_run.head_sha }}
+ event_file: artifacts/Event File/event.json
+ event_name: ${{ github.event.workflow_run.event }}
+ files: "**/TEST-*.xml"
diff --git a/.gitignore b/.gitignore
index 91399c8e..defa8290 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,13 +4,23 @@ out
# Build products
build
+tmp
+flatlaf-3.2.jar
rars.jar
+rars-flatlaf.jar
+src/Version.properties
+
+# Maven
+target/
# Eclipse project files
.classpath
.project
examples/riscv
+# Emacs
+.settings
+
# MacOS
.DS_Store
*/.DS_Store
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..c0db1310
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,60 @@
+Copyright (c) 2003-2013, Pete Sanderson and Kenneth Vollmar
+
+Developed by Pete Sanderson (psanderson@otterbein.edu)
+and Kenneth Vollmar (kenvollmar@missouristate.edu)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+(MIT license, http://www.opensource.org/licenses/mit-license.html)
+
+===
+
+Copyright (c) 2012-2015, The Regents of the University of California (Regents).
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the Regents nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
+OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
+HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+===
+
+Copyright (C) 1999 Slava Pestov
+
+You may use and modify this package for any purpose. Redistribution is
+permitted, in both source and binary form, provided that this notice
+remains intact in all source distributions of this package.
\ No newline at end of file
diff --git a/License.txt b/License.txt
deleted file mode 100644
index 121fd7b7..00000000
--- a/License.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2003-2013, Pete Sanderson and Kenneth Vollmar
-
-Developed by Pete Sanderson (psanderson@otterbein.edu)
-and Kenneth Vollmar (kenvollmar@missouristate.edu)
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject
-to the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-(MIT license, http://www.opensource.org/licenses/mit-license.html)
diff --git a/README.md b/README.md
index 911cb34c..eafccd61 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,14 @@
-RARS -- RISC-V Assembler and Runtime Simulator
-----------------------------------------------
+# RARSM -- RISC-V Assembler and Runtime Simulator (iMproved)
-RARS, the RISC-V Assembler, Simulator, and Runtime, will assemble and simulate
-the execution of RISC-V assembly language programs. Its primary goal is to be
-an effective development environment for people getting started with RISC-V.
+Fork of [RARS](https://github.com/TheThirdOne/rars) with added features (PRed updtream)
-## Features
+* https://github.com/TheThirdOne/rars/pull/190
+* https://github.com/TheThirdOne/rars/pull/191
+* https://github.com/TheThirdOne/rars/pull/192
+* https://github.com/TheThirdOne/rars/pull/193
+* https://github.com/TheThirdOne/rars/pull/194
+* https://github.com/TheThirdOne/rars/pull/195
+* https://github.com/TheThirdOne/rars/pull/196
+* https://github.com/TheThirdOne/rars/pull/197
- - RISC-V IMFDN Base (riscv32 and riscv64)
- - Several system calls that match behaviour from MARS or SPIKE.
- - Support for debugging using breakpoints and/or `ebreak`
- - Side by side comparison from pseudo-instruction to machine code with
- intermediate steps
- - Multifile assembly using either files open or a directory
-
-## Documentation
-
-Documentation for supported [instructions](https://github.com/TheThirdOne/rars/wiki/Supported-Instructions), [system calls](https://github.com/TheThirdOne/rars/wiki/Environment-Calls), [assembler directives](https://github.com/TheThirdOne/rars/wiki/Assembler-Directives) and more can be found on the [wiki](https://github.com/TheThirdOne/rars/wiki). Documentation included in the download can be accessed via the help menu.
-
-## Download
-
-RARS is distributed as an executable jar. You will need at least Java 8 to run it.
-
-The latest stable release can be found [here](https://github.com/TheThirdOne/rars/releases/latest), a release with the latest developments can be found on the [continuous release](https://github.com/TheThirdOne/rars/releases/tag/continuous), and the [releases page](https://github.com/TheThirdOne/rars/releases) contains all previous stable releases with patch notes.
-
-Alternatively, if you wish to make your own jar and/or modify the code, you
-should clone the repo with `git clone https://github.com/TheThirdOne/rars --recursive`.
-Running the script `./build-jar.sh` on a Unix system will build `rars.jar`.
-
-## Screenshot
-
-
-
-## Changes from MARS 4.5
-
-RARS was built on MARS 4.5 and owes a lot to the development of MARS; its
-important to note what are new developments and what come straight from MARS.
-Besides moving from supporting MIPS to RISC-V and the associated small changes,
-there are several general changes worth noting.
-
- - Instructions can now be hot-loaded like Tools. If you want to support an additional extension to the RISC-V instruction set. the .class files just need to be added to the right folder
- - ScreenMagnifier, MARS Bot, Intro to Tools, Scavenger Hunt, and MARS Xray were removed from the included tools. ScreenMagnifier, MARS Bot, Intro to Tools, and Scavenger Hunt were removed because they provide little benefit. And MARS Xray was removed because it is not set up to work with RISC-V, however if someone ports it, it could be merged in.
- - Removed delayed branching
- - Removed the print feature
- - Added a testing framework to verify compatibility with the RISC-V specification
- - Significant internal restructuring and refactoring.
+Unfortunately, upstream is not responsive, so we stopped doing PR as they require some unmerges ones.
diff --git a/build-jar-flatlaf.sh b/build-jar-flatlaf.sh
new file mode 100755
index 00000000..ba7ec218
--- /dev/null
+++ b/build-jar-flatlaf.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+flatlaf="flatlaf-3.2.jar"
+
+if [ ! -f "$flatlaf" ]; then
+ curl https://repo1.maven.org/maven2/com/formdev/flatlaf/3.2/flatlaf-3.2.jar -o "$flatlaf"
+fi
+
+rm -r tmp/
+mkdir -p tmp/
+cd tmp/
+
+
+jar x < ../rars.jar
+jar x < "../$flatlaf"
+
+cat > META-INF/MANIFEST.MF <RARS - RISC-V Assembler and Runtime Simulator
-Release 1.0
-August 2017
Using RARS from a command line.
Using RARS from a command line.
for potentially correct documentation
| Option | Description | Since |
|---|---|---|
| a | assemble only, do not simulate | 1.0 |
| aen | terminate RARS with integer exit code n if assembly error occurs | 4.1 |
| ascii | display memory or register contents interpreted as ASCII codes. (alternatives are dec and hex) | 4.1 |
| b | brief - do not display register/memory address along with contents | 2.2 |
| Option | Description | |
| a | assemble only, do not simulate | |
| aen | terminate RARS with integer exit code n if assembly error occurs | |
| ascii | display memory or register contents interpreted as ASCII codes. (alternatives are dec and hex) | |
| b | brief - do not display register/memory address along with contents | |
| d | display RARS debugging statements (of interest mainly to RARS developer) | |
| dec | display memory or register contents in decimal. (alternatives are ascii and hex) | 2.2 |
| dec | display memory or register contents in decimal. (alternatives are ascii and hex) | |
| dump | dump memory contents to file. Option has 3 arguments, e.g. dump <segment> <format> <file>. Current supported segments are .text -and .data. Also supports an address range (see m-n below). Current supported dump formats are Binary, HexText, BinaryText, AsciiText. See examples below. | 3.4 |
| g | force GUI mode | 1.6 |
| hex | display memory or register contents in hexadecimal - this is the default. (alternatives are ascii and dec) | 2.2 |
| h | display this help. Use this option by itself and with no filename. | 1.0 |
| ic | display instruction count; the number of basic instructions 'executed' | 4.3 |
| g | force GUI mode | |
| hex | display memory or register contents in hexadecimal - this is the default. (alternatives are ascii and dec) | |
| h | display this help. Use this option by itself and with no filename. | |
| ic | display instruction count; the number of basic instructions 'executed' | |
| mc | set memory configuration. Option has 1 argument, e.g. mc <config>. Argument <config> is case-sensitive and its possible values are Default for the default 32-bit address space, CompactDataAtZero for a 32KB address space with data segment at address 0, or CompactTextAtZero -for a 32KB address space with text segment at address 0. | 3.7 |
| me | display RARS messages to standard err instead of standard out. Allows you to separate RARS messages from program output using redirection. | 4.3 |
| nc | copyright notice will not be displayed. Useful if redirecting or piping program output. | 3.5 |
| np | pseudo-instructions or extended instruction formats are not permitted. | 3.0 |
| p | project option - will assemble the specified file and all other assembly files (*.asm; *.s) in its directory. | 3.1 |
| sen | terminate RARS with exit code n if simulate (run) error occurs | 4.1 |
| sm | start execution at statement having global label 'main' if defined | 3.8 |
| smc | Self Modifying Code - Program can write and execute in either text or data segment | 4.4 |
| we | assembler warnings will be considered errors. | 3.5 |
| np | pseudo-instructions or extended instruction formats are not permitted. | |
| p | project option - will assemble the specified file and all other assembly files (*.asm; *.s) in its directory. | |
| sen | terminate RARS with exit code n if simulate (run) error occurs | |
| sm | start execution at statement having global label 'main' if defined | |
| smc | Self Modifying Code - Program can write and execute in either text or data segment | |
| version | show copyright notice and version will not be displayed. | |
| we | assembler warnings will be considered errors. | |
| n | where n is an integer maximum count of execution steps to simulate. - If 0, negative or not specified, there is no maximum. | 1.0 |
| $reg | where reg is number or name (e.g. 5, t3, f10) of register whose content to display at end of run. Even-numbered float register displays both float and double. Option may be repeated. - NOTE: Depending on your command shell, you may need to escape the $, e.g. \$t3 | 2.2 |
| reg_name | where reg_name is the name (e.g. t3, f10) of register whose - content to display at end of run. Even-numbered float register displays both float and double. Option may be repeated. $ not required. | 2.2 |
| m-n | memory address range from m to n whose contents to display at end of run. m and n may be decimal or hexadecimal (starts with 0x), - m <= n, both must be on word boundary. Option may be repeated. | 2.2 |
| pa | program arguments - all remaining space-separated items are argument values provided to the program via $a0 (argc - argument count) and $a1 (argv - address of array containing pointers to null-terminated argument -strings). The count is also at the top of the runtime stack ($sp), followed by the array.This option and its arguments must be the last items in the command! | 3.5 |
Example: java -jar rars.jar h
@@ -97,4 +94,4 @@