Professional Documents
Culture Documents
Lab Report Week 5
Lab Report Week 5
DE-43 Mechatronics
Syndicate – B
LAB REPORT # 5
LOGIC AND COMPARE INSTRUCTION SETS
Introduction:
The objectives for our lab was to gain a comprehensive understanding of the logical
instructions in assembly language and employ them to address real-world challenges through
assembly programming, utilizing rotate instructions within the assembly language
framework and use compare instructions in assembly language programming.
Objective:
Compare instructions are indispensable for enabling conditional branching and
decision-making within program structures. logical instructions include operations such as
bitwise AND, OR, XOR, and bit shifting. Our primary objective is to understand and use
these operations to understand the practical utility of these instructions in terms of optimizing
code performance and providing control over microprocessor execution.
R1 1 0 1 0 1 1 0 1
R2 1 1 1 0 0 1 0 1
Result 1 0 1 0 0 1 0 1
Logical OR (ORL):
The ORL (OR Logical) assembly language instruction is a fundamental operation used in
low-level programming to perform bitwise logical OR operations between two binary values.
The ORL instruction operates by taking two binary inputs, typically provided as operands,
and computes their logical OR result on a bit-by-bit basis.
R1 1 0 1 0 1 1 0 1
R2 1 1 1 0 0 1 0 1
Result 1 1 1 0 1 1 0 1
R1 1 0 1 0 1 1 0 1
Result 0 1 0 1 0 0 1 0
R1 1 0 1 0 1 1 0 1
R2 1 1 1 0 0 1 0 1
Result 0 1 0 0 1 0 0 0
instruction operates by taking a binary input, typically provided as an operand, and rotates its
bits to the right, with the rightmost bit becoming the new leftmost bit.
Operand: 11011010B
Operand: 11011010B
Operand: 11011010B
Carry Flag: 1
Operand: 01101100B
Carry Flag: 1
The RRC (Rotate Right through Carry) instruction which is used for bitwise rotation of
binary values to the right while considering the carry flag. The RRC instruction takes a binary
input, typically provided as an operand, and rotates its bits to the right. The rightmost bit
moves to the leftmost position.
Operand: 11011010B
Carry Flag: 1
Operand: 01101101B
Carry Flag: 0
Lab Task 1:
Lab task 2: