Re: A83: ROMcall reference [83]


[Prev][Next][Index][Thread]

Re: A83: ROMcall reference [83]




In accordance with the prophecy, Henk Poley uttered:

> Some new ones, maybe a bit fast after the last one,
> but I think with Christmas, New Year and the rest,
> people will be busy with other things for a wile.
> 
> 	Henk Poley

> +- _sysErrHandler

Dan Englender wrote that calling this will abort your program and display the
error screen. This may be true, but that is not really the purpose of the routine.
You can push and pop error handlers. They are stored as structures on the
hardware stack. When an error occurs, an error routine (e.g. _ERRNOTENOUGHMEM)
is called. This routine puts an error code in the accumulator (or somewhere in
memory, I don't remember) and calls the error handler at the top of the stack.
This error handler can then catch the error (like catch in Java) or pass it on
to the next error handler on the stack. At the bottom of the stack is the system
error handler, and _sysErrHandler tells us where in the ROM it is. That doesn't
mean we should ever call _sysErrHandler. (There are even floating point
constants in the ROM that have stubs in rompage 12; just because we can call
them doesn't make them any useful. =))

> +- _A2POINTHLIND
> +- _POINTHLIND

>From the comments I wrote on my game Stranded (you can get the text file at
http://linusworld.cjb.net):

_POINTHLIND     This routine will add a to hl, and then read the word found
                at that address. The word is returned in hl. So, if I had
                a table

                         defw 0
                         defw 1000
                         defw 2000
                         defw 3000
                         .
                         .

                and I wished to multiply a by 1000, I'd add a to itself to get
                an index into the table, and then call _POINTHLIND, and I'd get
                the result in hl.


_A2POINTHLIND   When calling _POINTHLIND, it appears that you so often added
                a to itself first, that a new romcall was added to do it for you.
                So _A2POINTHLIND will add a to itself, and then drop through to
                _POINTHLIND.

> And how do you feel, standing on the doorsteps of a new Millenium?
> 

It's a rather cool feeling. However, according to the Discordian calendar, we're
at the year 5999. That means we get a millenium shift the next year too. =)

Linus
---------------------------------------------------------------------------
F U CN RD THS U CNT SPL WRTH A DM!




References: