🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.language.basm
Article #12

Do I know how to use OFFSET correctly?

#12
From: Larry Griffiths
Date: Mon, 16 Jul 2007 17:54
16 lines
1237 bytes
I have a class that has two __int64 variables.

class x
{
unsigned __int64 A;
unsigned __int64 B;
};

I add some assembler to a method of the class:

    asm     mov     DWORD PTR     ecx, this;
    asm     add     DWORD PTR    ecx, OFFSET this.B

The offset to "B" is $08 but the generated code only adds $04 to ECX.

Am I missing something here or doing something incorrectly.
Technical Details
Message-ID: <469bb12c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 107b11,450523d4a6ce87ce,start
X-Google-Attributes: gid107b11,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Larry Griffiths" <nospame@nowhere.com>
Newsgroups: borland.public.cppbuilder.language.basm
Subject: Do I know how to use OFFSET correctly?
Date: Mon, 16 Jul 2007 12:54:03 -0500
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 70.252.174.162
Message-ID: <469bb12c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1184608556 70.252.174.162 (16 Jul 2007 10:55:56 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail