I know that a newcomer and hobbycoder should probably not mess with asm
statements.. but I want to =) I'm already sorry that I am mixing at&t and intel
syntax in the code below.
gcc --version
gcc (x86_64-win32-seh-rev1, Built by MinGW-W64 project) 6.3.0
nim -v
Nim Compiler Version 1.2.4 [Windows: amd64]
Compiled at 2020-06-26
Run
* **_asmNoStackFrame_**
I would expect that this function below would be naked and just does a add and
jmp call
proc test {.asmnoStackFrame.} =
asm """
add $0x1, %eax
jmp 0x004118ED
"""
Run
but debugging this function shows:
push ebp
mov ebp, esp
add eax, 01
jmp 0x004118ED
Run
Why does it modify the stack?
* **_Nim identifiers in asm_**
How to use nim identifiers? In visual cpp you can simply use variables in
inline asm but:
const myaddr = 0x123456
asm """
jmp `myaddr`
"""
Run
doesn't compiles at all. Im wondering how I could copy a register address into
a nim identifier aswell.
* **_intel syntax doesn 't works with nim identifiers_**
I really would like to use intel syntax but code compiled with
\--passC:"-masm=intel" doesn't recognizes any nim identifiers. Is there simply
no support for it?