Hi Si,
> Thanks Julz. In that case I feel like I was pretty close with my original
> guesses!
Yes, there was a reason for the symmetry.
> This is a fun way to really see the workings of the machine in a raw way.
> Personally I would incorporate it into the beginners' tutorial one day for
> its educational value, since it demonstrates how the stack pointer really
> exists in there next to the UDGs and video memory in one continuum - it
> makes the memory model diagrams "real".
Indeed, there's a lot of rawness in FIGnition :-) It means, for
example, that you can use internal peeks and pokes ( ic@, i@, ic! and
i!) to reset the stack pointer:
sp0 sp i!
That you can have direct access to the registers (sp actually is the
address of a register, sp=26 I think, it's the x register on the AVR -
registers on an AVR can be addressed as memory locations). Also you
can use the same commands to activate the LED: 31 40 ic! 100 pause 15
40 ic!
And you can use the same commands to access lots of the hardware in
FIGnition, including i2c; timers etc (though timers 1 and 2 are
largely used by the video system) or the video ram ( e.g. $1F1E vram
i!) and ultimately, when interrupts have been hooked into the Forth
system; interrupts :-)
I'm getting near the end of the hardware description manual (draft
edition) at the moment - stay tuned for an announcement of some better
FIGnition documentation :-)
-cheers from Julz
>>>>> - *1 The initial stack and underflow protection:*
>>>>> 1. I'd never used a stack based system before, so it's all new to
>>>>> me. (Having said that, years ago my boss let me play with his
>>>>> beloved HP
>>>>> 12C RPN calculator which he thought was "Brilliant!" and I
>>>>> thought was
>>>>> "Weird!")
>>>>> 2. I'm enjoying reading the Jupiter Ace manual and comparing the
>>>>> FIGnition to it, where I've learned that the Ace could detect a
>>>>> stack
>>>>> underflow and gave an "ERROR 2" when it did. The Ace manual says
>>>>> *"**Stack underflow isn't always detected immediately, because
>>>>> the Ace only checks for it at certain times. Between these times
>>>>> it might
>>>>> well have dipped below the bottom of the stack without realising
>>>>> it, but
>>>>> this doesn't matter because there are some nonsense numbers under
>>>>> the stack
>>>>> for the computer to play with."*
>>>>> 3. My experimentation leads me to believe FIGnition doesn't try
>>>>> to detect stack underflow, but does have some numbers in the
>>>>> stack when I
>>>>> boot it up. In fact, if I repeatedly "dot" to print the top of
>>>>> the stack
>>>>> recursively, I get something like the following sequence: 990,
>>>>> -255, 257,
>>>>> 257, 257, -256, 0, 0, 0, -128, -32640, -32640, -32640, -32640,
>>>>> 257, 257,
>>>>> 257, -257, -32640, -32640, -32640, -32640, 257, 257, 257 511 0 0
>>>>> 0 0 255
>>>>> -32640 -32640 -32513 240 -3856 -3856 -3856 3855 3855 3855 255 -1
>>>>> -1 -1 -256
>>>>> -256 -256 -256 -770 -1 -1 -1 16255 -1-1 -1 -1 -1 -1 -260 -1 -1 -1
>>>>> 32575
>>>>> 8224 8224 **GIBBERISH**
>>>>> 4. So what are these numbers? I'd love to know where they come
>>>>> from. They mainly seem to be quite base-2 flavoured for a while
>>>>> but the
>>>>> initial "990" seems out of place. And there are repeating
>>>>> patterns which
>>>>> makes me wonder if I'm just wandering into the text interpreter
>>>>> recursively. I sort of feel as if my FIGnition should be singing
>>>>> "Daisy,
>>>>> Daisy" to me as I eventually appear to hit video memory, the
>>>>> screen goes
>>>>> squiffy and FIGnition crashes. Are the numbers there as a bit of
>>>>> underflow
>>>>> buffer? Do they have any particular meaning? Perhaps they are
>>>>> the remnants
>>>>> of using UDGs to display the boot logo and the "@nichemachines
>>>>> 2011-2013"
>>>>> welcome... or I'm just hitting the UDG part of VRAM anyway..?
>>>>> 5. On discovering this, obviously I defined a word to reliably
>>>>> crash FIGnition just for fun *: crash 999 0 do . loop ;*
>>>>> 6. This isn't particularly useful but made me nostalgic about
>>>>> entering "RANDOMIZE USR 0" on a ZX Spectrum to reset it. Anyone
>>>>> remember
>>>>> that?
>>>>>
>>>>>
>>>>> - *2 The block editor.*
>>>>>
>>>>>
>>>>> 1. *Zero. *From the "Use
>>>>> It<
https://sites.google.com/site/libby8dev/fignition/documentation/use-it>"
>>>>> page: *"**Zero is command z**: SW2+SW6 then SW8+SW4. It clears
>>>>> the editor's text."* Now what I would expect/like this to do is
>>>>> to clear the block, making its length 0 characters. What actually
>>>>> happens
>>>>> is the length counter goes to 0, but the display of the block
>>>>> doesn't clear
>>>>> on-screen - the cursor just moves to the top left position. If I
>>>>> go back
>>>>> into the block to edit it, the length is actually 511 (i.e. full)
>>>>> and I
>>>>> can't type anything new into the block unless I move along / down
>>>>> a bit and
>>>>> delete some invisible characters first. This leads me to believe
>>>>> that using
>>>>> the "zero" command doesn't so much *empty* the block as *fill it
>>>>> with space characters*. Is that right?
>>>>> 2. *Erase. *I can't seem to perform an "Erase". If I press
>>>>> <Control> for the Cmd? prompt and type <E> then <y>, the cursor
>>>>> simply
>>>>> returns to the editor with no other effect. Have I broken
>>>>> something? (I
>>>>> think it worked the first time I tried it, before I had
>>>>> FIGkeys).
>>>>> 3. *Raw characters.* I just don't understand this bit. *"**You
>>>>> can enter raw characters by typing Command, then a series of
>>>>> digits from
>>>>> 0..7 and then <enter>" *Well, if I press <Control> for Cmd? and
>>>>> then press a number key, I get the corresponding UDG character
>>>>> immediately. I must have missed something...?
>>>>>
>>>>>
>>>>> Many thanks for any comments or clarifications!
>>>>> - Si
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "FIGnition" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to
fignition+...@googlegroups.com.
>>>>> For more options, visit
https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> The DIY 8-bit computer from nichemachines(tm)
The DIY 8-bit computer from nichemachines(tm)