<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Your viewer also doesn’t use the global bitmap, and it isn’t exported so you can remove the declaration. I suspect the problem would then go away as you will no longer exceed the global variable size limit of 64Kb – each SET element in the array is four bytes. You would only need the bitmap if you *<b>were</b>* doing the dot-drawing and using the original algorithm. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>On the other hand if you are aware that you don’t need the bitmap and are just puzzled why it fails when max < 16384 I believe it is because the string constants also use the global space.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Chris.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> Hans Klaver [mailto:hklaver@dds.nl] <br><b>Sent:</b> Monday, 24 February 2020 9:29 PM<br><b>To:</b> Chris Burrows; ETH Oberon and related systems<br><b>Subject:</b> Re: [Oberon] Static variable overflow (bug?)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Well, as you can see MyViewer doesn't do any dot-drawing. The only thing it does is declaring an array of 32 bit entities and creating an emty viewer. The viewer works fine apart from its menu remaining emty. This is what puzzles me.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Hans Klaver<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>Chris Burrows wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If I were you I would have started by looking at the newer graphics examples supplied with Project Oberon 2013 as a basis for porting the Fern example to the newer system. The bitmap in the original XYPlane code appears to have been used for dot-drawing optimisation that is no longer used (necessary?).</span><o:p></o:p></p></div><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><p class=MsoNormal> <o:p></o:p></p></div><div><div><div><p class=MsoNormal>Recently I tried to implement XYplane.Mod from the book of Reiser & Wirth 'Programming in Oberon' for Project Oberon. Within Peter de Wachter's RISC emulator I ran into an overflow problem (leading to the remaining empty of the menu line of a viewer) that appears to be dependent on which disk image is used.<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>Otherwise my port works fine (produces the IFS fractal fern as expected). <o:p></o:p></p></div></div><div><div><p class=MsoNormal>For those interested I will post it to my github repository.<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>A minimal module that can reproduce this menu problem can be found below.<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><div><p class=MsoNormal>When starting the emulator in macOS as follows this problem occurs:<o:p></o:p></p></div></div><div><div><div><p class=MsoNormal style='background:black'><span style='color:#F2F2F2'>$ ./risc --fullscreen DiskImage/Oberon-2019-01-21.dsk</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>But the problem does NOT occur when starting thus: <o:p></o:p></p></div></div><div><div><div><p class=MsoNormal style='background:black'><span style='color:#F2F2F2'>$ ./risc --fullscreen DiskImage/Oberon-2016-08-02.dsk</span><o:p></o:p></p></div></div></div></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>I do understand that there is a limit to the use of static variables within the PO version of Oberon, but I would not expect this limit to be reached this easily, and I would not expect it to appear in newer versions of the software and not in older.<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>Does anyone have a clue where to look for the cause of this happening?<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>Hans Klaver<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>---------------------<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>MODULE MyViewer; <o:p></o:p></p></div></div><div><div><p class=MsoNormal>(* Test of the menu line of a viewer *)<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>IMPORT Display, Viewers, Oberon, MenuViewers, TextFrames;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>CONST <o:p></o:p></p></div></div><div><div><p class=MsoNormal> max = 16377; (* If max >= 16367 the frame name disappears; If max >= 16377 the whole menu line disappears! *)<o:p></o:p></p></div></div><div><div><p class=MsoNormal> menu = "System.Close System.Copy System.Grow"; <o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>TYPE <o:p></o:p></p></div></div><div><div><p class=MsoNormal> XYframe = POINTER TO XYframeDesc;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> XYframeDesc = RECORD (Display.FrameDesc) END;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>VAR bitmap: ARRAY max OF SET; (* with this variable present the menu may remain empty! *)<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>PROCEDURE Restore(F: XYframe);<o:p></o:p></p></div></div><div><div><p class=MsoNormal>BEGIN <o:p></o:p></p></div></div><div><div><p class=MsoNormal> Oberon.RemoveMarks(F.X, F.Y, F.W, F.H);<o:p></o:p></p></div></div><div><div><p class=MsoNormal> Display.ReplConst(Display.black, F.X, F.Y, F.W, F.H, Display.replace); (* clear *)<o:p></o:p></p></div></div><div><div><p class=MsoNormal>END Restore;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>PROCEDURE Handle(F: Display.Frame; VAR M: Display.FrameMsg);<o:p></o:p></p></div></div><div><div><p class=MsoNormal> VAR F1: XYframe;<o:p></o:p></p></div></div><div><div><p class=MsoNormal>BEGIN <o:p></o:p></p></div></div><div><div><p class=MsoNormal> CASE F OF XYframe:<o:p></o:p></p></div></div><div><div><p class=MsoNormal> CASE M OF <o:p></o:p></p></div></div><div><div><p class=MsoNormal> Oberon.InputMsg:<o:p></o:p></p></div></div><div><div><p class=MsoNormal> IF<span class=apple-converted-space> </span><a href="http://m.id/"><span style='color:purple'>M.id</span></a><span class=apple-converted-space> </span>= Oberon.track THEN Oberon.DrawMouseArrow(M.X, M.Y) END |<o:p></o:p></p></div></div><div><div><p class=MsoNormal> Oberon.CopyMsg:<o:p></o:p></p></div></div><div><div><p class=MsoNormal> Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); NEW(F1); F1^ := F^; M.F := F1 |<o:p></o:p></p></div></div><div><div><p class=MsoNormal> MenuViewers.ModifyMsg:<o:p></o:p></p></div></div><div><div><p class=MsoNormal> IF (M.Y # F.Y) OR (M.H # F.H) THEN F.Y := M.Y; F.H := M.H; Restore(F) END <o:p></o:p></p></div></div><div><div><p class=MsoNormal> END<o:p></o:p></p></div></div><div><div><p class=MsoNormal> END<o:p></o:p></p></div></div><div><div><p class=MsoNormal>END Handle;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>PROCEDURE Open*;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> VAR F: XYframe; V: Viewers.Viewer; x, y: INTEGER;<o:p></o:p></p></div></div><div><div><p class=MsoNormal>BEGIN<o:p></o:p></p></div></div><div><div><p class=MsoNormal> NEW(F); F.handle := Handle; <o:p></o:p></p></div></div><div><div><p class=MsoNormal> Oberon.AllocateUserViewer(Oberon.Par.vwr.X, x, y); <o:p></o:p></p></div></div><div><div><p class=MsoNormal> V := MenuViewers.New(TextFrames.NewMenu("MyViewer", menu), F, TextFrames.menuH, x, y)<o:p></o:p></p></div></div><div><div><p class=MsoNormal>END Open;<o:p></o:p></p></div></div><div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><div><p class=MsoNormal>END MyViewer.<o:p></o:p></p></div></div></div></div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Helvetica","sans-serif"'>--<br></span><a href="mailto:Oberon@lists.inf.ethz.ch"><span style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:purple'>Oberon@lists.inf.ethz.ch</span></a><span class=apple-converted-space><span style='font-size:10.5pt;font-family:"Helvetica","sans-serif"'> </span></span><span style='font-size:10.5pt;font-family:"Helvetica","sans-serif"'>mailing list for ETH Oberon and related systems<br></span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon"><span style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:purple'>https://lists.inf.ethz.ch/mailman/listinfo/oberon</span></a><o:p></o:p></p></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>