Lab Report 4
Lab Report 4
Lab Report: 04
Class: COMP-261L
Name: Jamal Ahmed Khan
Registration No.: B20F0358CS022
Semester: 3rd
Submitted to: Sir Rafiullah
__________________
Instructor Signature
Lab No. 04
Arithmetic Instructions
Software Required:
EMU8086 Software
Objectives
Lab Tasks:
.code
main proc
mov bl,10011010b ;storing value in bl register
mov cx,8 ;value of counter is 8,loop will run 8 times
mov bh,0 ;bh register count the number by 0's
here:
shr bl,1 ;shift right bl register by 1
jc noadd ;increament bh register if cf is zero otherwise jump to noadd<lebel>
inc bh
noadd:
loop here
mov al,bh ;move value of bh in al
main endp
endp main
output:
Code:
.model small
.stack 100h
.data
.code
main proc
mov di,1001010110101010b
mov ax,0000000000011111b
or di,ax
mov si,di ;move di value into si
main endp
endp main
output: