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

what does asm.NewBuilder("amd64", 64).Assemble() do? #5

Open
kant777 opened this issue Jun 30, 2024 · 1 comment
Open

what does asm.NewBuilder("amd64", 64).Assemble() do? #5

kant777 opened this issue Jun 30, 2024 · 1 comment

Comments

@kant777
Copy link

kant777 commented Jun 30, 2024

what does asm.NewBuilder("amd64", 64).Assemble() do? Does it compile down to machine code? if not, how do I compile the assemble code generated by this library into machine code programatically?

@twitchyliquid64
Copy link
Owner

This library doesn't generate assembly code, it generates machine code from series of calls like b.AddInstruction(...), where each call to AddInstruction is an assembly instruction.

asm.NewBuilder("amd64", 64).Assemble() specifically generates nothing as you did not call any methods on the builder to add instructions for it to emit.

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

2 participants