NO

Author Topic: Macro freezing Poasm  (Read 3847 times)

Offline Vortex

  • Member
  • *
  • Posts: 864
    • http://www.vortex.masmcode.com
Macro freezing Poasm
« on: July 04, 2023, 09:21:20 PM »
Hi Pelle,

Poasm is freezing while trying to assemble the code below. The assembler does not return back the control to the command prompt. The problem is the retx macro :

Code: [Select]
PUBLIC start

ExitProcess PROTO :DWORD

includelib \PellesC\Lib\Win64\kernel32.lib

retx MACRO

     db 0C3h

retx ENDM
 
.code

start:

    mov     rcx,20
    mov     rdx,10
    call    main
    invoke  ExitProcess,0

OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

main PROC

    mov   rax,rcx
    add   rax,rdx
;   ret           ; ret is ignored
    retx          ; Poasm is freezing
                  ; at this point
;   db    0C3h

main ENDP

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

END

Test with Poasm Version 12.00.1
Code it... That's all...

Offline Vortex

  • Member
  • *
  • Posts: 864
    • http://www.vortex.masmcode.com
Re: Macro freezing Poasm
« Reply #1 on: August 01, 2023, 02:02:24 PM »
Hello,

The retn instruction is the best option to terminate the procedure but the assembler should not freeze as I mentioned in my first posting.

Code: [Select]
PUBLIC start

ExitProcess PROTO :DWORD

includelib \PellesC\Lib\Win64\kernel32.lib

retx MACRO

     db 0C3h

retx ENDM
 
.code

start:

    mov     rcx,20
    mov     rdx,10
    call    main
    invoke  ExitProcess,0

OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

main PROC

    mov   rax,rcx
    add   rax,rdx
    retn

main ENDP

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

END
Code it... That's all...

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Macro freezing Poasm
« Reply #2 on: September 10, 2023, 07:26:03 PM »
I will look at it...
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Macro freezing Poasm
« Reply #3 on: September 11, 2023, 02:53:37 PM »
This seems easily fixed by using the correct syntax:
Code: [Select]
retx MACRO
     db 0C3h
ENDM
/Pelle