Path: csiph.com!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: "R.Wieser"
Newsgroups: comp.os.msdos.programmer
Subject: How to access stack-based data (strings) when SS <> DS ?
Date: Sat, 4 Dec 2021 08:56:24 +0100
Organization: Aioe.org NNTP Server
Lines: 20
Message-ID:
Injection-Info: gioia.aioe.org; logging-data="10172"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
Xref: csiph.com comp.os.msdos.programmer:4088
Hello all,
As an assembly programmer I never needed to write *big* programs, and
therefore always used the "tiny" memory model where CS = DS = SS.
Though at some point I realized that not having SS equal to DS creates its
own problems - when trying to access stack-based data (strings).
A "lea dx,[Stack-based item]" will work, but, for example, using it with
"mov ah,09h", "int 21h" will ofcourse fail, as DX is not pointing into DS.
My question :
Does anyone know how this is solved ? Other than (manually!) wrapping all
such calls in a "push ds", "mov ax,ss", "mov ds,ax" .... "pop ds" sequences
I mean.
Regards,
Rudy Wieser