draperlaboratory / VIBES

Verified, Incremental, Binary Editing with Synthesis
MIT License
51 stars 1 forks source link

Concrete C syntax for loading 16 bits #98

Closed codyroux closed 3 years ago

codyroux commented 3 years ago

Similar issue to #93 : we need a syntax that will load an unsigned 16 bit word from memory.

In general we can do what any good C compiler would do and perform loads based on the type of the pointer, but for now we don't really handle types in any nice way (and it'll be a bit).

In the meantime we probably want a stopgap. One idea is to treat loads followed by immediate casts, e.g.

(int16_t) *foo

or maybe the opposite:

* (int16_t *) foo

as a load of exactly 16 bits, and more generally support built-in types of the form intXX_t or uintXX_t.

codyroux commented 3 years ago

Implemented the second one, which seems more "C like".

codyroux commented 3 years ago

Closing for now, we'll re-open if more debate is needed.