gxarch is a simple fantasy console architecture and assembly language, powered by raylib.
- 32K ROM, 4K RAM, 4K save file
- 64 registers
- 29 instructions
- 192 × 160 screen, 16 user definable colors
- 4-channel audio powered by rFXGen
; Define program entry point
datl main
; Define the string we want to print
string: dat "Hello world!"
; Include print from the standard library
include "std/default_font.gxs"
include "std/print.gxs"
main:
; Give arguments to the print function: string address and where to draw
arg hi(string), lo(string), 0, 0
; Call the print function
call print
; Finish drawing the frame
sys SYS_END
; End the loop
jmp main
- If you don't want to build gxarch yourself, download the pre-compiled executables here. You don't need to clone the repository unless you want the examples.
- If you're on Windows, download w64devkit. Make sure you get a release zip, not the source code. Extract the archive somewhere and run
w64devkit.exe
. On Linux, just open a terminal. - Follow the below instructions for the platform you want to build for. If you want to create your own programs, you'll also need to build the assembler.
- Run
./setup.sh
to install raylib. - Run
./build.sh
to compile the project.
- Run
TARGET=Web ./setup.sh
to install raylib. - Run
TARGET=Web ./build.sh
to compile the project.
- Install
mingw-w64
using your package manager. - Run
TARGET=Windows_NT ./setup.sh
to install raylib. - Run
TARGET=Windows_NT ./build.sh
to compile the project.
- Run
./build_asm.sh
. - Run
./gxasm program.gxs
to assemble a program. On Windows, usegxasm.exe program.gxs
.
- Replace
program.gxs
with the assembly file's name. Try it on the examples:examples/hello.gxs
.
- The output file is generated in the same directory as the gxs file.
- You can specify
-r
at the end of the command to also automatically run the file../gxasm examples/hello.gxs -r
orgxasm.exe examples/hello.gxs -r
Documentation is still work in progress, but if you want to make your own programs, check the wiki for some resources.