flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
magicSqr
you can't compare 2 memory values, you need to place one in a register first.
Code: mov ax, [bx] cmp ax, [magic] or, since you know the value you're looking for... Code: cmp word [magic], 0x424D Quote:
Not sure what you're trying to do at the arrowed part tho ¿ You need to open the file for reading, read the first word from the file, then compare it to 0x424D. magic² |
|||
![]() |
|
Trinitek
Oh.
![]() Thanks for telling me that I had to put the value into a register first. I completely forgot about that as well. Everything seems to be in working order as of now... |
|||
![]() |
|
Madis731
and FASM also allows you to do this:
Code: cmp word[bx],"BM" ; Now there's no "magic", just constant |
|||
![]() |
|
Trinitek
Madis731 wrote: and FASM also allows you to do this: Thanks Madis, but I already figured it out. ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.