[OpenBIOS] Incorrect implementation of b?branch?
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Sat Feb 21 16:14:08 CET 2009
Stefan Reinauer wrote:
> I think you indeed hit a bug. b?branch in openbios only works in word
> definitions, not in interpretion mode. It needs similar handling as
> setup-tmp-comp/execute-tmp-comp in the definition of "if" in bootstrap.fs.
No way! I was actually looking at the code in bootstrap.fs thinking that
the code assumed it was working inside a temporary buffer, and wondering
if the setup-tmp-comp word would help me. Thanks for the pointer.
> In addition to that your example contains non-valid code. A b?branch
> always needs to point behind a b(>resolve) as in the below example.
>
> here
> cc c, \ offset16
> \ a4 c, \ -1
> a5 c, \ 0
> 14 c, 00 c, 05 c, \ b?branch
> 02 c, 16 c, \ abort
> b2 c, \ b(>resolve)
> 9f c, \ .s
> 00 c, \ end0
> 1 byte-load
Indeed, that is my mistake. Please find the attached patch, which when
used with your code example above now seems to do the right thing for
b?branch:
0 > here ok
1 > cc c, ok
1 > a5 c, ok
1 > 14 c, 00 c, 05 c, ok
1 > 02 c, 16 c, ok
1 > b2 c, ok
1 > 9f c, ok
1 > 00 c, ok
1 > 1 byte-load <e> -1 1 0 -1 0 0 0 ffd79378 0 0 0 0 0 0
ok
0 > here ok
1 > cc c, ok
1 > a4 c, ok
1 > 14 c, 00 c, 05 c, ok
1 > 02 c, 16 c, ok
1 > b2 c, ok
1 > 9f c, ok
1 > 00 c, ok
1 > 1 byte-load
byte-load: exception caught!
ok
At least now if I find similar errors, I have an idea of how to fix them :)
Many thanks,
Mark.
--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bbranch.patch
Type: text/x-diff
Size: 515 bytes
Desc: not available
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20090221/0a5b2bb0/attachment.bin>
More information about the OpenBIOS
mailing list