0% found this document useful (0 votes)
123 views10 pages

Assembly Language Jump & Logic Lab

This lab report discusses the use of logical instructions and jump commands in assembly language. It provides 5 code examples demonstrating logical operations like AND, OR, XOR on registers. It also shows the use of jump commands like JMP, JC, JZ, JE based on flag settings. The conclusion discusses the importance of flags and symbols for jumps in assembly. As homework, 2 codes are given - the first uses JE to jump equal, the second uses JO for overflow on subtraction.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views10 pages

Assembly Language Jump & Logic Lab

This lab report discusses the use of logical instructions and jump commands in assembly language. It provides 5 code examples demonstrating logical operations like AND, OR, XOR on registers. It also shows the use of jump commands like JMP, JC, JZ, JE based on flag settings. The conclusion discusses the importance of flags and symbols for jumps in assembly. As homework, 2 codes are given - the first uses JE to jump equal, the second uses JO for overflow on subtraction.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

EAST WEST UNIVERSITY

Lab Report – 02

Course code: ETE316


Course title: Microprocessors and Interfacing

Submitted To :
Rizwan Shaikh
Lecturer
Department of ECE

Submitted By :
Md. Jubaer-Al-Hasan
Id : 2017-2-55-011
Introduction: Both logical instructions and Jump commands are widely used in assembly
language. These commands are explained below.

Objective :

 Using logical instructions in assembly language.


 Incorporating Jump commands in assembly programs.
 Writing simple assembly language programs with logical and Jump instructions.

Code 1:

CODE SEGMENT
ASSUME CS: CODE, DS: CODE
ORG 100H

MOV AX, CS
MOV DS, AX

MOV BX, 3256H


MOV CX, 1554H
AND CX, BX

INT 3
CODE ENDS
END
Code 2:

CODE SEGMENT
ASSUME CS:CODE, DS:CODE

ORG 100H
MOV AX,CS
MOV DS,AX
MOV BX, 3256H
MOV CX, 1554H
XOR CX, BX

INT 3
CODE ENDS
END
Code 3:

CODE SEGMENT
ASSUME CS:CODE, DS:CODE
ORG 100H
MOV AX,CS
MOV DS,AX
MOV AX, 1027H
MOV BX, 5A27H
MOV CX, 54A5H
OR AX, BX
XOR AX, CX
NOT AX
TEST CX, BX
AND CX, AX

INT 3
CODE ENDS
END
Cc

Code 4:

CODE SEGMENT
ASSUME CS:CODE, DS:CODE
ORG 1000H
MOV AX, CS
MOV DS, AX
MOV AX, 7A24H
MOV BX, 15A3H
SUB AX, BX
JMP L3T2
ETE316: ADD BX,AX
JMP Last
L3T2: MOV CX, 45B1H
AND AX, CX
TEST AX, BX
JMP ETE316
Last:
INT 3
CODE ENDS
END

Code 5:
CODE SEGMENT
ASSUME CS:CODE, DS:CODE
ORG 200H
MOV AX,CS
MOV DS,AX
MOV AX, 7A24H
MOV BX, 95A3H
ADD AX, BX
JC L3T2
ETE316: OR AX, 23H
JNZ Last
L3T2: MOV CX, 0FC7H
SUB AX,CX
JZ ETE316

Last:
INT 3

CODE ENDS
END
Conclusion :
Jump is important to keep in mind that assembly language is a low level language. In the
experiment , we can use some symbols like NV NZ NA PO NC. This are called flag. We can
also get the step by step output of the program by using emulator. The program outcomes have
been presented with the achievement of outcome result. When we get the result positive it shows
the PL sign otherwise it would be NG. When we writing code, must be declared code properly
otherwise could not found the result.

Home Task:
Code for home task 1,

CODE SEGMENT
ASSUME CS: CODE, DS: CODE
ORG 1000H
MOV AX, CS
MOV DS, AX

LOWER5: MOV DX, 1


EQUAL5: MOV DX, 2
MOV AX, 0005H
JG HIGH5
JE EQUAL5
JL LOWER5
HIGH5: MOV DX, 0
JMP Last
Last:
INT 3

CODE ENDS
END
It’s clearly shows that we got JE(jump equal) due to that it went to EQUAL5 statement and
stored 2 in DX.

Code for 2 :

CODE SEGMENT
ASSUME CS:CODE, DS:CODE
ORG 1000H
MOV AX,CS
MOV DS,AX

MOV AX, 86B1H


MOV BX, 3F42H

SUB AX, BX
JO ETE316
MOV CX, 1
ETE316: MOV CX, 0
JMP Last
Last:
INT 3
CODE ENDS
END

It’s clearly shows that we got overflow due to subtraction and as condition we stored 0 in cx.

You might also like