News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

typedef ptr

Started by Biterider, October 14, 2017, 11:56:01 PM

Previous topic - Next topic

Biterider

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

johnsa

Hi,

The attachment says it's corrupt. Could you add it again or mail me the source?
thanks.

LiaoMi

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

johnsa

I believe 8 is correct as the size of the pointer is 8bytes / qword.


Biterider

#4
Hi
"LPSTR2 typedef ptr WORD" should also be a pointer (8 bytes) but ist is shown as 4 bytes.

Biterider

johnsa

Your screenshot shows it as 8 bytes ?