Re: [cc65] signals

From: dominic beesley <dominic1brahms.demon.co.uk>
Date: 2005-05-30 17:49:33
Ullrich von Bassewitz wrote:

>On Sun, May 29, 2005 at 12:51:15PM +0100, dominic beesley wrote:
>  
>
>>That's what I'm trying to do. However the BBC OS returns errors by
>>issuing a BRK instruction
>>so it means hanging off the interrupt vector somewhere. 
>>    
>>
>
>That's an interesting way to handle errors. How are error codes passed? Are
>they loaded into a register prior to the BRK?
>
>  
>
The "standard" is to have the byte after the BRK as an errorcode 
followed by a NULL
terminated string. Makes for very compact code in the OS ROMS but can be 
a pain in
the arse when writing code. (In the Risc OS operating system they 
recognised this and
have two forms of each call, one that issues something like BRK and one 
that returns
with carry set). The OS provides a separate vector for the BRK interrupt 
and it prepares
some zero-page registers with the PC value when the BRK happened. You 
can either
handle it or it drops back into the current language (usually BASIC) and 
lets it handle it.

>>I've
>>given up (for now) on signals
>>as suggested for these, but might need something later, I've just got to
>>work out whether BRK
>>signals may be received when not in an OS function.
>>    
>>
>
>Ok.
>  
>

A further thought on this... If I trap escape during OS functions (and 
set a flag that is
checked on return) would this make Escape handling safer....?

>Regards
>
>
>        Uz
>
>
>  
>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon May 30 23:12:01 2005

This archive was generated by hypermail 2.1.8 : 2005-05-30 23:12:04 CEST