Docsity

Assembly Language Programming: An Example of Arithmetic Operations - Prof. M. Ali, Study notes of Operating Systems

Partial preview of the text

Download Assembly Language Programming: An Example of Arithmetic Operations - Prof. M. Ali and more Study notes Operating Systems in PDF only on Docsity!

^

^  

 ^



^

int a,

b, c,

d;

Source.. .a = b + c;d = a - 100;

; Code

for a = b + cload^

R3,b load^

R4,c add^

R3,R

store

R3,a

Assembly Language^ ;^ Code

for d = a - 100load^

R4,=

subtract

R3,R

store

R3,d

^  

 

  ^

 



^ 

^  

^

^

^ &

"^ 

^

^ .

^ &

^ /)

Data^ might be fetched as a result of execution

^  

 ^

0

  ^





 

^ 

1   ^1    !

^23

^ 

^ &#

^  

 ^

9

^1

:

^ 

 



^ ""

^2 " 

^2 " 

^8 "!

^  

^  

 ^

<

 

^





=#

"

int a,

b, c,

d;

Source.. .a = b + c;d = a - 100;

; Code

for a = b + cload^

R3,b load^

R4,c add^

R3,R

store

R3,a

Assembly Language^ ;^ Code

for d = a - 100load^

R4,=

subtract

R3,R

store

R3,d

^  

 ^

B

.

C /

)

%!

^  

 ^

BB

$

 D

^ * ,

^ "

%"^

$^  E

^4

^  ^ !

^  

 ^

B

^

%



^

^  

 ^

B

^

%



^ 

^ ^

^ ^8

=^

^ &^8

=^

^ &

=^

^ 

2^8

^  

 ^

B^5

&# 

&#

 

 !! ^    

2 ^   !! &#

^  

 ^

B^9

&#  

 !! 

,

!

"



&#

2 ^2

^  

 ^

B?

&#  

 !! 

^ &#

 ^

write

Prints info

^  

 ^



&# &

#





^ ^

^

^ 

^ 

 ^

 ^

OS could provide higher leveloperations to application than theone Driver presents to it