Skip to content

Feat: replaced AT&T assembly syntax with intel #17

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0x00Jeff
Copy link

you can use gcc's -masm=intel flag to avoid having to write AT&T syntax

@0x00Jeff
Copy link
Author

another trick I like is that fact that operations to the lower 32 bit portions of 64 bit registers cause the upper 32 bit to zero, so mov esi, 1 would do the same thing as mov rsi, 1, but generates shorter bytes in the bytecode

this is especially useful when zeroing registers, one can use xor esi, esi instead of mov rsi, 0 which is both faster (as xor reg, reg is recognized by the cpu as zeroing idiom) and smaller by 3 bytes, I think these are not so important but nice assembly subtleties nonetheless

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.

1 participant