You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comments start with ; and end at the end of the line.
; this is a comment
Byte
A byte is encoded as a sequence of two nibbles, where a nibble is 0-9, A-F, a-f.
05 0a 0f 14 ; four bytes with decimal values 5, 10, 15, 20
The nibbles that encode a byte must be immediately adjacent to each other.
0 0 ; error
Nibbles from different bytes must not be immediately adjacent to each other.
This is to make sure there's no confusion about big/little endian byte order.
0000 ; error
The output of the program simply the sequence of bytes encoded by these nibble sequences.
Offset Directive
An offset directive is optional and simply asserts the byte offset of the output at the current position in the input file.
An offset directive starts with :0x, followed by 1 or more nibbles, and terminated by the first non-nibble character.
:0x00 ; offset starts at 0
68 65 6c 6c 6f 20 77 6f 72 6c 64 0a ; the text "hello world\n"
:0x0c ; we've encountered 12 bytes so far
:0x0d ; this is an error; we're still at offset 12
Other fun stuff maybe
TODO: add support for cool stuff like utf8"foo" and u32le decimal literals.
See Also
This project produces hexdumps in the format consumed by this project: