Somebody help. This is for my special project and to be submitted on monday. It's 11:09pm (saturday) here. i have a problem with my codes. its about when you input a CAPITAL LETTER the output should be in lowercase and vice versa. and also my problem is i dont know to code the " INVALID INPUT" when the input characters have spaces and numbers. that's all. hope someone will help :( i need to pass my subject :( Here's my code.... DIS MACRO STR MOV AH,09H LEA DX,STR INT 21H ENDM DATA SEGMENT MSG1 DB "INPUT A CHARACTER : $" MSG2 DB "CONVERTED CHARACTER IS : $" STR1 DB 20 DUP('$') LINE DB 10,13,'$' DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX DIS MSG1 MOV AH,0AH LEA DX,STR1 INT 21H DIS LINE MOV CH,00 MOV CL,BYTE PTR[STR1+1] LEA SI,STR1+2 L1: MOV AH,BYTE PTR[SI] CMP AH,'A' JL L4 CMP AH,'Z' JG L2 ADD BYTE PTR[SI],32 JMP L3 L2:CMP AH,'a' JL L4 CMP AH,'z' JG L4 SUB BYTE PTR[SI],32 L3:INC SI LOOP L1 DIS MSG2 DIS STR1+2 L4:MOV AH,4CH INT 21H CODE ENDS END START ;------ ;OUTPUT ;------ ENTER YOUR CHARACTER : JiNeSh CONVERTED CHARACTER IS : jInEsh
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.