[A83] Re: statvars...??? [Ti83+]


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

[A83] Re: statvars...??? [Ti83+]




This however still doesn't resolve the fact that the constant use of shadow
registers would most likely produce some bloated code, unless the optimizer
was really really good (often it would have to be better than even people
can optimize). The only thing I can think of is if you happened to have
nested loops where you just so happened to have 3 variables that were needed
in each respective loop.. but whether a C compiler would render that into
the proper shadow registers is questionable.

-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Henk Poley
Sent: Friday, July 06, 2001 12:17 PM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: statvars...??? [Ti83+]



> Van: Kirk Meyer <kirk.meyer@colorado.edu>
>
> There's no reason MirageOS should need to save registers via pushing an
> popping -- interrupt is what the shadow registers are mainly for. Any
> program that uses shadow registers would DI before such code and EI
> afterward. It doesn't seem as though there would be a very big gain to
using
> the shadow registers in a C compiler -- they're only efficient sometimes
in
> hand-coded assembly, and that's when you can create 2 distinct sets of
> things that you need. Doing exx all the time is hardly efficient.

You might want to know that the compiler hasn't been created for the Ti's
alone, it has bee around since the '80s... It seems that this platform is
the first (from 15 others!) that doesn't preserve all registers in
interrupt, therefor we use this code:

[..header stuff..]
	call	tidi
	call	_main

; Deallocate memory which has been allocated here!
.cleanup
	call	tiei
[..exiting stuff..]
	ret

.tiei
	exx
	ld	hl,(hl1save)
	ld	bc,(bc1save)
	ld	de,(de1save)
	exx
	ld	iy,(iysave)
IF DEFINED_GRAYlib
	im	1
ELSE
	ei
ENDIF
	ret

.tidi
IF DEFINED_GRAYlib
	im	2
ELSE
	di
ENDIF
	exx
	ld	(hl1save),hl
	ld	(bc1save),bc
	ld	(de1save),de
	exx
	ld	(iysave),iy
	ret

I hope you now all understand why we don't have problems with the IM1
interrupt.

BTW: I do notice that it should be GREYlib (with an E), but it was an
Italian who made it... And it doesn't matter...





References: