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.shto install raylib. - Run
./build.shto compile the project.
- Run
TARGET=Web ./setup.shto install raylib. - Run
TARGET=Web ./build.shto compile the project.
- Install
mingw-w64using your package manager. - Run
TARGET=Windows_NT ./setup.shto install raylib. - Run
TARGET=Windows_NT ./build.shto compile the project.
- Run
./build_asm.sh. - Run
./gxasm program.gxsto assemble a program. On Windows, usegxasm.exe program.gxs.
- Replace
program.gxswith 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
-rat the end of the command to also automatically run the file../gxasm examples/hello.gxs -rorgxasm.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.