Pelles C forum

Pelles C => Bug reports => Topic started by: Vortex on July 04, 2023, 09:21:20 PM

Title: Macro freezing Poasm
Post by: Vortex 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
Title: Re: Macro freezing Poasm
Post by: Vortex 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
Title: Re: Macro freezing Poasm
Post by: Pelle on September 10, 2023, 07:26:03 PM
I will look at it...
Title: Re: Macro freezing Poasm
Post by: Pelle on September 11, 2023, 02:53:37 PM
This seems easily fixed by using the correct syntax:
Code: [Select]
retx MACRO
     db 0C3h
ENDM