On Tuesday 04 April 2006 10:23 pm, Don Y wrote:
Yeah. Though
XTHL was another one...
As was PCHL. But, XCHG was lots of bang for the buck (4 clocks?)
Yes. And I often wished that they'd had one that would work with BC, as
well... :-)
The typical usage was HL & DE for source/destination pointers and BC as
length/byte count.
Yup! I just like orthagonality, I guess...
Blame that H-11 that was my first hand-on exposure to a computer for spoiling
my expectations in that regard. :-)
<...>
But I never
used most of that stuff. Never got around to doing anything
with the index registers, the alternate set, or a lot of those
"specials" that
Alternate register set was ideal for interrupt service (assuming
IRQs aren't nested *or* you restrict the alt registers for use by
a single IRQ that can never interrupt itself). Consider the
cost of saving all of that state and restoring it before RETI
and you can see how quickly you can save a lot of time!
That's what Osborne thought when they used it for _the keyboard interrupt_ (if
I'm remembering right) and then along came Turbo Pascal and Mix C and you had
to run a patch program or upgrade to a 1.21 rom (in the executive) to get 'em
to work at all.
were added. I
kinda liked relative jumps, though, since it made it way
easier to do relocatable code and plus they were a byte smaller. :-)
A favorite trick was to finish a product. Then grep for all
CALLs. Sort this list to come up with the N most common CALLs,
and then assign those to the "unused" RST's. You could often
save 500 bytes of code with that 10 minute exercise...
Makes sense to me. My fiddling monitor program used a couple of those, I
think, but not most of them.
<...>
DB 'Hello, World!'
<insert next instruction here>
Just so.
We would often develop our own interpreters to make some of this
stuff more efficient to code. This would get coded in-line
with appropriate macros. For example:
STATE IDLE
ON '0' THRU '9' GOTO IDLE EXECUTING Accumulate_Digit
ON BARCODE GOTO TEST EXECUTING Clear_and_Read_then_Test
ON CLEAR GOTO IDLE EXECUTING Clear_Accumlator
ON ENTER GOTO TEST EXECUTING Test_Value
ENDSTATE
STATE TEST
ON GOODVALUE GOTO ACCEPT EXECUTING Process_Value
ON BADVALUE GOTO REJECT EXECUTING Signal_Error
ENDSTATE
So, with ~25 bytes, I can code a numeric data entry routine
(trivial example) in a way that actually is reasonably easy
to read.
Macros were one thing I never really got going on, although one of the books
I have on hand here that deals with this stuff (I forget which one it is now,
and if it's z80-specific or cp/m-specific) was so heavily awash with them
that I had trouble wrapping my head around it. I should probably dig that
book out of whatever box it's in and have another look one of these days.
<...>
Or, using INR M to 'test' flags.
Yep!
THogh this caused all sorts of problems when I got my first
ICE! :-( (think about it :> )
Never used one, so I'm not sure how you mean here.
Sometimes I
like the absolutely minimalist approach to things, too. One
of these days I'm gonna dig that code out, burn it, and see how small a
z80 box I can build that'll still prove useful for all sorts of things.
I sure have enough of those parts on hand here...
I have a tiny multitasking executive that runs in a handful of
bytes. Slick as snot -- if you adopt its coding style.
For the z80? I'd sure like to see that if so.
--
Member of the toughest, meanest, deadliest, most unrelenting -- and
ablest -- form of life in this section of space, a critter that can
be killed but can't be tamed. --Robert A. Heinlein, "The Puppet Masters"
-
Information is more dangerous than cannon to a society ruled by lies. --James
M Dakin