TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ROBERT GLODT
from: BRIAN MCCLOUD
date: 1997-10-02 14:26:00
subject: the lds function

-> Could someone describe the 'lds' function to me, or atleast quote the code 
i
-> posted (the 'lds' parts of it) so that i could better understand it. I 
think
-> i've gotten the idea of it, but i'm not sure. So far i think it does the
-> following:
->
-> mov ds,100
-> mov ax,102        ;add 2 to the number put into dx
->
-> is this right?
Not quite.  here's an example of how lds works (les, lfs, etc. work 
similarly):
.DATA
ORG     100h    ; just to make sure you're not thinking it loads the address
                ; it read from.
THE_ADDRESS     EQU     $
THE_OFFSET      DW      1000h
THE_SEGMENT     DW      2000h
.CODE
LDS     BX, [THE_ADDRESS]
After this, BX should contain 1000h, and DS should contain 2000h... However,
when changing segment registers, it is often a good idea to preserve DS with 

PUSH command before it.
((Cloud))
MauveCloud@juno.com
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)

SOURCE: echomail via exec-pc

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™.