flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 14 Dec 2017, 13:11
It will work with EQU:
Code: Arg1 equ ebp+8 Arg2 equ Arg1+4 Arg3 equ Arg2+4 |
|||
![]() |
|
Tomasz Grysztar 14 Dec 2017, 13:31
revolution wrote: But you might want to add brackets to ensure you get what you want because they are textual equates. Code: label Arg1 at ebp+8 label Arg2 at Arg1+4 label Arg3 at Arg2+4 Alternatively, if you needed preprocessor's variables in order to be able to re-define them, they can be used to be just "links" to actual assembly-time symbols: Code: struc redefinable value { local a label a at value . equ a } Arg1 redefinable ebp+8 Arg2 redefinable Arg1+4 Arg3 redefinable Arg2+4 |
|||
![]() |
|
Ben321 14 Dec 2017, 20:37
Tomasz Grysztar wrote:
Pretty sure that won't work. A label is used to define a fixed value, a numerical constant. A function argument is based on ebp, which is a register (its value is only known at runtime, not at compile time), and thus is not a numerical constant. Using a label would work as a numerical constant, while what I need is a string constant, so that when it is compiled it converts that string constant into the literal string I want in the pre-process stage, and then the string I want gets assembled correctly in the assembly stage. |
|||
![]() |
|
Tomasz Grysztar 14 Dec 2017, 20:50
Ben321 wrote: Pretty sure that won't work. A label is used to define a fixed value, a numerical constant. A function argument is based on ebp, which is a register (its value is only known at runtime, not at compile time), and thus is not a numerical constant. Using a label would work as a numerical constant, while what I need is a string constant, so that when it is compiled it converts that string constant into the literal string I want in the pre-process stage, and then the string I want gets assembled correctly in the assembly stage. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.