-> 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)
|