-
Notifications
You must be signed in to change notification settings - Fork 54
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
movabs incorrect? #108
Comments
The correct way to do that is indeed to do
Yes, this does cause some confusion with AT&T style movabs, but considering that's a whole other dialect from the intel/nasm style we use here, I don't find that the biggest problem. |
Yeah i see the reasoning and agree that it is probably nicer to use the |
I understand that this would be clearer. Unfortunately with how the x64 backend works right now this would entail a pretty big rewrite of the parser/compiler. It is built towards memory references only being of the regular kind, which have a specific instruction structure, while 64-bit displacement mov is actually encoded as a single register + 64-bit immediate operand. |
Yeah i suspected as much, maybe we can add a small disclaimer in the documentation for x86 in the movabs part? |
Hi, im currently writing a jit compiler and need to load a 64 bit immediate value into a register. The only way to do this in one instruction afaik is by using the mov encoding
movabs rax, imm64
. This however currently emits code that should correspond to something likemovabs rax, [imm64]
, i.e. it tries to load from the immediate address. These encodings exist, but should be generated when writingmovabs rax, [imm64]
imho.The language spec in the documentation says:
Which should probably be
The spec in the documentation says that
mov reg64, imm64
can be used, but this results in an error (or the truncation of imm64 to a 32 bit value if you leave the type up to the compiler withas _
).I think this should be moved to
movabs reg64, imm64
.EDIT: So i misinterpreted the spec, and it actually is possible to encode movabs reg64, imm64 by providing
mov rax, QWORD immediate as _
, but i think the syntax should be corrected to align with other assembly tools.The text was updated successfully, but these errors were encountered: