The MASM Forum

64 bit assembler => UASM Assembler Development => Topic started by: Biterider on October 14, 2017, 11:56:01 PM

Title: typedef ptr
Post by: Biterider on October 14, 2017, 11:56:01 PM
Hello
I've the following code (see attachment) using UASM 2.42:
LPSTR1 typedef ptr
LPSTR2 typedef ptr WORD


.code


align 16
TestProc proc FRAME
    local pMyStr1:LPSTR1
    local pMyStr2:LPSTR2
    local MyBYTE:BYTE
    local MyWORD:WORD
    local MyDWORD:DWORD
    local MyQWORD:QWORD



The sizeof operator returns 8 for [/size]pMyStr1 & pMyStr2 but VS shows these locals as sized like QWORD and DWORD. I guess that this is caused due to an issue with the debug info.Regards, Biterider
Title: Re: typedef ptr
Post by: johnsa on October 16, 2017, 07:22:03 PM
Hi,

The attachment says it's corrupt. Could you add it again or mail me the source?
thanks.
Title: Re: typedef ptr
Post by: LiaoMi on October 16, 2017, 08:35:09 PM
Hi,

my downloading of attachments works well, Code.zip and VS.zip its pictures  :biggrin:

option casemap:none
option dotname     
option frame:auto 
option win64:11   

LPSTR1 typedef ptr
LPSTR2 typedef ptr WORD

.code

align 16
TestProc proc FRAME
    local pMyStr1:LPSTR1
    local pMyStr2:LPSTR2
    local MyBYTE:BYTE
    local MyWORD:WORD
    local MyDWORD:DWORD
    local MyQWORD:QWORD

    mov rax, sizeof(pMyStr1)
    mov rbx, sizeof(pMyStr2)

    mov rax, sizeof(MyBYTE)
    mov rbx, sizeof(MyWORD)
    mov rcx, sizeof(MyDWORD)
    mov rdx, sizeof(MyQWORD)

    ret
TestProc endp


align 16
Start:             
    and rsp, 0FFFFFFFFFFFFFFF0h
    invoke TestProc
    ret
end Start
Title: Re: typedef ptr
Post by: johnsa on October 16, 2017, 08:47:10 PM
I believe 8 is correct as the size of the pointer is 8bytes / qword.

Title: Re: typedef ptr
Post by: Biterider on October 16, 2017, 08:58:51 PM
Hi
"LPSTR2 typedef ptr WORD" should also be a pointer (8 bytes) but ist is shown as 4 bytes.

Biterider
Title: Re: typedef ptr
Post by: johnsa on October 16, 2017, 09:04:23 PM
Your screenshot shows it as 8 bytes ?