[OpenBIOS] PATCH: RFC: Rework control flow stack words to use 2 data stack items
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Mon Dec 7 12:20:52 CET 2009
Hi all,
After some more debugging this weekend, I've found that r638 is not the
correct fix for resolving backwards branches. Re-reading the OF spec
lots of times and searching the internet for information on the Forth
control flow stack has now changed my understanding of how this should work.
Currently, OpenBIOS uses 1 stack item per control flow stack item which
works fine when executing control flow words directly in the
interpreter. However, Fcode evaluation requires slightly different
semantics for bbranch and b?branch (since they can be used as part of
different control flow words with slightly different behaviours) and so
in order for this to work, we also need to know the *type* of a control
flow stack item. In particular, we need to know if it is a source
address or a dest address in order to be able to resolve nested control
flow statements correctly.
Please find attached my current working patch for extending the control
flow stack so that each item now takes 2 data stack words: an address,
followed by an address type. I have a separate patch for the Fcode
evaluator, which when applied in conjunction with this patch actually
gets to the point where it attempts to read the file from the ISO image.
Nice.
However, since this patch involves some reasonably low level tinkering,
I'd like to put it out for review first. Please can people with some
Forth experience (e.g. Stefan, Tarl, Laurent) take a look at this and
check that it's okay to apply?
ATB,
Mark.
--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063
Sirius Labs: http://www.siriusit.co.uk/labs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openbios-cstack.patch
Type: text/x-diff
Size: 3347 bytes
Desc: not available
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20091207/ce597348/attachment.bin>
More information about the OpenBIOS
mailing list