Professional Documents
Culture Documents
Microprocessors & Microcontrollers Note
Microprocessors & Microcontrollers Note
AX: This is the accumulator. It is of 16 bits and is divided into two 8-bit registers
AH and AL to also perform 8-bit instructions. It is generally used for arithmetical
and logical instructions but in 8086 microprocessors.
BX: This is the base register. It is of 16 bits and is divided into two 8-bit registers
BH and BL to also perform 8-bit instructions. It is used to store the value of the
offset.
SI- This is the source index register. It is of 16 bits. It is used in the pointer
addressing of data and as a source in some string related operations. ... It is used in
the pointer addressing of data and as a destination in some string related
operations.
DI- This is the destination index register. It is of 16 bits. It is used in the pointer
addressing of data and as a destination in some string related operations. Its offset
is relative to extra segment.
A DB “Something $”
. CODE
MAIN PROC
MOV DS, AX
MOV AH, 9
LEA DX, A
INT 21H
DIVISION:
Reminder – AH
Result- AL
AH 0 korte hobe
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV DS, AX
MOV AH, 9
LEA DX, A
INT 21H
MOV AH, 1
INT 21H
SUB AL, 48
MOV BL, AL
MOV AH, 9
LEA DX, B
INT 21H
MOV AH, 1
INT 21H
SUB AL, 48
MOV AH, 0
DIV BL
MOV BL, AL
MOV BH, AH
MOV AH, 9
LEA DX, C
INT 21H
MOV AH, 2
MOV DL, BL
ADD DL, 48
INT 21H
MOV AH, 9
LEA DX, D
INT 21H
MOV AH, 2
MOV DL, BH
ADD DL, 48
INT 21H
EXIT:
INT 21H
MAIN ENDP
END MAIN
MULTIPLICATION:
Multiplicatin e AL e ekta value thaktei hobe
MOV CX, AX jate 2 digit er sonkhao print korte pari emne to amra just AL part ta
print kori but AH part ta harai jai
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV DS, AX
MOV AH, 9
LEA DX, A
INT 21H
MOV AH, 1
INT 21H
SUB AL, 48
MOV BL, AL
MOV AH, 9
LEA DX, B
INT 21H
MOV AH, 1
INT 21H
SUB AL, 48
MUL BL
AAM
MOV CX, AX
MOV AH, 9
LEA DX, C
INT 21H
MOV AH, 2
MOV DL, CH
ADD DL, 48
INT 21H
MOV AH, 2
MOV DL, CL
ADD DL, 48
INT 21H
EXIT:
INT 21H
MAIN ENDP
END MAIN
Conditional statement:
CMP: Compare
JG: Greater hoile jao to....
JLE: Less then hoile jao to....
JE: Equal hoile jao to....
JNE: Not Equal hoile jao to....
JMP: Jump to....
INC: increment
DEC: decrement
Summation of 1+3+5+7+......+99:
.MODEL SMALL
.STACK 100H
.DATA
JOG DW ?
.CODE
MAIN PROC
MOV DS, AX
SUM:
MOV JOG, AX
LOOP SUM
MAIN ENDP
END MAIN
.MODEL SMALL
.STACK 100H
.DATA
BOB DB 5 DUP(?)
MARLI DB 5 DUP(0)
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV CX,5
PRINT 'Enter 5 values for BOB- '
INPUT:
MOV AH,2
MOV DL,32
INT 21H
MOV AH,1
INT 21H
MOV [SI],AL
MOV BL,[SI]
MOV AH,32
INC SI
LOOP INPUT
MOV CX,5
NEWLINE:
MOV AH,2
MOV DL, 10
INT 21H
MOV AH,2
MOV DL, 13
INT 21H
MOV AH,2
MOV DL,32
INT 21H
MOV AH,2
MOV BL,[SI]
MOV [DI],BL
INT 21H
MOV AH,2
MOV DL,[DI]
INT 21H
INC SI
INC DI
LOOP OUTPUT
EXIT :
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN