Skip to content

gtrxAC/gxarch

Repository files navigation

gxarch gxarch is a simple fantasy console architecture and assembly language, powered by raylib.

Features

Example

; 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

Building

  • 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.
  1. 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.
  2. 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.

Desktop

  1. Run ./setup.sh to install raylib.
  2. Run ./build.sh to compile the project.

Web

  1. Run TARGET=Web ./setup.sh to install raylib.
  2. Run TARGET=Web ./build.sh to compile the project.

Windows (cross compile)

  1. Install mingw-w64 using your package manager.
  2. Run TARGET=Windows_NT ./setup.sh to install raylib.
  3. Run TARGET=Windows_NT ./build.sh to compile the project.

Assembler

  1. Run ./build_asm.sh.
  2. Run ./gxasm program.gxs to assemble a program. On Windows, use gxasm.exe program.gxs.
  • Replace program.gxs with the assembly file's name. Try it on the examples: examples/hello.gxs.
  1. The output file is generated in the same directory as the gxs file.
  2. You can specify -r at the end of the command to also automatically run the file. ./gxasm examples/hello.gxs -r or gxasm.exe examples/hello.gxs -r

Making your own programs

Documentation is still work in progress, but if you want to make your own programs, check the wiki for some resources.

About

Simple fantasy computer architecture

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published