Hex0
Jump to navigation
Jump to search
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
hex0
Hex0 is trivial to implement [1] It just needs to read 2 hex nybbles and output a byte, you can ignore all non-hex characters but you need to support 2 types of line comments{# and ;}
; This is a line comment # So it is ;; And this ## And this ;; but to be polite please don't mix in non-hex characters in the hex stream, ## it doesn't make you clever, it just makes your code harder to read # Done 48 c7 c7 00 00 00 00 # mov $0x0,%rdi 48 c7 c0 3c 00 00 00 # mov $0x3c,%rax 0f 05 # syscall
Example of .hex0 code from hex0 This maps out an ELF file for Linux which implements a compiler for hex0 (!).
A reduced subset of hex0 is called boot0 and lacks support for line comments and restricts input to only numbers, upper case A-F, space and the enter key; as it expects humans to be entering input and know not to also type the comments. (All boot0 files are valid hex0 and all hex0 files being manually typed in can be converted to boot0 at enter time by the humans performing that input)