flat assembler
Message board for the users of flat assembler.

Index > Main > differences between = and equ?

Author
Thread Post new topic Reply to topic
ntos



Joined: 06 Jul 2023
Posts: 18
ntos 01 Aug 2023, 02:26
Hi,
A = 60
B equ 60

Any difference if A and B are defined like this?
Thank you.
Post 01 Aug 2023, 02:26
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 01 Aug 2023, 02:28
They are very different.

equ is a textual replacement. Processed by the preprocessor.

= is a numeric variable. Processed by the assembler stage.
Code:
a equ 2*
b = a 3
display b + '0'    
Post 01 Aug 2023, 02:28
View user's profile Send private message Visit poster's website Reply with quote
ntos



Joined: 06 Jul 2023
Posts: 18
ntos 01 Aug 2023, 02:50
I mean If we are defining syscalls for a linux app for example, = or equ are no difference, arent they?
sys_write = 1
sys_exit equ 60
Post 01 Aug 2023, 02:50
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 01 Aug 2023, 02:53
You can't forward reference equ
Code:
mov eax,sys_exit  ; <-- error: undefined symbol 'sys_exit'.
sys_exit equ 60    
Post 01 Aug 2023, 02:53
View user's profile Send private message Visit poster's website Reply with quote
ntos



Joined: 06 Jul 2023
Posts: 18
ntos 01 Aug 2023, 04:05
Thank you. It is clear now.
Post 01 Aug 2023, 04:05
View user's profile Send private message 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.