Hi,
im quite new to asssembly programming and would like some help to display only lower case characters from an input string of 10 characters eg 12AFasdQW& = asd
the code below is as far as ive got - inputting 10 characters. am i going in the right direction or do i need to start again?
Many thanks
DOSSEG
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH
HI DB CR,LF, 'Please type in 10 characters, Press Q to quit $'
KEYBUFF DB CR,LF,' $'
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09
MOV DX,OFFSET HI
INT 21H
MOV CX, 0AH ;INITIALISE LOOP COUNTER TO 10
MOV BX,OFFSET KEYBUFF ;INITIALISE POINTER TO POINT TO KEYBUFF
MORE: MOV AH, 01 ;SET UP DOS FUNCTION 1
INT 21H
CMP AL,'Q' ;TEST FOR 'Q' TO QUIT
JZ TERMINATE ;AND MOVE TO TERMINATE ROUTINE
CMP AL, 'q' ;TEST FOR 'q' TO QUIT
JZ TERMINATE ;AND MOVE TO TERMINATE ROUTINE
MOV [BX], AL ;SAVE ASCII CODE IN KEYBUFF
INC BX ;INCREMENT KEYBUFF POINTER
DEC CL ;DECREMENT LOOP COUNTER BY 1
JNZ MORE ;IF LOOP COUNTER IS NOT ZERO GO ROUND LOOP AGAIN TILL ZERO
MOV [BX],2400H ;MOVE $ TO END OF STRING
MOV DX, OFFSET KEYBUFF
MOV AH,09H
INT 21
TERMINATE: MOV AX,4C00H
INT 21H
END START
im quite new to asssembly programming and would like some help to display only lower case characters from an input string of 10 characters eg 12AFasdQW& = asd
the code below is as far as ive got - inputting 10 characters. am i going in the right direction or do i need to start again?
Many thanks
DOSSEG
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH
HI DB CR,LF, 'Please type in 10 characters, Press Q to quit $'
KEYBUFF DB CR,LF,' $'
.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV AH,09
MOV DX,OFFSET HI
INT 21H
MOV CX, 0AH ;INITIALISE LOOP COUNTER TO 10
MOV BX,OFFSET KEYBUFF ;INITIALISE POINTER TO POINT TO KEYBUFF
MORE: MOV AH, 01 ;SET UP DOS FUNCTION 1
INT 21H
CMP AL,'Q' ;TEST FOR 'Q' TO QUIT
JZ TERMINATE ;AND MOVE TO TERMINATE ROUTINE
CMP AL, 'q' ;TEST FOR 'q' TO QUIT
JZ TERMINATE ;AND MOVE TO TERMINATE ROUTINE
MOV [BX], AL ;SAVE ASCII CODE IN KEYBUFF
INC BX ;INCREMENT KEYBUFF POINTER
DEC CL ;DECREMENT LOOP COUNTER BY 1
JNZ MORE ;IF LOOP COUNTER IS NOT ZERO GO ROUND LOOP AGAIN TILL ZERO
MOV [BX],2400H ;MOVE $ TO END OF STRING
MOV DX, OFFSET KEYBUFF
MOV AH,09H
INT 21
TERMINATE: MOV AX,4C00H
INT 21H
END START