TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: Paul Edwards
from: rowan crowe
date: 1995-05-22 10:17:28
subject: data segment woes

Answering msg from Paul Edwards to rowan crowe,
on Saturday May 20 1995 at 11:02

 rc>> hello proc far
 rc>> push   ds
 rc>> mov    ax, {at}data
 rc>> mov    ds, ax
 rc>> .....
 rc>> pop    ds
 rc>> endp

 rc>> It's kludgy but then at least it will work under Watcom.

 PE> Thanks for your reply, Rowan.  However, I tried putting that into
 PE> the code, and it compiled under TASM, but WASM complained about
 PE> there being no such symbol {at}data.

    Try using this instead:

mov   ax, seg data

    or if that doesn't work,

mov   ax, seg {at}data

 PE> Could you please elaborate on what you hoped to achieve by using
 PE> {at}data?  And why do I need to do that in the first place?  Why do
 PE> you say it is kludgy?  And why does it need to be done when I'm
 PE> using Watcom, but Borland is fine??!!  As you can tell, assembler
 PE> is not my strong point, but I really would like to be able to
 PE> have more than one compiler that can compile MSGED!!!  BFN.  Paul.

    Having something being able to compile under a popular compiler such as
Watcom would of course be highly desirable. ;-)

    I am fine with pure ASM, but a bit rusty when it comes to interfacing
with high level languages. I tend to get lost in DGROUPs and CONSTs and
whatnot.

    {at}data or just "data" will generally refer to the data
segment. So, "mov ax, seg data" will load the segment into your
AX register.

    All the above code does is to set DS to point to your data segment,
while preserving the original DS when you exit your function.

    It may or may not work, depending on your memory model, which is: (?)

    Also what are the ASM functions exactly? Actually I have access to
MSQ305.ZIP so I will take a peek now.

---
* Origin: Jelly-Bean software development. (3:635/727.1)
SEEN-BY: 50/99 632/348 998 633/371 634/384 635/502 503 513 544 727 638/100
SEEN-BY: 640/230 690/718 711/401 410 430 807 808 809 933 934 713/888 800/1
SEEN-BY: 7877/2809
@PATH: 635/727 632/348 635/503 50/99 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.