NASM - The Netwide Assembler
NASM Forum => Other Discussion => Topic started by: JohnG on April 14, 2023, 06:05:11 AM
-
Hi all,
Can you tell me if I am missing something with this code. I do not fully understand it, besides its a compare and jmp if below.
cmp 0x7fffffe1, 7
jb address
John
-
What does Nasm say? I don't think:
cmp imm, imm
is valid.
Best,
Frank
-
cmp 0x7fffffe1, 7
jb address
On inspection one could state that if the test value is a static variable it could be passed as a regular value where you would have to refer to the original source. Many times programmers use binary values for segmentation. This also counts as pass by reference I believe as a typical computer science concept. In particular that number in binary is just a sequence of 1's besides e 1. The actual number should look like this 0111 1111 1111 1111 1111 1111 1110 0001. If you would like more of a review you can post the source code as a reference.
-
What does Nasm say? I don't think:
cmp imm, imm
is valid.
Huh? I believe it is not valid... Here, from Intel's SDM:
(https://i.postimg.cc/nhh85mqy/cmp.png)
-
Good job guys who else would still get stuck on the basics haha. Like I had to check again because of how long I have been researching the same BIOS that I gotta realize data types are still a thing.