Hades is an Assembly mimic intended to target the Gaia Bytecode.
Hades is a programming language built for easier development within the Chronos VM x32 Computer Simulator
- Download the newest release of the
Hades-Language.jarfile (check the Github release page)
- Alternatively, you can build from source using:
bash -c 'javac -d ./src/classFiles ./src/**/*.java' && jar cvfm ./bin/HadesLanguage.jar ./src/manifest.txt -C ./src/classFiles .
- Put the
.jarand the.batfile in the same folder as where you want to put your files - Write your Hades program
For Linux Systems: - Run the
hadesfile using the./hades -[flags] [file]format
- Use
-fcflag to compile the given file to Gaia - Use
-frflag to run the given file - Use
-fceflag to compile a Chronos VM formatted Hades file to relevant Gaia
For Windows Systems:
- Run the bat script using the
./hades.bat -[flags] [file]format
- Use
-fcflag to compile the given file to Gaia - Use
-frflag to run the given file - Use
-fceflag to compile a Chronos VM formatted Hades file to relevant Gaia
- Profit
- v1.0.0: Get the damn thing working
- v1.1.0: Add new instructions for label manipulation
- Add
Handsingle-cell label registerHOLD [label]andDROPinstructions for adding/removing labels from theHandMLB [num],MLP,SLB [num],SLVheld label manipulation instructions
WDD [num0 num1 num2 ... numN]for writing large amounts of data at once to theTapeDS [num0 num1 num2 ... numN] [alias]for referencing a large portion of data, such as strings, can be written to Tape usingWDDinstructionFUNC [alias] [ body ](QoL change),CDP [file] [alias]will still existOUTN,OUTV [num], andOUTR [startPos endPos]for different I/O choices.OUTV [num]outputs the character related to the given number,OUTNoutputs the raw number atTape[Pointer], andOUTR [startPos endPos]outputs a range of the Tape.INVandINSfor more I/O choices.INVfor taking in a raw number,INSfor taking in a string (that will then be split into characters and converted into integers and stored)FSOandFSCfor opening file streams for reading in/writing out file contents,FSOtakes in a file path, and 0 or 1 for read or write mode.FSCcloses a file stream connected to the given file pathRFFandWTFto read/write from/to a file,RFFtakes in a string and a destination address,RFFreads in the character at an index and stores it in the destination address,WTFwrites the given value to the given file at the given index (WTF/RFF [file] [index value/dist])SWMto set the write mode, 0 indicates writing a character, 1 indicates writing the raw integer value- String literals
"...", these can be used as input for theDSinstruction and theWDDinstruction, as well as any instruction that takes in a file path ADD [num num],SUB [num num],MUL [num num],DIV [num num],MOD [num num], basic integer arithmetic instructions
- Add
- v1.2.0: Add ability to use labels in place of numbers in all instructions that can take in a number
- v1.3.0: Update documentation, improve current debug messages (using BlueGummi's pretty print tooling), add CLI for debugging, add sandbox CLI for testing small programs
- v2.0.0: Add
packagesystem which adds new systems for defining types, defining instructions, defining instruction arguments, and defining instruction behaviors using a mix of Java and Hades- Add new file type:
*.pkg.hds - Add new instructions
DPKG [package],UPKG [package],INST [instruction name] [args] [args],TYPE [type name] [body]
- Add new file type:
Say "Hello" in Hades:
WDD ["Hello, World!"]
OUTR[0 12]
HLTAddition in Hades:
WRT [1] ; write 1 to Tape ;
INCP ; move ptr to the right
WRT [2] ; write 2 to Tape ;
LOOP [ ; start a loop ;
DECP ; move ptr to the left ;
RDV ; read value from Tape ;
INCV ; increment ptr value ;
WTV ; write ptr value to Tape ;
INCP ; move ptr to the right ;
RDV ; read value from Tape ;
DECV ; decrement ptr value ;
WTV ; write ptr value to Tape ;
]
DECP ; move ptr to the left ;
RDV ; read value from Tape ;
; end program ;
HLTUsing labels in Hades:
CLB [foo] ; create label called "foo" ;
MOV [5] ; move ptr to position 5 of Tape ;
CLB [bar] ; create label called "bar" ;
JLB [foo] ; jump to foo label ;
WRT [1] ; write 1 to foo ;
JLB [bar] ; jump back to bar label ;
WRT [2] ; write 2 to bar ;
DLB [foo] ; delete foo label ;
DLB [bar] ; delete bar label ;
; end program ;
HLTUsing functions in Hades:
CDP [someFile.Gaia] [foo] ; create function from file "someFile.Gaia" and call it "foo" ;
CDP [0 0] [baz] ; create function from position in ROM, follows [X Y] format (Chronos VM branch only) ;
FUNC [bar] [ ; create a function in current program called "bar" ;
; something here ;
]
CALL [foo] ; run "foo" function ;
CALL [baz] ; run "baz" function ;
CALL [bar] ; run "bar" function ;
; end program ;
HLTUsing Syscalls in Hades (Chronos VM only):
; syscalls always need 5 parameters, they can be labels or numbers ;
SYS [14 0 0 0 0] ; print to terminal syscall ;
CLB [print]
WRT [14]
SYS [print 0 0 0 0] ; print to terminal syscall but using label called "print" ;
; check the Chronos VM x32 syscall documentation for help on the syscall arguments ;
; end program ;
HLT