Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

lp1 on fire (One of the more obfuscated kernel messages)


devel / alt.lang.asm / Re: offset vs word ptr

SubjectAuthor
* offset vs word ptrPaul Edwards
`- Re: offset vs word ptrPaul Edwards

1
offset vs word ptr

<d43e63b0-d112-410b-b4e7-8c558c504345n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=427&group=alt.lang.asm#427

 copy link   Newsgroups: alt.lang.asm
X-Received: by 2002:a05:6214:1628:b0:62f:e3a9:8fb8 with SMTP id e8-20020a056214162800b0062fe3a98fb8mr2284395qvw.5.1687434005618;
Thu, 22 Jun 2023 04:40:05 -0700 (PDT)
X-Received: by 2002:ac8:7c54:0:b0:3ff:247a:31ce with SMTP id
o20-20020ac87c54000000b003ff247a31cemr3748698qtv.6.1687434005232; Thu, 22 Jun
2023 04:40:05 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Thu, 22 Jun 2023 04:40:04 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=111.90.198.55; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 111.90.198.55
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d43e63b0-d112-410b-b4e7-8c558c504345n@googlegroups.com>
Subject: offset vs word ptr
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Thu, 22 Jun 2023 11:40:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2009
 by: Paul Edwards - Thu, 22 Jun 2023 11:40 UTC

Visual C 1.52 generates code like this:

mov ax,OFFSET -32768
xor dx,dx
lea bx,WORD PTR -30[bp]
add ax,WORD PTR ss:[bx]
adc dx,OFFSET 0
mov cx,OFFSET __AHSHIFT
shl dx,cx
add dx,WORD PTR ss:2[bx]
mov WORD PTR ss:[bx],ax
mov WORD PTR ss:2[bx],dx

I am providing my own C library, so I put this:

public _AHINCR
public _AHSHIFT
_AHINCR dw 1000H
_AHSHIFT dw 12

And I tried printing it out, and it is correct - AHSHIFT is 12.

However, the generated code used word ptr to print it out,
not offset.

I expected offset to do the same thing - get the first word
of a 16:16 address, which would be identical to a word.

Is this the case?

My suspicion is that I am actually getting a value greater
than 15 for "offset _AHSHIFT". I can't easily determine that
at the moment, I just "know" (I don't trust anything at the
moment) that the segment isn't being changed as expected.

Any idea what I need to define in assembler (under my
control) to get the correct value (in the generated code)?

Thanks. Paul.

Re: offset vs word ptr

<9b895104-1902-43bd-9f8a-ff2382a8d789n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=428&group=alt.lang.asm#428

 copy link   Newsgroups: alt.lang.asm
X-Received: by 2002:ad4:4e27:0:b0:62f:fa11:d23c with SMTP id dm7-20020ad44e27000000b0062ffa11d23cmr3514647qvb.8.1687492491146;
Thu, 22 Jun 2023 20:54:51 -0700 (PDT)
X-Received: by 2002:a25:2144:0:b0:bd7:6810:6666 with SMTP id
h65-20020a252144000000b00bd768106666mr8189500ybh.5.1687492490939; Thu, 22 Jun
2023 20:54:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Thu, 22 Jun 2023 20:54:50 -0700 (PDT)
In-Reply-To: <d43e63b0-d112-410b-b4e7-8c558c504345n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=111.90.198.52; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 111.90.198.52
References: <d43e63b0-d112-410b-b4e7-8c558c504345n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9b895104-1902-43bd-9f8a-ff2382a8d789n@googlegroups.com>
Subject: Re: offset vs word ptr
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Fri, 23 Jun 2023 03:54:51 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: Paul Edwards - Fri, 23 Jun 2023 03:54 UTC

This fixed the problem:

C:\devel\pdos\pdpclib>git diff .
diff --git a/pdpclib/dossupa.asm b/pdpclib/dossupa.asm
index 6dc30c42..093608de 100644
--- a/pdpclib/dossupa.asm
+++ b/pdpclib/dossupa.asm
@@ -36,8 +36,8 @@ endif
ifdef MSC
public _AHINCR
public _AHSHIFT
-_AHINCR dw 1000H
-_AHSHIFT dw 12
+_AHINCR equ 1000H
+_AHSHIFT equ 12
endif

.code

C:\devel\pdos\pdpclib>

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor