This program prints the length of user input string in 8085/8086 microprocessor assembly language programming
TITLE PUCHTAA
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 0AH, 0DH, "ENTER A STRING--> $"
MSG2 DB 0AH, 0DH, "NUMBER OF CHARACTERS ENTERED--> $"
INMSG DB 25 DUP('0')
.CODE
MAIN:
MOVAX, @DATA
MOVDS, AX;----------------DISPLAY THE MESSAGE------------------
AGAIN:
LEADX, MSG1
MOVAH, 09H
INT 21H
;----------------------------------------------------- ;-----------TAKE STRING INPUT------------------------ LEASI, INMSG
MOVDX, SIMOVAH, 0AH
INT 21H
MOVSI, 02H
CMP INMSG+SI, 0DH
JE EXIT
;--------------------------------------------------- LEADX, MSG2
MOVAH, 09H
INT 21H
;----------SET SOURCE INDEX(SI) VALUE TO 1---------- ;----------BECAUSE FIRST INDEX TELLS NUMBER OF BYTES READ-------- MOVSI,01H
MOVAL, INMSG+SIMOVAH, 00H
MOVBL, 0AH ; AAD; DIVBL;BREAKING THE VALUE IF IT EXCEEDS 10 ;-------------------------------------------------------- MOVDX, AXADDDL, 30H
MOVAH, 02H
INT 21H
MOVDL, DHADDDL, 30H
MOVAH, 02H
INT 21H
JMP AGAIN
EXIT:
MOVAH, 04CH
INT 21H
END MAIN
This program asks user to input any string and then asks number of times it will print is. Then, it break it character wise.
TITLE PUCHTAA
.MODEL SMALL
.STACK 100H
.DATA
MSG DB 0AH, 0DH, "ENTER YOUR NAME: $"
NUMBER DB 0AH, 0DH, "ENTER A DIGITI: $"
INNAME DB 20 DUP("?")
.CODE
START:
MOVAX, @DATA
MOVDS, AX;;------------------------------------------------------------ LEASI, INNAME
LEADX, MSG
MOVAH, 09H
INT 21H
;;------------------------------------------------------------ MOVDX, SIMOVAH, 0AH
INT 21H
;;------------------------------------------------------------ LEADX, NUMBER
MOVAH, 09H
INT 21H
MOVAH, 01H
INT 21H
;;------------------------------------------------------------ SUBAL, 30H
MOVBL, ALMOVSI, 02H
;;------------------------------------------------------------
AGAIN:
MOVDL, 0AH
MOVAH, 02H
INT 21H
MOVDL, 0DH
MOVAH, 02H
INT 21H
XORBH, BHPUSHBX;;------------------------------------------------------------
DAGAIN:
MOVDL, INNAME+SIMOVAH, 02H
INT 21H
DECBLCMPBL, 00H
JNZ DAGAIN
;;------------------------------------------------------------ POPBXINCSICMP INNAME+SI, 0DH
JNZ AGAIN
;;------------------------------------------------------------ MOVAH, 04CH
INT 21H
END START
TITLE CASE_TOGGLE_PROGRAM
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 0AH, 0DH, "ENTER A CHARACTER $"
MSG2 DB 0AH, 0DH, "YOU ENTERED $"
MSG3 DB", CASE TOGGLE IS $"
CHAR DB' '
.CODE
MAIN:
MOVAX, @DATA
MOVDS, AXLEADX, MSG1
MOVAH, 09H
INT 21H
MOVAH, 01H
INT 21H
MOVBL, ALLEADX,MSG2
MOVAH, 09H
INT 21H
MOVDL, BLMOVAH, 02H
INT 21H
LEADX, MSG3
MOVAH, 09H
INT 21H
MOVDL, BLXORDL, CHAR
MOVAH, 02H
INT 21H
EXIT:
MOVAH, 04CH
INT 21H
END MAIN
;-----THE TRICK IS TO XOR-ING INPUT WITH 20H WHICH IS SPACE ;-----THANKS FOR WATCHING, SUBCRIBE FOR MORE PROJECTS :)
TITLE PUCHTAA
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN:
MOVAX, @DATA
MOVDS, AXMOVCL, 37H
LOOP1:
MOVDL, CL
LOOP2:
MOVAH, 02H
INT 21H
DECDLCMPDL, 30H
JNE LOOP2
MOVDL, 0AH
MOVAH, 02H
INT 21H
MOVDL, 0DH
MOVAH, 02H
INT 21H
DECCLCMPCL, 30H
JNE LOOP1
MOVAH, 04CH
INT 21H
END MAIN