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

Compilation Hints #4

Closed
gennyble opened this issue Sep 4, 2020 · 5 comments
Closed

Compilation Hints #4

gennyble opened this issue Sep 4, 2020 · 5 comments

Comments

@gennyble
Copy link
Owner

gennyble commented Sep 4, 2020

When going form hext to binary, there are some things that are too important to leave as command line flags. Stuff like the bitness (#3) and maybe even, if it's implemented, the checksum location (#2).

Here's how I think it should be done here. Not many hints, and they should be short. Here are all the ones I can think might be needed:

~padding msb
~padding lsb
~padding off
~checksum from 0x00 to 0x10 at 0x20
~checksum from 0x00 to 0x10 replace ZZ

Where ~padding off is the default value.

@gennyble
Copy link
Owner Author

There are multiple different kinds of checksum. In TCP alone you have two different types fro IPv4 and IPv6. What is a good syntax to select between them?

~checksum [type] from 0x00 to 0x20 at 0x08

I don't think the replace syntax is necessarily a good idea. Not every check is 16-bits like TCP/IP.

@gennyble
Copy link
Owner Author

gennyble commented Feb 2, 2021

I've thought about this for far too long, and I've come to a conclusion.

The goal of hext is to define binary files in an easily editable way while also remaining consistent across different machines. So things as important to the file as the bit order should be defined with one of these so-called compilation hints.

@gennyble
Copy link
Owner Author

gennyble commented Jul 7, 2021

New plan. Here are the headers, required by every hxt file, being implemented:

Every file is required to have a bit ordering identifier and a byte ordering identifier. It'll be at the top of the file, the first line, after a tilda. You may specify them in either order. The valid keywords are: msbyte, lsbyte, msbit, lsbit. They can be used as such:

~msbyte lsbit

The byte ordering is currently only used for multi-byte characters in string literals.

You may then turn padding on and it will use the bit ordering you specified. It MUST appear directly after the header and would look like this:

~pad bits

@gennyble
Copy link
Owner Author

gennyble commented Jul 7, 2021

Change-Of-New Plan:
The head is a single line and may include any properties, but you MUST specify a bit and byte order, and they may ONLY appear ONCE. So this is valid

~lsbit msbye padbits

but this is not:

~lsbit msbyte msbit padbits

@gennyble
Copy link
Owner Author

gennyble commented Jul 8, 2021

closed in 767b44a

@gennyble gennyble closed this as completed 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