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

 

Toggle Case program in 8086 Assembly language programming



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: 
        MOV AX, @DATA 
        MOV DS, AX 
         
         
        LEA DX, MSG1 
        MOV AH, 09H 
        INT 21H 
         
         
        MOV AH, 01H 
        INT 21H 
         
        MOV BL, AL 
          
        LEA DX,MSG2 
        MOV AH, 09H 
        INT 21H 
         
        MOV DL, BL 
        MOV AH, 02H 
        INT 21H 
         
        LEA DX, MSG3 
        MOV AH, 09H 
        INT 21H            
          
        MOV DL, BL 
        XOR DL, CHAR 
        MOV AH, 02H 
        INT 21H 
         
         
    EXIT: 
        MOV AH, 04CH 
        INT 21H 
         
    END MAIN  
     
    ;-----THE TRICK IS TO XOR-ING INPUT WITH 20H WHICH IS SPACE 
    ;-----THANKS FOR WATCHING, SUBCRIBE FOR MORE PROJECTS :) 

HERE IS THE OUTPUT OF THE PROGRAM



Toggle Case Program In Assembly Language Small To Capital
Toggle Case Program In Assembly Capital To Small

 

Using Multiple Loops in Intel 8086 Assembly Programming



TITLE PUCHTAA 
.MODEL SMALL 
.STACK 100H 
.DATA 
 
 
.CODE 
    MAIN: 
        MOV AX, @DATA 
        MOV DS, AX 
         
        MOV CL, 37H 
    LOOP1: 
        MOV DL, CL 
    LOOP2: 
        MOV AH, 02H 
        INT 21H 
         
        DEC DL 
        CMP DL, 30H 
        JNE LOOP2 
         
        MOV DL, 0AH 
        MOV AH, 02H 
        INT 21H 
         
         
        MOV DL, 0DH 
        MOV AH, 02H 
        INT 21H 
         
         
        DEC CL 
        CMP CL, 30H 
        JNE LOOP1 
         
          
         
        MOV AH, 04CH 
        INT 21H 
    END MAIN 

HERE IS OUTPUT OF THE PROGRAM

TUTORIAL ON USING MULTIPLE LOOPS IN ASSEMBLY LANGUAGE PROGRAMMING

Sunday, March 1, 2020

Sunday, June 23, 2019

Adding Two Single Digit Decimal Numbers in Assembly Language : Code Available


This program adds two single digits decimal numbers with carry. Click to download the Code

TITLE SINGLE_ADD
.MODEL SMALL
.STACK 100H
 .DATA
     DIGIT1 DB 0AH, 0DH, "ENTER FIRST DIGIT: $"
     DIGIT2 DB 0AH, 0DH, "ENTER SECOND DIGIT: $"
     RESULT DB 0AH, 0DH, "RESULT IS $"  
.CODE
     MAIN:
     MOV AX, @DATA
     MOV DSAX

     LEA DX, DIGIT1
     MOV AH09H
     INT 21H
    
MOV AH01H
     INT 21H

     MOV BLAL

     LEA DX, DIGIT2
     MOV AH09H
     INT 21H

     MOV AH01H
     INT 21H

     MOV BHAL
     ADD BHBL

     MOV ALBH
     MOV AH00H
     AAA

     MOV BLAL
     MOV BHAH

     LEA DX, RESULT
     MOV AH09H
     INT 21H

     MOV DLBH
     ADD DL30H
     MOV AH02H
     INT 21H

     MOV DLBL
     ADD DL30H
     MOV AH02H
     INT 21H

     MOV AH, 4CH
     INT 21H
    END MAIN 

OUTPUT OF THE PROGRAM

Adding Two Single Digit Decimal Numbers in 8086 Assembly Language

Complete Video Tutorials