0% found this document useful (0 votes)
6 views3 pages

Microprocessor Lab Report: Bit Operations

The document is a lab report for the course EEE-364 at Chittagong University of Engineering and Technology, focusing on microprocessor operations. It includes a set of problems requiring assembly language programs and corresponding machine codes for tasks such as bit masking, multiplication, data packing, and data unpacking. Each problem specifies the initial values in registers and the expected final values, along with a template for coding solutions.
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)
6 views3 pages

Microprocessor Lab Report: Bit Operations

The document is a lab report for the course EEE-364 at Chittagong University of Engineering and Technology, focusing on microprocessor operations. It includes a set of problems requiring assembly language programs and corresponding machine codes for tasks such as bit masking, multiplication, data packing, and data unpacking. Each problem specifies the initial values in registers and the expected final values, along with a template for coding solutions.
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

Department of Electrical and Electronic Engineering

Chittagong University of Engineering and Technology

Course Code: EEE-364


Course Title: Microprocessor and Interfacing Sessional

Lab Report No: 04

Experiment Name: Logical, Shift and Rotate Operations

Lab Report Problem Set


Instructions: For each problem, write the assembly language program to solve the task.
Then, write the corresponding machine code for each instruction. Assume all programs start
at address ‘0100h‘.

Problem 1: Bit Masking


The ‘AL‘ register contains the value ‘55h‘.

1. First, clear bits 2 and 3.

2. Then, set bits 6 and 7.

What is the final value in ‘AL‘?


Final Value in AL:
Code:

Table 1: Code for Problem 1


Address Assembly Code Machine Code (Hex)
(Mnemonic)
0100 MOV AL, 55h B0 55
0102
0105
0107 INT 3 CC

1
Problem 2: Multiplication by 5
The ‘BL‘ register contains the value ‘12h‘. Multiply this value by 5 using only ‘MOV‘, ‘ADD‘,
and ‘SHL‘ instructions. Store the final result in the ‘AX‘ register (clear ‘AH‘ first to be safe).
Final Value in AX:
Code:

Table 2: Code for Problem 2


Address Assembly Code Machine Code (Hex)
(Mnemonic)
0100
0102
0104
0106
0108
010A INT 3 CC

Problem 3: Data Packing


You have two 4-bit numbers (nibbles). The upper nibble, ‘07h‘, is in the ‘AH‘ register. The
lower nibble, ‘09h‘, is in the ‘AL‘ register. Combine these two nibbles into a single byte in the
‘AL‘ register, so that ‘AL‘ contains the value ‘79h‘.
Final Value in AL:
Code:

Table 3: Code for Problem 3


Address Assembly Code Machine Code (Hex)
(Mnemonic)
0100
0102
0104
0106
0108
010A INT 3 CC

Problem 4: Data Unpacking (Isolation)


The ‘AL‘ register contains the value ‘C5h‘ (binary ‘1100 0101b‘). Isolate the middle four bits
(bits 5, 4, 3, 2) and store this 4-bit value, normalized (shifted to the right so it’s a value between
0 and 15), in the ‘BL‘ register.
Final Value in BL:
Code:

2
Table 4: Code for Problem 4
Address Assembly Code Machine Code (Hex)
(Mnemonic)
0100
0102
0104
0106
0108
010A INT 3 CC

You might also like