flat assembler
Message board for the users of flat assembler.
Index
> Main > What this and how this using ? |
Author |
|
macomics 18 Aug 2022, 11:12
2.2.4 Addressing spaces wrote: The load directive allows to define constant with a binary value loaded from the already assembled code. This directive should be followed by the name of the constant, then optionally size operator, then from operator and a numerical expression specifying a valid address in current addressing space. Code: virtual
dd 1.0
load a byte from $$
end virtual And: 2.4.2 Portable Executable wrote: Also resource data can be generated automatically from the resource file, it can be achieved by writing the from operator and quoted file name after the resource identifier. Code: section '.rsrc' data readable resource from 'main.res' 2.4.2 Portable Executable wrote: After those settings can follow the at operator and the numerical expression specifying the base of PE image and then optionally on operator followed by the quoted string containing file name selects custom MZ stub for PE program (when specified file is not a MZ executable, it is treated as a flat binary executable file and converted into MZ format). The default code setting for this format is 32-bit. The example of fully featured PE format declaration: Code: format PE GUI 5.0 at 0x00010000 on 'stub.exe' 1.2.1 Instruction syntax wrote: When operand is a data in memory, the address of that data (also any numerical expression, but it may contain registers) should be enclosed in square brackets or preceded by ptr operator. Code: a dd 1.1 mov eax, ptr a 2.2.2 Conditional assembly wrote: With relativeto operator it is possible to check whether values of two expressions differ only by constant amount. The valid syntax is a numerical expression followed by relativeto and then another expression (possibly register-based). Labels that have no simple numerical value can be tested this way to determine what kind of operations may be possible with them. Code: virtual at ebp a dd 0, 1, 2 b dd 1.0 end virtual if a relativeto ebp end if 2.2.2 Conditional assembly wrote: The used operator followed by a symbol name, is the logical value that checks whether the given symbol is used somewhere (it returns correct result even if symbol is used only after this check). The defined operator can be followed by any expression, usually just by a single symbol name; it checks whether the given expression contains only symbols that are defined in the source and accessible from the current position. The definite operator does a similar check with restriction to symbols defined before current position in source Code: if used x
x dd 1.0
end if |
|||
18 Aug 2022, 11:12 |
|
Roman 18 Aug 2022, 15:17
What difference Used and if defined?
|
|||
18 Aug 2022, 15:17 |
|
macomics 18 Aug 2022, 16:03
Code: format binary use32 x dd 1.0 if used x display "x used", 13, 10 end if if defined x display "x defined", 13, 10 end if if definite x display "x definite", 13, 10 end if ;---------------------- if used y display "y used", 13, 10 end if if defined y display "y defined", 13, 10 end if if definite y display "y definite", 13, 10 end if y dd 5.0 mov eax, [y] ;---------------------- if used z display "z used", 13, 10 end if if defined z display "z defined", 13, 10 end if if definite z display "z definite", 13, 10 end if mov eax, [z] |
|||
18 Aug 2022, 16:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.