flat assembler
Message board for the users of flat assembler.

Index > DOS > lds

Author
Thread Post new topic Reply to topic
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
does not work:

Code:
org 100
something db 'whoops$'
lds dx,[something]
mov ax,0900h
int 21h  
    


i think ds:dx is a right handle...

_________________
Microsoft: brings power of yesterday to computers of today.
Post 17 Oct 2003, 09:59
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
lds (les, lgs lfs) second argument must be a dword where far pointer of the data is stored. In your case you must write something like:

Code:
org 100
mov dx,something ; in com files ds=cs=es if you don't change it.
mov ax,0900h
int 21h  
ret

; And don't put data before the code. 
; The processor does not understand what is data and what is code. Smile
something db 'whoops$' 
    
Post 17 Oct 2003, 10:23
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
THX John but what argument should I write to LDS to get no error message?

I tried almost everything:(

_________________
Microsoft: brings power of yesterday to computers of today.
Post 17 Oct 2003, 16:36
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
Don't know if this is the right syntax, but it compiles with out error:
Code:
org 100
lds dx, dword [something]
mov ax,0900h
int 21h

something db 'whoops$'
    

(can't test it in Linux)

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 17 Oct 2003, 17:36
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7737
Location: Kraków, Poland
Tomasz Grysztar
It should be something like:
Code:
something dd 1234h:5678h    

where 1234h is the segment number and 5678h the offset. Then the instruction:
Code:
lds dx,[something]    

loads 1234h into DS and 5678h into DX.

And if you want to just some offset into DX, use the MOV or LEA instruction.
Post 17 Oct 2003, 17:48
View user's profile Send private message Visit poster's website Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
??? like ???


mov ax,[something]
mov dx,[something +2]
mov ds,ax

_________________
Microsoft: brings power of yesterday to computers of today.
Post 20 Oct 2003, 12:34
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.