Uploaded by faizahmed2323

Assignment#3

advertisement
c
North Campus
Summer Semester 2021
Subject
Faculty
Microprocessor Based System /
Microprocessor & Assembly Language (3+1)
Engr. Syed Rizwan
Student Name:
Student ID:
Program
BS-CS
Dated:
OBE: CLO-2,3 PLO-1,2,3 and C-
Assessment Activity
Assignment #3
Wight (Max.
Marks)
Semester
Summer 2021
Section Code
33% (15)
1. Write ADD instructions that will:
a) add BX to AX
b) add 12H to AL
c) add EDI and EBP
d) add 22H to CX
e) add the data addressed by SI to AL
f) add CX to the data stored at memory location FROG
g) add 234H to RCX
2. What is wrong with the ADD RCX, AX instruction?
3. If AX = 1001H and DX = 20FFH, list the sum and the contents of each flag register
bit (C, A, S, Z, and O) after the ADD AX, DX instruction executes.
4. Develop a short sequence of instructions that adds AL, BL, CL, DL, and AH. Save
the sum in the DH register.
5. Develop a short sequence of instructions that adds AX, BX, CX, DX, and SP. Save
the sum in the DI register.
6. Develop a short sequence of instructions that adds ECX, EDX, and ESI. Save the
sum in the EDI register.
7. Develop a short sequence of instructions that adds RCX, RDX, and RSI. Save the
sum in the R12 register.
8. Write an instruction that adds BX to DX, and also adds the contents of the carry
flag (C) to the result.
9. Write an instruction that adds 1 to the contents of the SP register.
Page 1 of 2
10.Write SUB instructions that will:
a)
b)
c)
d)
e)
f)
g)
h)
subtract BX from CX
subtract 0EEH from DH
subtract DI from SI
subtract 3322H from EBP
subtract the data address by SI from CH
subtract the data stored 10 words after the location addressed by SI from
DX
subtract AL from memory location FROG
subtract R9 from R10
11.If DL = 0F3H and BH = 72H, list the difference after BH is subtracted from DL
and show the contents of the flag register bits.
12.Write a short sequence of instructions that subtracts the numbers in DI, SI, and
BP from the AX register. Store the difference in register BX.
13.Choose an instruction that subtracts 1 from register EBX
_________________________
Faculty Signature
Page 2 of 2
Download