0% found this document useful (0 votes)
23 views5 pages

Skill - 1

This document provides code examples for performing various logical operations in 8086 assembly language, including AND, OR, XOR, NOT, and shift operations. The code samples demonstrate how to: 1. Perform 8-bit and 16-bit AND operations on values stored in registers. 2. Perform 8-bit OR operations on values stored in registers. 3. Perform 8-bit XOR operations on values stored in registers. 4. Perform 8-bit NOT operations to invert bits of values stored in registers. 5. Perform shift operations like SHL, SHR, SAL, and SAR on 8-bit values stored in registers and memory locations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views5 pages

Skill - 1

This document provides code examples for performing various logical operations in 8086 assembly language, including AND, OR, XOR, NOT, and shift operations. The code samples demonstrate how to: 1. Perform 8-bit and 16-bit AND operations on values stored in registers. 2. Perform 8-bit OR operations on values stored in registers. 3. Perform 8-bit XOR operations on values stored in registers. 4. Perform 8-bit NOT operations to invert bits of values stored in registers. 5. Perform shift operations like SHL, SHR, SAL, and SAR on 8-bit values stored in registers and memory locations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

K L Deemed to be University

Department of EEE – KLVZA

Embedded Controllers- 19EC2106

Skill Exercise-1

1. Data transfer, Arithmetic instructions & Logical operations using 8086.

For Data transfer and Arithmetic instructions every student should take their own data and
perform the operations.

Logical Operations:
a. AND operation

org 100h

; LOGICAL AND OPERATION 8-BIT & 16-BIT


; DATA IS IN AL & BL RESULT IS IN AL FOR 8-BIT
; DATA IS IN CX & DX RESULT IS IN CX FOR 16-BIT
.CODE
START:
MOV AX,0H
MOV BX,0H
MOV CX,0H
MOV DX,0H
MOV AL,0FFH
MOV BL,0C5H
AND AL,BL
MOV CX,0FC65H
MOV DX,12EFH
AND CX,DX
ret
b. OR operation
org 100h
.CODE

START: MOV AX,0H


MOV BX,0H
MOV CX,0H
MOV DX,0H
MOV AL,0FFH
MOV BL,0C5H
OR AL,BL
MOV CX,0FC65H
MOV DX,12EFH
OR CX,DX

ret

c. XOR operation
org 100h

.CODE

START: MOV AX,0H


MOV BX,0H
MOV CX,0H
MOV DX,0H
MOV AL,0FFH
MOV BL,0C5H
XOR AL,BL
MOV CX,0FC65H
MOV DX,12EFH
XOR CX,DX

ret

d. NOT operation
org 100h

.CODE

START: MOV AX,0H


MOV BX,0H
MOV AL,0C5H
NOT AL
MOV BX,0FC65H
NOT BX

ret
e. SAL, SHL, SAR, SHR operations
org 100h

; SHIFT OPERATION OF 8-BIT


; SHL,SHR,SAL,SAR

.DATA
NUM1 DB 9AH
NUM2 DB 7DH
NUM3 DB 0A2H
NUM4 DB 9FH
CNT EQU 02H

.CODE
START: MOV AX,@DATA
MOV DS,AX
MOV CL,CNT
MOV AX,0H
MOV AL,NUM1
SHL AL,1
MOV AL,NUM2
SHR AL,1
MOV AL,NUM3
SAL AL,1
MOV AL,NUM4
SAR AL,1
MOV AL,NUM1
SHL AL,CL
MOV AL,NUM2
SHR AL,CL
MOV AL,NUM3
SAL AL,CL
MOV AL,NUM4
SAR AL,CL
ret

Note : after execution every exercise should be given inference and analysis and should write finally
result of the experiment.

You might also like