Message board for the users of flat assembler.
> DOS > user input
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:
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
|09 Feb 2005, 13:40||
Go here and you will find code by "Privalov" for doing what you want to do.
|09 Feb 2005, 18:16||
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.
|15 Feb 2005, 00:49||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.