This Program Prints the sum of a series, of a number which is input by the user.
TITLE PUCHTAA
.MODEL SMALL
.STACK 100H
.DATA
INTRO DB 0AH, 0DH, 07H, 09H, "THIS PROGRAM PRINTS THE SUM OF SERIES$"
MSG DB 0AH, 0DH, "ENTER A NUMBER: $"
NEWLINE DB 0AH, 0DH, "$"
DOAGAIN DB 0AH, 0DH, "DO AGAIN? Y FOR YES ELSE FOR NO: $"
.CODE
MAIN:
MOVAX, @DATA
MOVDS, AXLEADX, INTRO
MOVAH, 09H
INT 21H
NUMBER:
LEADX, MSG
MOVAH, 09H
INT 21H
MOVAH, 01H
INT 21H
SUBAL, 30H
CMPAL, 09H
JG NUMBER
MOVBL, ALMOVBH, ALPUSHBXCMPAL, 00H
JE RESULT
AGAIN:
DECBLADDBH, BLCMPBL, 00H
JG AGAIN
MOVAH, 00H
MOVAL, BHMOVBL, 0AH
DIVBLMOVBX, AXPOPCX
RESULT:
LEADX, NEWLINE
MOVAH, 09H
INT 21H
MOVCH, 00H
DISPLAY:
MOVDL,CHADDDL, 30H
MOVAH, 02H
INT 21H
MOVDL, '+'MOVAH, 02H
INT 21H
INCCHCMPCH, CLJLE DISPLAY
MOVDL, 08H
MOVAH, 02H
INT 21H
MOVDL, '='MOVAH, 02H
INT 21H
MOVDL,BLADDDL, 30H
MOVAH, 02H
INT 21H
MOVDL, BHADDDL, 30H
MOVAH, 02H
INT 21H
LEADX, DOAGAIN
MOVAH, 09H
INT 21H
MOVAH, 01H
INT 21H
ORAL, 20H
CMPAL, 'y'JE NUMBER
MOVAH, 4CH
INT 21H
END MAIN
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