Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL SMALL ; IN THIS COURSE ALL MODEL ARE SMALL
- .STACK 100H ; WE ALWAYS USE STACK 100H
- .DATA ; DATA SEGMENT
- CR EQU 0DH ; MAKE ODH IN CF.. IF WE NEED ODH WE CAN CALL IT USING CR, CR = ODH
- LF EQU 0AH ; SAME ALSO WE CAN USE OAH BY LF, LF = OAH
- MSG1 DB "Enter a Lowwer Case: $" ; DB - Define Byte. 8 bits, DW - Define Word. Generally 2 bytes on a typical x86 32-bit system
- ; $ SIGN IS USE TO END THE STING. IT HELP TO FIND THE STRING ENDING
- MSG2 DB CR,LF,"In upper case it is: " ; WE DO NOT GIVE $ BECAUSE WE WANT TO PRINT THE UPPER CASE ALSO
- ; WE USE CR,LF TO PRINT A NEW LINE AFTER 1ST STRING END
- RESULT DB ?, "$" ; WE USE $ SIGN HERE TO PRINT THIS ALO
- .CODE
- MAIN PROC ; MAIN CODE START HERE
- ;PROGRAMME SEGMENT PREFIX
- MOV AX,@DATA
- MOV DS,AX ; INITILATION OF DS
- LEA DX,MSG1 ; FOR STRING PRINT WE USE LEA FUNCTION TO LOAD THE STRING ; [FULL MEANING LEA : LOAD EFFICIENT ADRESS]
- MOV AH,9 ; FOR STRING PRINT WE USE AH,9 WHICH PRINT MY LOADED STRINT WHICH WAS MSG
- INT 21H ; IT WILL INTRUPT THE WORK.
- MOV AH,1 ; IT WILL TAKE INPUT A LOWER CASE
- INT 21H ; THE WORL WILL DONE HERE
- SUB AL,20H ; IN ASCII CODE LOWER LETTER VALUE - 20 = UPPER LETTER, SO WE MINIUS 20 FROM INPUT VALUE
- MOV RESULT,AL ; NOW MOVE THE UPPER CASE VALUE IN RESULT. RESULT CONTAIN NOW THE UPPER CASSE OF THE INPUT
- LEA DX,MSG2 ; NOW LOAD SECOND STRING TO PRINT
- MOV AH,9 ; IT WILL PRINT THE STRING
- INT 21H ; MAKE THE COMPUTER TO DO IT
- MOV AX,4CH ; TERMINATED THE CODE AND EXIT
- INT 21H
- MAIN ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement