Okay, so I'm getting into this and I can work out which bits are calling something and which bits are program flow, but I'm not clear on how to check the return values?
For instance - if we look at this bit
Right, so we load VECT_COMCREATEDATA(0x13) and the test value 123 into the registers and then call the system_call. We then compare ra3 to COM_BUF_OK and JUMP if NOT EQUAL to the Again label (so,it's a loop)
So, I'm doing that like that
Edit: So, this is as far I've got - which isn't very far
So far so good, but how do I get the retval from the system call?
Apologies for the stupid questions - I can follow ASM easily enough, but I've only used inline ASM from within C for pretty basic things before
For instance - if we look at this bit
Code:
ldb rw3, VECT_COMCREATEDATA
ldb rb3, 123
calr SYSTEM_CALL
cpb ra3, COM_BUF_OK
jr ne, AgainRight, so we load VECT_COMCREATEDATA(0x13) and the test value 123 into the registers and then call the system_call. We then compare ra3 to COM_BUF_OK and JUMP if NOT EQUAL to the Again label (so,it's a loop)
So, I'm doing that like that
Code:
if(wWaitTime1==0)
{
u8 again;
again=0;
/* Create buffer of four 123 bytes for sending */
while(again<4)
{
// VECT_COMCREATEDATE=0x13
__asm("ldb rw3, 0x13");
__asm("ldb rb3, 123");
__asm("calr SYSTEM_CALL");
__asm("ldb l,ra3"); // Should push the ra3 value to the stack?
PrintDecimal(SCR_FORE_PLANE,0,0,5,ra3,2);
if(ra3==COM_BUF_OK)
{
again++;
}
NegotiateTimeout++;
PrintDecimal(SCR_FORE_PLANE,0,0,6,NegotiateTimeout,5);
if(NegotiateTimeout>=1024) again=4;
}
}So far so good, but how do I get the retval from the system call?
Apologies for the stupid questions - I can follow ASM easily enough, but I've only used inline ASM from within C for pretty basic things before

