flat assembler
Message board for the users of flat assembler.

Index > Windows > Cmp byte ptr + offset

Author
Thread Post new topic Reply to topic
[nuß]



Joined: 30 Apr 2004
Posts: 4
[nuß] 30 Apr 2004, 06:02
Hi there all,
I use these 2 following lines of code regularly in tasm and masm, but they seem to cause errors in fasm :

Code:
cmp byte ptr [esi+baseaddie],00h    

and
Code:
sub ebp,offset delta    


How can I either add these to fasm, or what code would work the same way?

Thanks in advance
J
Post 30 Apr 2004, 06:02
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Apr 2004, 06:23
1.
Code:
 cmp byte [esi+baseaddie],00h     

or
Code:
 cmp byte ptr esi + baseaddie,00h     


2.
Code:
 sub esp, delta     
Post 30 Apr 2004, 06:23
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 30 Apr 2004, 06:27
[nuß] wrote:

Code:
cmp byte ptr [esi+baseaddie],00h    

and
Code:
sub ebp,offset delta    



It will become more simple:
Code:
cmp byte [esi+baseaddie],00h    

and
Code:
sub ebp, delta    


The rule is simple in FASM:
If you want address (actually the value of the label) you write the label name. If you want the value of the memory, you enclose the address of that memory in brackets.

Regards.
Post 30 Apr 2004, 06:27
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.