You are on page 1of 2

<!

DOCTYPE html>
<html lang="en">
<head> <meta charset="utf-8">
<title> </title>
<style>
*{margin: 0;padding: 0;}
.main{width: 900px;margin: auto;}
.topic{margin: 20px 0;box-shadow: 0 2px 5px 0 rgba(0,0,0,0.2);border-radius:
6px;}
.t1 {padding: 10px;}
.topic img{
max-width: 100%;
}
.pbImageToTextHint{display: none;}
.t2 li{list-style: none;border: 1px solid #ccc;}
.answer-given-body p img{
width: auto !important;height: auto!important;max-width: 100% !
important;
}
.hidden {visibility:hidden; }
</style>
</head>
<body>
<div class="main"> <h2> Question:<span class="title"></span></h2> <div
class="topic t1"> <div class="pbImages"><img src="" /> </div>
</div> <div class="topic t2"><div><p><sup>1)To find cube of a number in 8086
microprocessor using assembly language programming</sup></p>
<p><sup>Procedure:</sup></p> <p><sup>At first, We need to give a memory address
from where to start our program. Here i took 400 memory location in our program.And
following process will help to find cube of a number.</sup></p> <p>&#160;</p>
<table> <tbody> <tr> <td><sup>MEMORY ADDRESS</sup></td>
<td><sup>MNEMONICS</sup></td>
<td><sup>COMMENT</sup></td> </tr> <tr>
<td><sup>400&#160;</sup></td> <td><sup>MOV SI,
500</sup></td> <td><sup>&#160;SI&lt;-500</sup></td> </tr>
<tr> <td><sup>403</sup></td>
<td><sup>&#160;MOV CL, [SI]&#160;</sup></td> <td><sup>CL&lt;-
[SI]</sup></td> </tr> <tr> <td><sup>405</sup></td>
<td><sup>MOV CH, 00</sup></td> <td><sup>CH&lt;-
00</sup></td> </tr> <tr> <td><sup>407</sup></td>
<td><sup>&#160;INC SI&#160;&#160; </sup></td>
<td><sup>&#160;&#160;&#160;SI&lt;-SI+1</sup></td> </tr>
<tr> <td><sup>408</sup></td> <td><sup>MOV AL,
[SI]&#160;&#160; </sup></td> <td><sup>&#160;AL&lt;-[SI]</sup></td>
</tr> <tr> <td><sup>40A</sup></td>
<td><sup>MOV BL, AL</sup></td>
<td><sup>&#160;BL&lt;-AL</sup></td> </tr> <tr>
<td><sup>40C</sup></td> <td><sup>MUL
AL&#160;&#160;</sup></td> <td><sup>AX=AL*AL</sup></td> </tr>
<tr> <td><sup>40E</sup></td> <td><sup>MUL
BL&#160;&#160;</sup></td> <td><sup>AX=AL*BL</sup></td> </tr>
<tr> <td><sup>4010</sup></td> <td><sup>MOV
[SI], AL</sup></td> <td><sup>&#160;AL-&gt;[SI]</sup></td>
</tr> <tr> <td><sup>412</sup></td>
<td><sup>INC SI&#160;&#160;</sup></td> <td><sup>&#160;
&#160;SI&lt;-SI+1</sup></td> </tr> </tbody> </table> <p><sup>&#160;
&#160;&#160;<br/> <br/> program:</sup></p> <p><sup>MOV SI, 500<br/> MOV CL,
[SI]<br/> MOV CH, 00<br/> INC SI<br/> MOV AL, [SI]<br/> MOV BL, AL<br/> MUL AL<br/>
MUL BL<br/> MOV [SI], AL<br/> INC SI<br/> LOOP 408<br/> HLT<br/> Explanation
&#8211;(The above instructions are explained below) and the memory address starts
from 400 memory location</sup></p> <p><sup>MOV SI, 500: set the value of SI to
500(SI means for source indexing register)<br/> MOV CL, [SI]: load data from offset
SI to register CL( CL is general purpose register)<br/> MOV CH, 00: set value of
register CH to 00(CH is general purpose register)<br/> INC SI: increase value of SI
by 1.<br/> MOV AL, [SI]: load value from offset SI to register AL<br/> MOV BL, AL:
move value of register AL to BL.<br/> MUL AL: multiply value of register AL by
AL.<br/> MUL BL: multiply value of register AL by BL.<br/> MOV [SI], AL: store
value of register AL at offset SI.<br/> INC SI: increase value of SI by 1.<br/>
LOOP 408: jump to address 408 if CX not 0 and CX=CX-1.<br/> HLT: stop (its called
as halt means stop the program)</sup></p></div></div></div></html>

You might also like