Sunday, November 11, 2007

A Micro Program

ORG 0000H

MVI B,25H

MVI A,25H

ADD B

DAA ;THE ANSWER IS 15+25=40, BASE-10

HLT

END

News



/**
* Write a description of class factorial here.
* Fraction
* @author (your name)
* @version (a version number or a date)
*/
public class factorial
{
int x;
double y;
void display(int n)
{
x=n;
int f=1,i;
int j;
double fact1=1.0;
double sum=0.0;
for(i=1;i<=n;i++)
{

for(j=1;j<=x;j++)
{
fact1=fact1*j;
}
sum=sum+i;
System.out.print(sum+" ");

}
}
double fact()
{


y=fact1;
return y;

}

}

Saturday, November 10, 2007

Microprocessor Program

WAP to find the biggest of three numbers
ORG 0000H
LXI H,0085H
MVI B,03H
MVI A,00H
QQ: CMP M ;IF (A>M),THEN JUMP WITH NO CARRY
JNC PP
MOV A,M
PP: INX H
DCR B
JNZ QQ
STA 0090H
HLT
END
ORG 0085H
DB 28H,03H,38H