Y
Yuri Vanzine
I have a class with a private member function:
void H6809_CPU::StoreWord(Word Data, Word Address)
{
Memory[Address] = Data >> 8; // High byte of Data
Memory[Address+1] = Data & 0xFF; // Low byte of X
cout<<"Inside Store Word:"<<MemoryWord(Address)<<endl;
}
I call it from another public member function:
cout<<hex<<PC<<endl;
StoreWord(PC,MemoryWord(SP));
cout<<hex<<MemoryWord(SP)<<endl;
MemoryWord(SP) reads 2 elems of the Memory array (private member):
HighByte = Memory[Address];
LowByte = Memory[Address+1];
Here is the problem:
When I run MemoryWord(Address) inside the StoreWord func, I get good values,
but if I run MemoryWord(SP) outside of the StoreWord func, I get
uninitialized 0
Please help!!!!!
yv
void H6809_CPU::StoreWord(Word Data, Word Address)
{
Memory[Address] = Data >> 8; // High byte of Data
Memory[Address+1] = Data & 0xFF; // Low byte of X
cout<<"Inside Store Word:"<<MemoryWord(Address)<<endl;
}
I call it from another public member function:
cout<<hex<<PC<<endl;
StoreWord(PC,MemoryWord(SP));
cout<<hex<<MemoryWord(SP)<<endl;
MemoryWord(SP) reads 2 elems of the Memory array (private member):
HighByte = Memory[Address];
LowByte = Memory[Address+1];
Here is the problem:
When I run MemoryWord(Address) inside the StoreWord func, I get good values,
but if I run MemoryWord(SP) outside of the StoreWord func, I get
uninitialized 0
Please help!!!!!
yv