News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Comparing two QWORDs

Started by NoCforMe, July 12, 2022, 01:23:39 PM

Previous topic - Next topic

NoCforMe

Another rookie question (from a non-rookie, no less):
Is this the correct way to do an unsigned comparison between two QWORD items in regular MASM (no SSE, MMX or other fancy stuff)?


Item1 LABEL QWORD
  Item1Hi DD ?
  Item1Lo DD ?

Item2 LABEL QWORD
  Item2Hi DD ?
  Item2Lo DD ?

;***** Compare the two (unsigned):  *****

; Compare the high DWORDs first:
MOV EDX, Item1Hi
CMP EDX, Item2Hi
JA bigger
JB smaller

; They're equal, so compare the low DWORDs:
MOV EAX, Item1Lo
CMP EAX, Item2Lo
JA bigger
JB smaller

;***** They're equal here ...

bigger:

smaller:
Assembly language programming should be fun. That's why I do it.

NoCforMe

OK, figured it out. The answer is yes.
Assembly language programming should be fun. That's why I do it.