0% found this document useful (0 votes)
15 views6 pages

Micro, Ass 1

The document contains an assignment for an assembly language class. It includes 5 questions asking students to write assembly code that performs specific operations and provides the results. Students are asked to provide screenshots from DOSBox to demonstrate the results of running the code.

Uploaded by

LANA ESAM
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)
15 views6 pages

Micro, Ass 1

The document contains an assignment for an assembly language class. It includes 5 questions asking students to write assembly code that performs specific operations and provides the results. Students are asked to provide screenshots from DOSBox to demonstrate the results of running the code.

Uploaded by

LANA ESAM
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/ 6

Ajman University

College of Engineering and Information Technology


Department of Electrical and Computer Engineering

BME301: Microcontroller & Comp. Interface


Theory Instructor: Dr. Muhammad Akmal Chaudhary
Laboratory Instructor: Engr. Ahmed Osman
Section: Thursday 3:30 – 5:30 PM
Assembly Language Assignment
Name and ID:

- Lana Isam-202111215
- Hadeel Hisham-202111207

Comments & Marks:

__________________________________________________________________________________________

__________________________________________________________________________________________

______________________________________________________________________________

6 / 10 / 2023
Answer all 5 questions and provide screenshots from DOSBox for every part of each
question.

Question 1:

For the following Assembly language instructions:

MOV AX, 1234

MOV [1500], AX

MOV AX, 5678

MOV BX, [1500]

HLT

Show the contents of the AX register, BX register, and the memory location 1500 and 1501.
Question 2:

Which of the following statements give an error when written in the Debug function of the
DOSBox and which is accepted. If the statement gives an error explain the reason.

- MOV AL, 1234

AL is an 8-bit register, and since our data is 16-bit we can’t fit it inside the register (error).
- MOV AX, 1234 (This statement would not produce an error).
- MOV SI, 1234 (This statement would not produce an error).
- MOV [AX], 1234

This instruction will give us errors. Since the square bracket indicates (indirect addressing) and
we can’t store 16-bit data like the given data directly into a memory location pointed to by AX
we should first use instructions like MOV [BX], AX to be able to store the value in the memory
location provided.
for example: MOV [1000], AX to store the value of AX at memory address 1000.
- MOV [SI], 1234

You cannot directly store a 16-bit immediate value into a memory location pointed to by SI. You
need to specify a valid memory address instead of the immediate value.
- MOV [SI], AX (This statement would not produce an error).
Question 3:

Write an assembly code that initializes the Registers AX, BX, and CX with the values 1234,
5678, and ABCD respectively then exchange their values using the Stack so that the final values
for them are AX = 5678, BX = ABCD, and CX = 1234.

MOV AX,1234

MOV BX,5678

MOV CX, ABCD

PUSH AX

MOV AX, BX

MOV BX, CX

POP CX

HLT
Question 4:

Write an assembly code that triggers both the Parity and the Sign flags at the same time. (i.e.,
changes the parity flag from PO to PE and the sign flag from PL to NG).

MOV AX,0000

ADD AX, -3

ADD AX, -4

HLT
Question 5:

Show the content of the AX and BX registers after executing each line of the following code.

- MOV AL, 5
- MOV BL, A
- OR AL, BL
- AND AL, BL
- NOT AX
- XOR AL, BL

You might also like