N ; GETKEY2.SCR DEBUG Assembly Language script N ; N ; "2nd Generation" Programming Language demo for CIS 120 N ; N ; Mike Huffman, Portland Community College N ; Computer Information Systems, Winter Term, 2001 N ; N ; Last update: 10 FEB 2001 N ; A 100 MOV AH,00 ; BIOS service 00H Read Keyboard Character INT 16 ; call BIOS CMP AL,61 ; is char less than 'a'? JB 010E ; yes, display the char CMP AL,7A ; is char greater than 'z'? JA 010E ; yes, display the char AND AL,DF ; char is a-z, clear bit 5 to convert to upper case ; display the char; in a "real" program the char ; would be used to, say, check for a menu choice MOV DL,AL ; DL = char to display MOV AH,02 ; DOS service 02H Display output INT 21 ; call DOS CMP AL,51 ; was char 'Q' (Quit)? JNE 0100 ; no, loop and get another character MOV AL,00 ; yes, AL = return code MOV AH,4C ; AH = DOS service 4CH Terminate with return code INT 21 ; call DOS ; leave blank line to end DEBUG Assembly mode N getkey2.com R CX 1E W Q