Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hext Language Documentation #8

Open
gennyble opened this issue Jul 8, 2021 · 0 comments
Open

Hext Language Documentation #8

gennyble opened this issue Jul 8, 2021 · 0 comments

Comments

@gennyble
Copy link
Owner

gennyble commented Jul 8, 2021

A nice way to say:

The first line that isn't a comment of blank, must be the file header. The header is structured as such:

~<property> <property> ...

You must specify your endianess and bit order. You can set those with little-endian, big-endian, msb0, lsb0. You can specify the endianess before the bit-order, or the other way round.

Hex is the default and must appear in octets. FF is valid, but FFA is not. You can group this all as one, FFOA, or spread it out, FF OA.

Binary is prefixed by a period, like so (ascii A), ..01000001. It can also be spread out .0100 .0010. By default you must have your binary be octets. You cannot, for example, have .0100 F, that's not allowed. You can put padbits in the header to pad out any octets you do not fill. It will pad according to your bitness property.

Decimal is prefixed with an =. You can precede the equals with an integer type and size, i for signed and u for unsigned. Integers can be 8, 16, 32, or 64 bits wide. If you do not specify a width you may not use i or u to specify the type, signed or unsigned. In that case, you'd just prefix all your signed integers with their sign (even the positives). The smallest integer for the decimal value you specified will be chosen. For example, in little-endian, =255 would output FF and =513 would be 01 02. If you write u16=255 you would get FF 00

Signed numbers are currently stored as two's compliment only. In the future you'll be able to specify the kind of negative you want in the header. Available options are:
ones-compliment, twos-compliment, sign-magnitude

@gennyble gennyble mentioned this issue Jul 8, 2021
5 tasks
@gennyble gennyble added this to the Version 1 Release milestone Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant