flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > macro get me error Code cannot be generated !

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1279
Roman 01 Jul 2022, 11:42
Compiler setup memory 924288000 kb
Code:
;64 bits program
macro _push reg {
  if ~defined __tmpReg_#reg
     jmp @f
     __tmpReg_#reg dq 0
     @@:
  end if
mov [__tmpReg_#reg],reg }

;in code
  _push rax

    

Fasmw 1.73 error Code cannot be generated !

if ~defined display __tmpReg_ but not display __tmpReg_#reg
if not see __tmpReg_#reg


Last edited by Roman on 01 Jul 2022, 13:28; edited 3 times in total
Post 01 Jul 2022, 11:42
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1279
Roman 01 Jul 2022, 11:46
my full list code.
Code:
format PE64 GUI 5.0 on 'nul'
entry Start
 include 'c:\fasmw17316\include\win64ax.inc'

 macro _push reg {
  if ~defined __tmpReg_#reg
     jmp @f
     __tmpReg_#reg dq 0
     @@:
  end if
mov [__tmpReg_#reg],reg }


SECTION '.data' DATA READABLE WRITEABLE executable
                tflt          dd 2 dup (1.0,2)
               
section '.code' code readable writeable executable

Start:          sub     rsp,8
                ;match ff,x=Color, z { display `ff,13,10 }
                _push rax
       ; invoke MessageBox,0,'11',0,0

                ;Msg ff
                invoke    ExitProcess,0  
SECTION '.idata' IMPORT DATA READABLE WRITEABLE

     library  kernel32, 'KERNEL32.DLL',\
              user32,   'USER32.DLL',\
              winmm,    'WINMM.DLL',\
              msvcrt,   'MSVCRT.DLL'

 include 'fasmAPI\kernel32.inc'
 include 'fasmAPI\user32.inc'
 include 'fasmAPI\winmm.inc'
 include 'fasmAPI\msvcrt.inc'

; import shell32,DragQueryFile,'DragQueryFileA'
section '.bss' readable writeable
                UserNameDrop  rb      25600  
    
Post 01 Jul 2022, 11:46
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1279
Roman 01 Jul 2022, 14:16
I try this variant (work fine). But sad not work first variant.
Code:
macro _push redd {
  if ~ defined __tmpReg_rrr ;#reg
     __tmpReg_rrr EQU 1
     jmp @f
     irps reg, rax rcx rbx rdx rbp rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 \{
                __tmpReg_\#reg   dq 0   \}
@@:
  end if
mov [__tmpReg_#redd],redd }  
    
Post 01 Jul 2022, 14:16
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.