Fri Jun 15 22:43:41 EDT 2012

Too Concrete

For memory operations current Staapl isn't abstract enough.  Juggling
the a register and working with bytes / words is a pain.

I wonder if the r register can be freed up a bit.  Can we make it so
that 'r' is not guaranteed to be available in interrupts?  This would
allow the FSR1 register to be used as a pointer reg for memcopy.
Interrupt could have its own stacks..

: >IN1 a>r
    13 4 a!! a>    \ get buffer count
    top 6 high? if \ check if full
                   \ check if full
    dup >r
    128 + 5 a!!    \ get next byte address
    >a             \ store byte
    r> 1 +         \ increment counter
    13 4 a!! >a    \ store it

Writing code like this is really too much work, isn't it?  I'm having
fun with this, but somethines it's a royal pain to express something,
especially dealing with memory.  Mostly because I don't want to make
"slow" abstractions; I'm still programming a register machine...

Stuff like this really can't beat C..  It will just never get done.
Maybe I should make a real Forth to try out some other ideas?

In the code above I'm thinking, it really can't be that hard to write
a byte to a buffer in memory and increment a counter.  But I think it
is on PIC...

Some opti: counter could just contain the al register.  Before sending
out, mask out bits that are not used.  Version two