Tuesday, May 19, 2020

[Solved] Creating Nested Loops in ascending order in Assembly Language

The following code demonstrates nested loops in ascending order example in 8086 Assembly Language Programming. Related program can be found here




TITLE PUCHTAA  
.MODEL SMALL  
.STACK 100H  
.DATA  
  
  
.CODE  
    MAIN:  
        MOV AX, @DATA  
        MOV DS, AX  
          
        MOV CL, 31H  
    LOOP1:  
        MOV DL, CL  
    LOOP2:  
        MOV AH, 02H  
        INT 21H  
          
        INC DL  
        CMP DL, 37H  
        JNG LOOP2  
          
        MOV DL, 0AH  
        MOV AH, 02H  
        INT 21H  
          
          
        MOV DL, 0DH  
        MOV AH, 02H  
        INT 21H  
          
          
        INC CL  
        CMP CL, 37H  
        JNG LOOP1  
          
           
          
        MOV AH, 04CH  
        INT 21H  
    END MAIN 
 
OUTPUT OF THE PROGRAM 
 
NESTED LOOPS IN ASCENDING ORDER IN ASSEMBLY LANGUAGE PROGRAMMING
 

Saturday, May 16, 2020

How to Print Sum of Series in Assembly Language


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: 
        MOV AX, @DATA 
        MOV DS, AX 
 
        LEA DX, INTRO 
        MOV AH, 09H 
        INT 21H 
 
         
    NUMBER:     
        LEA DX, MSG 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
         
        SUB AL, 30H 
        CMP AL, 09H 
        JG NUMBER 
         
         
        MOV BL, AL 
        MOV BH, AL 
        PUSH BX 
        CMP AL, 00H 
        JE RESULT 
   AGAIN: 
         
         
        DEC BL 
        ADD BH, BL 
        CMP BL, 00H 
        JG AGAIN 
         
        MOV AH, 00H 
        MOV AL, BH 
        MOV BL, 0AH 
        DIV BL 
        MOV BX, AX 
        POP CX 
  RESULT:       
        LEA DX, NEWLINE 
        MOV AH, 09H 
        INT 21H 
        MOV CH, 00H 
         
  DISPLAY: 
        MOV DL,CH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, '+' 
        MOV AH, 02H 
        INT 21H 
         
        INC CH 
        CMP CH, CL 
        JLE DISPLAY  
         
         
        MOV DL, 08H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, '=' 
        MOV AH, 02H 
        INT 21H 
         
         
         
        MOV DL,BL 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H       
         
        MOV DL, BH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        LEA DX, DOAGAIN 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
        OR AL, 20H 
        CMP AL, 'y' 
        JE NUMBER 
         
         
        MOV AH, 4CH 
        INT 21H 
    END MAIN 

OUTPUT of the program

Sum of Series Programming in Assembly Language
  • assembly language program for sum of series
  • sum of series in assembly language
  • series addition azevedotechcrunch

Click to Download Code

Download

Thursday, March 26, 2020

How To Find Length Of String In 8086 Assembly Language [Click to Download Code]


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: 
        MOV AX, @DATA 
        MOV DS, AX 
;----------------DISPLAY THE MESSAGE------------------ 
   AGAIN:      
        LEA DX, MSG1 
        MOV AH, 09H 
        INT 21H 
;----------------------------------------------------- 
         
;-----------TAKE STRING INPUT------------------------         
        LEA SI, INMSG 
        MOV DX, SI 
        MOV AH, 0AH 
        INT 21H 
         
        MOV SI, 02H 
        CMP INMSG+SI, 0DH 
        JE EXIT 
;---------------------------------------------------         
        LEA DX, MSG2 
        MOV AH, 09H 
        INT 21H 
;----------SET SOURCE INDEX(SI) VALUE TO 1---------- 
;----------BECAUSE FIRST INDEX TELLS NUMBER OF BYTES READ--------         
        MOV SI,01H 
         
        MOV AL, INMSG+SI 
        MOV AH, 00H 
        MOV BL, 0AH ; 
        AAD         ; 
        DIV BL      ;BREAKING THE VALUE IF IT EXCEEDS 10 
;--------------------------------------------------------         
        MOV DX, AX 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, DH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
        JMP AGAIN 
   EXIT:      
         
        MOV AH, 04CH 
        INT 21H 
    END MAIN


TAGS:
  • find length of string in assembly language 8086
  • 8086 program to find length of a string
  • length of string in assembly language
  • string length assembly
  • assembly get length of string
  • length of string assembly
  • assembly length of string
  • assembly string length
  • how to find length of string in assembly language
  • get length of string assembly
  • how to get the length of a string in assembly
  • how to find the length of a string in assembly
  • string length in assembly language
 
How to Count Lenght of a given string in assembly language- OUTPUT

Wednesday, March 25, 2020

String Manipulation in 8086 Assembly Language | The Easy Way


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: 
        MOV AX, @DATA 
        MOV DS, AX 
         
;;------------------------------------------------------------         
         
        LEA SI, INNAME 
         
        LEA DX, MSG 
        MOV AH, 09H 
        INT 21H 
;;------------------------------------------------------------         
        MOV DX, SI 
        MOV AH, 0AH 
        INT 21H  
;;------------------------------------------------------------         
        LEA DX, NUMBER 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
;;------------------------------------------------------------         
        SUB AL, 30H 
        MOV BL, AL 
                  
                              
        MOV SI, 02H 
;;------------------------------------------------------------          
    AGAIN: 
      
        MOV DL, 0AH 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, 0DH 
        MOV AH, 02H 
        INT 21H 
                
     
        XOR BH, BH 
        PUSH BX 
;;------------------------------------------------------------ 
   DAGAIN: 
          
        MOV DL, INNAME+SI 
        MOV AH, 02H 
        INT 21H 
        DEC BL 
        CMP BL, 00H 
         
        JNZ DAGAIN 
;;------------------------------------------------------------         
        POP BX 
        INC SI 
        CMP INNAME+SI, 0DH 
        JNZ AGAIN 
;;------------------------------------------------------------         
         
         
         
         
        MOV AH, 04CH 
        INT 21H 
         
    END START         


Breaking String Character Wise and Manipulation in 8086 Assembly Language

Tuesday, March 24, 2020

HOW TO CHECK USER INPUT IN 8086 ASSEMBLY LANGUAGE PROGRAMMING


TITLE PUCHTAA 
.MODEL SMALL 
.STACK 100H 
.DATA 
     MSG DB 0AH, 0DH, "ENTER A CHARACTER: $" 
     ALPHABET DB 0AH, 0DH, "IT'S ALPHABET $" 
     DIGIT DB 0AH, 0DH, "IT'S DIGIT $" 
     SPECIAL DB 0AH, 0DH, "IT'S SPECIAL CHARACTER $" 
.CODE 
    START: 
        MOV AX, @DATA 
        MOV DS, AX 
    AGAIN:     
       ;-----------------------  
        LEA DX, MSG 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
       ;----------------------  
        MOV BL, AL 
         
        CMP BL, 61H 
        JGE DALPHABET_SMALL 
         
        CMP BL, 41H 
        JGE DALPHABET 
         
        CMP BL, 30H 
        JGE DDIGIT 
         
        CMP BL, 30H 
        JL DSPECIAL   
         
         
;--------------------------------------------          
         
    DSPECIAL: 
        LEA DX, SPECIAL 
        MOV AH, 09H 
        INT 21H       
         
        JMP AGAIN 
;---------------------------------------------         
    DDIGIT: 
        CMP BL, 39H 
        JG DSPECIAL 
         
        LEA DX, DIGIT 
        MOV AH, 09H 
        INT 21H 
         
        JMP AGAIN 
;---------------------------------------------         
    DALPHABET: 
        CMP BL, 5AH 
        JG DSPECIAL 
          
        LEA DX, ALPHABET 
        MOV AH, 09H 
        INT 21H 
         
        JMP AGAIN 
;---------------------------------------------         
    DALPHABET_SMALL: 
        CMP BL, 7AH 
        JG DSPECIAL 
         
        LEA DX, ALPHABET 
        MOV AH, 09H 
        INT 21H 
         
        JMP AGAIN     
;--------------------------------------------         
         
    EXIT:     
         
        MOV AH, 04CH 
        INT 21H 
         
    END START  
     
     
    ;---------THANKS FOR WATCHING-----:) 

FOLLOWING IS THE OUTPUT OF THE PROGRAM

How To Check User Input In Assembly Language

 

Complete Video Tutorials