flat assembler
Message board for the users of flat assembler.

Index > DOS > ip:cs?

Author
Thread Post new topic Reply to topic
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp
how do you do that? is it
like
push ds
pop cs

ds:cs or is there something, because im making a cli and i do not know how to store the user input, so im trying to use lodsb but i have to use a certain 000:000 (example not real) to do it

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 13 Dec 2008, 00:09
View user's profile Send private message Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 166
Location: Maryland, USA
rCX
Are you trying to set cs=ip? I don't think it is possible (easily). ip and cs can only be changed by instructions like jmp or call.

There are other ways to store the user input. Have you tried?
Code:
push word seg ;\ds = segment
pop word ds   ;/
mov dx,off    ; dx = offset
mov ah,0Ah    ;\Put user input at seg:off
int 21h       ;/
    


Can you give more information?

Also, welcome to the fasm fourm! Cool
Post 13 Dec 2008, 00:48
View user's profile Send private message Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp
well, not exactly i just want to know how it works, and how to make it what i want like say, i want tit to be cs: something
how to make it what i want it to be.

and thank you for the welcome Smile im sure this cite will help me with many questions, i just hope every one can put up with all of them, Ha Ha

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 13 Dec 2008, 02:25
View user's profile Send private message Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 166
Location: Maryland, USA
rCX
GhostXoPCorp wrote:

and thank you for the welcome Smile im sure this cite will help me with many questions, i just hope every one can put up with all of them, Ha Ha


Yeah, I once was a newbie. I still am, as compared to the fasm veterens.

Like this?
Code:
push cs       ;\ds = cs
pop ds        ;/
mov dx,off    ; dx = offset
mov ah,0Ah    ;\Put user input at ds:off, which is the same as cs:off because ds=cs
int 21h       ;/ 
    
Post 13 Dec 2008, 03:24
View user's profile Send private message Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp
well, here is what im wanting to do
i have the
get key
and it gets the key untill the user hits enter
or i think
cmp al, 13

now how can i store each letter and where untill the user hi enter, and then how can i check the string for if say the string says help
je help, maybe OT, but this is all i need to know. it took me a while to under stand print (yeah ok, pathetic) but it was becase i defined in the wrong place and did not use certain ret's and other things.

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 13 Dec 2008, 03:29
View user's profile Send private message Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 166
Location: Maryland, USA
rCX
A great resource for what interrupts do is Ralf Brown's Interrupt List. For the one used see here. Here is a list of 16-bit instructions. The cmpsb instruction is good for comparing strings.

Here's a better example because previous examples may not always work

Code:

org 100h
use16

push cs                   ;\ds = cs
pop ds                    ;/
mov dx,InputData  ; dx = Address of InputData
mov ah,0Ah               ;\Waits for user to input string and puts it at ds:UserInput. Continues after enter is pressed.
int 21h                 ;/
 ;compare with InputString with 'help' using cmpsb.  Sorry I don't have right now to to write it out Sad
ret

InputData:
       MaxSizeAllowed          db 255; Maximum size of string allowed
      InputStringLength       db 255; Will contain length of input string after enter is pressed.  For now it is 255
      InputString             rb 255; Reserve 255 bytes.  Will contain string of input string after enter is pressed

    
Post 13 Dec 2008, 04:08
View user's profile Send private message Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp
thanks, but(i might have to post this when i join a cite) i have already downloaded ralphs list. if you could, tell evryone to stop asking me that. but any way, thanks i will use this. well i have to go, thank you for the info.

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 13 Dec 2008, 04:33
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 GitHub, YouTube, Twitter.

Website powered by rwasa.