shingarov / Pharo-ArchC

Generate binutils from formal spec
MIT License
4 stars 1 forks source link

Improve syntax for symbolic jump targets #26

Closed janvrany closed 1 year ago

janvrany commented 1 year ago

Up to now, assembler (and disassembler) allowed one to notate symbolic values by enclosing them in curly braces, for example:

bne x10, x11, {label}

This PR extends assembler (and disassembler) to allow one to omit curly braces when the name of symbolic variable is a valid (GNU) assembler label 1. The above can now can be notated like:

bne x10, x11, label

The main motivation behind this is to allow one to produce (readable) assembly source for external (GNU) assemblers.

For now omitting curly braces is only allowed for jump targets (technically for any immediate with PC-relative-like modifier). This may change in the future.