8086 AL Commands - Microprocessor And Interfacing

  • INT VALUE
  • Take Character Input
        // Particular key will be stored in "AL" register
        MOV AH, 01H
        INT 21H
    
  • Print Character Output
        // Prints content of "AL" register
        MOV DL, 'A'
        MOV AH, 02H
        INT 21H
    
  • Take String Input & Output
        MSG DB "HELLO WORLD",'$'
    
        // Content is loaded from DX register
        LEA DX, MSG
    
        // Print a String
        MOV AH, 09H
        INT 21H
    
        // Input a String
        MOV AH, 0AH
        INT 21H
    
  • End Code Segment
        MOV AH, 4CH
        INT 21H
    
  • Clear Screen
        MOV AH, 00
        MOV AL, 02
        INT 10H
    
  • Place the Cursor
        MOV AH, 02 // Cursor Position
        MOV BH, 00 // Page Number
        MOV DH, N1 // Row
        MOV DL, N2 // Col
        INT 10H
    
  • Wait until a key is Pressed
        MOV AH, 01
        INT 16H
    
  • Boilerplate
        .MODEL SMALL       // Program uses maximum of 64K of memory for code
        .STACK 100         // Bytes of stack space for the program
    
        .DATA              // Beginning of data segment where variables are stored
            MSG DB "VALUE$"
    
        .CODE              // Beginning of code segment
            MOV AX,@DATA   // Referencing data segment with AX register
            MOV DS,AX
    
            MOV AH,4CH
            INT 21H
        END
    
  • Loop
    • LOOP Label
  • Macro
        // Declaration
        macroName macro parameters
            // Macro Body
        endm
    
        // Calling
        macroName argument
    
        // Include
        include macroName.mac
    
  • Procedure
        // Declaration
        procName PROC
            // Procedure Body
            RET
        procName ENDP
    
        // Calling
        CALL procName
    
        // Include
        include procName.inc
    
Share: