0% found this document useful (0 votes)
46 views1 page

Prog 10

Uploaded by

api-3705912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views1 page

Prog 10

Uploaded by

api-3705912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

##################################################

#########################

Program for computing 22/7

##################################################
#########################

.aseg value,data
.org 30h
deci .dsb 5
.rseg code,code
mov a,#22d ;moving 22 into A
mov b,#07d ;moving 7 into B
div ab ;Division
mov r0,#deci
mov @r0,a ;Storing result into the memory
locations
inc r0
mov r2,#05h
loop:
mov a,b ;Moving remainder into A
mov b,#10d
mul ab ;Multiplying it with 10
mov b,#07h
div ab ;Dividing with 7
mov @r0,a ;Storing it into memory
inc r0
djnz r2,loop ;Repeat for 5 times
nop
nop
.end

You might also like