flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
ProphetOfDoom 11 Jul 2011, 03:30
Hi, why does this code assemble:
Code: format ELF64 section '.text' executable add rax, 0x7fffffff ret But this code doesn't: Code: format ELF64 section '.text' executable add rax, 0x80000000 ret It seems it won't allow any immediate value which has the sign bit set? But why? I read this here http://www.x86-64.org/documentation/assembly.html Quote:
But I still don't understand why? Could someone explain please. Thanks in advance. |
|||
![]() |
|
ProphetOfDoom 11 Jul 2011, 04:23
Thanks revolution, I think I get it now.
![]() |
|||
![]() |
|
Madis731 11 Jul 2011, 07:48
When I didn't understand it, I made a graph on paper to visualize it.
It looked something like: xxxx...............................yyyy where xxxx are positive (32-bit) integers and yyyy are negative. You cannot encode values that are too large or too small. So about -4 billion to +4 billion are okay, but others values should be MOVed to register first or read from memory. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.