flat assembler
Message board for the users of flat assembler.

Index > DOS > user input

Author
Thread Post new topic Reply to topic
pc2



Joined: 09 Feb 2005
Posts: 3
Location: Brazil
pc2 09 Feb 2005, 13:40
salutations,
we already know how to make a 'single character' input...
but we would like to know how to make a text input, like the BASIC command:
INPUT "what's your name?", string$
we have tried to make input like this:
Code:
org 100h
mov ah,1b
int 21h
cmp al,'y'
je label
label: ;---
    

but the problem is that this input method only works for 1 character, that is stored in the al register.
we would also like to, make a pattern compare with the user input, for example:
comparing "assembly" with "[Aa]*mbly" would return true (1b).

_________________
Paulo Marcos Durand Segal & Claudio Marcos Durand Segal
Post 09 Feb 2005, 13:40
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 09 Feb 2005, 18:16
Go here and you will find code by "Privalov" for doing what you want to do.
http://board.flatassembler.net/topic.php?t=316
Post 09 Feb 2005, 18:16
View user's profile Send private message Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 15 Feb 2005, 00:49
(info)
INT 21h AH=0Ah GET BUFFERED INPUT
to a buffer at DS:DX where it's byte offset is:
LB00h DB 20 ;maximum characters buffer can hold (=input for INT)
LB01h DB 10 ;input= # of chars from last input which may be recalled
;..................;output= # of chars actually read, excluding CR
LB02h times 20 DB 0 ;this is the recieving buffer.

I made a callable proc that handles character input, backspace, tab, etc
and now can easily use it in any program I make.
It was easy to make, & you may want to make one to suit your needs.
I used INT 16h AH=0 & 1 (0=get character, 1=read KBD flags)
Check Ralf Brown's interrupt list for usage details.
Post 15 Feb 2005, 00:49
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.