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

Various improvements to DSL #45

Merged
merged 7 commits into from
Sep 4, 2024

Conversation

janvrany
Copy link
Collaborator

@janvrany janvrany commented Sep 4, 2024

Here's another bunch of minor improvements to ArchC-DSL that accumulated when working on relocations but not really specific to them.

This commit moves `asAcDSLOperandList` up to `Object` to make automagic
conversion of values working for one-operand instructions too.
This method has to `#asAcDSLOperand` to make sure elements are DSL
operands!
`String >> #asAcDSLOperandList` has to return an operand list with single
element of `AcDSLSymbol` - this is to make strings usable as symbols when
generating for example labels:

    asm
        label:'func';
        ...

To do so we have to override (inherited) implementation from
`SequenceableCollection`.
This commit move `cursor` (an index into instruction sequence marking
where generates instructions are going to be inserted) from code buffer
to (DSL) assembler.

This seems to make sense as the code buffer is (now) merely a container
for instructions. This will become more apparent later when we extend
code buffer into more simplified object file-like structure.
The latter - `AcDSLCodeObject` - seems to be a better name of what this
really is (or will become in subsequent commit) as it's more like an
"object file" (or "object code") than mere memory buffer containing
instructions. It has base address, (will) contains relocations, debug
info and what not so...
@shingarov shingarov merged commit 69e88ab into shingarov:pure-z3 Sep 4, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants