Category : Files from Magazines
Archive   : PCTJ0687.ZIP
Filename : ASKKEY.ASM

 
Output of file : ASKKEY.ASM contained in archive : PCTJ0687.ZIP
; ASKKEY - Display text and accept a char from Standard Input.
; Return the ASCII code of the char as an ERRORLEVEL.
Code Segment
Org 0100H
Assume CS:Code, DS:Code
AskKey Proc Far
Begin: Mov SI,81H ; SI -> 1st cmd line char
; Display all text in the command line up to 0DH (Carridge Return)
NxtChar: Mov DL,[SI] ; get char from command line
Cmp DL,0DH ; CR char means end of string
Je GetChar ; Goto input mode if at end
Mov AH,02H ; Standard Output function
Int 21H ; call DOS to output char
Inc SI ; increment to next char
Jmp NxtChar ; and go get it
; Accept a single character response from Standard Input
GetChar: Mov AH,01H ; Standard Input function
Int 21H ; Call DOS, get char into AL
Cmp AL,0 ; extended character?
Je GetChar ; Yes, get the scan code
Cmp AL,'a' ; is char less than 'a' ?
Jb Xit ; Yes, skip case change
Cmp AL,'z' ; is it greater than 'z' ?
Ja Xit ; Yes, bypass case change
And AL,NOT 20H ; change to upper case
; Return to DOS with the RETCODE set
Xit: Mov AH,4CH ; Set exit function
Int 21H ; call DOS to leave
; AL already has RETCODE
AskKey Endp
Code Ends
End Begin


  3 Responses to “Category : Files from Magazines
Archive   : PCTJ0687.ZIP
Filename : ASKKEY.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/