NASM Forum > Other Discussion

use of this code ?

(1/1)

JohnG:
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

Frank Kotler:
What does Nasm say? I don't think:

--- Code: ---cmp imm, imm

--- End code ---
is valid.

Best,
Frank


Deskman243:

--- Quote ---cmp  0x7fffffe1, 7
jb  address

--- End quote ---

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.

fredericopissarra:

--- Quote from: Frank Kotler on April 14, 2023, 10:41:53 PM ---What does Nasm say? I don't think:

--- Code: ---cmp imm, imm

--- End code ---
is valid.

--- End quote ---
Huh? I believe it is not valid... Here, from Intel's SDM:

Deskman243:
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.

Navigation

[0] Message Index

Go to full version