BASICTrans_Error.

Ralph Corderoy ralph at inputplus.co.uk
Thu Nov 7 13:36:25 GMT 2002


Hi Tony,

> > I've now read page 4-339 and it says the SWI puts a \0-terminated
> > string at R1 so OSLib's definition is wrong.  My defmod's poor.  Is
> > this the right definition?
> > 
> >     SWI BASICTrans_Error = (NUMBER 0x42C81 "Copy translated error string to
> >           buffer",
> >           ENTRY (R0 = .Int: error_no,
> >           R1 = .Ref .String: error_buffer),
> >           EXIT (R0?, R1?, R2?, R3?));
> > 
> 
> It looks like you're right. I'll amend it soonest. Thanks.

No problem.

> > > As an aside, is it documented what BASICTrans does if R0 < 0 or R0
> > > > largest valid error number (112 for RO 3.11)?
> > 
> > It doesn't seem to be, and trying it doesn't result in the V-flag
> > being set, just junk at R1?
> 
> It's documented (4-339) that an error is generated ... if BasicTrans
> does not perform the translation. I would expect that to mean that if
> R0 is out of range, it would generate an error. From your experiments,
> evidently not...

A disassembly of RO 3.11 also suggests it just wanders off into some bit
of unintended memory and just strcpys what it finds there to R1.  I
guess riscose should check and abort the emulation.

Thanks,


Ralph.




More information about the oslib-user mailing list