I have some problems with 8085 assembly in this code
That is ,I need the user to write MOV then enters the Rs,and Rd and copies the contents of rs to rd and then display it please any one can help me
and how I can write a line ofcode that allows the user to write e.g MOV A,B at once
thanks
Code:
#include<iostream.h>
#include<string.h>
Void error();
Main()
{
Char opcode;
Char rs;
Char rd;
Char vrs;
Void error()
{ cout<<"Incorrect Reg.name,try again "<<endl; }
Xxx: cout<<"\n Enter the Opcode "<<endl;
Gets(opcode);
Toupper(gets(opcode));
If(opcode!='MOV')
{
Cerr<<"\t Incorrect opcode,try again"<<endl;
Goto xxx;
}
Else
Error(); goto xxx;
Gets(rs);
Toupper(gets(rs));
If(rs=='A'||rs=='B'||rs=='C'||rs=='D'||rs=='E'||rs=='H'||rs=='L')
{
Cout<<"\n Enter its value in Hexadecimal "<<endl;
Cin>>vrs;
Yyy :Cout<<"Enter the Destination Reg.Name "<<endl;
Gets(rd);
Toupper(gets(rd));
If(rd=='A'||rd=='B'||rd=='C'||rd=='D'||rd=='E'||rd=='H'||rd=='L')
Cout<<" "<<endl;
Else
{Error(); goto yyy; }
_asm
{
MVI rd,0; Clear the det.reg.
MVI rs,vrs; load the value to source reg
Mov rd,rs;
MOV ? ,[rd]; save for output later
} ; what I will use for ? to transfer the contents to Rd
Cout<<"("<<rs<<")=" <<vrs<<endl; // show (Rs) contents
Cout<<"("<<rd<<")="<< ?<<endl; //show (rd) contents
Return 0; }

