<html 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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
        {font-family:"Apple Color Emoji";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Nur Text Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.NurTextZchn
        {mso-style-name:"Nur Text Zchn";
        mso-style-priority:99;
        mso-style-link:"Nur Text";
        font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1123578773;
        mso-list-template-ids:-250961406;}
@list l0:level1
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1
        {mso-list-id:2010718930;
        mso-list-type:hybrid;
        mso-list-template-ids:-94705158 1896252780 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2
        {mso-list-id:2068257835;
        mso-list-type:hybrid;
        mso-list-template-ids:-1552373750 67567639 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l2:level1
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style></head><body lang=DE-CH link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>All<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Just to refine my idea. The <b>second</b> byte of the MOV’ instruction could identify the emulator as follows:<o:p></o:p></span></p><ul style='margin-top:0cm' type=disc><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo4'><b><span lang=EN-US style='font-size:11.0pt;color:red'>P</span></b><span lang=EN-US style='font-size:11.0pt'>eter de Wachter’s emulator could return     50H (ASCII “P”)<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo4'><b><span lang=EN-US style='font-size:11.0pt;color:red'>A</span></b><span lang=EN-US style='font-size:11.0pt'>ndreas Pirklbauer’s emulator could return  41H (ASCII “A”)<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo4'><b><span lang=EN-US style='font-size:11.0pt;color:red'>C</span></b><span lang=EN-US style='font-size:11.0pt'>huck Perkin’s emulator could return             43H (ASCII “C”)<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo4'><b><span lang=EN-US style='font-size:11.0pt;color:red'>M</span></b><span lang=EN-US style='font-size:11.0pt'>ichael Schier’s emulator could return          4DH (ASCII “M”)<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l1 level1 lfo4'><b><span lang=EN-US style='font-size:11.0pt;color:red'>R</span></b><span lang=EN-US style='font-size:11.0pt'>oel de Jong’s emulator could return             52H (ASCII “R”)<o:p></o:p></span></li></ul><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>I know this method does not scale. But to give the first brave emulator programmers one letter of credit </span><span lang=EN-US style='font-size:11.0pt;font-family:"Apple Color Emoji"'>☺</span><span lang=EN-US style='font-size:11.0pt'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>And remember: it’s only an idea…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Happy New Year to all of you.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt'>Jörg<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='color:black'>Von: </span></b><span style='color:black'>Oberon <oberon-bounces@lists.inf.ethz.ch> im Auftrag von Jörg <joerg.straube@iaeth.ch><br><b>Antworten an: </b>ETH Oberon and related systems <oberon@lists.inf.ethz.ch><br><b>Datum: </b>Dienstag, 31. Dezember 2019 um 09:51<br><b>An: </b>ETH Oberon and related systems <oberon@lists.inf.ethz.ch><br><b>Betreff: </b>Re: [Oberon] QEMU target implementation for Oberon RISC architecture</span><span style='color:black;mso-fareast-language:DE'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p></div><p class=MsoPlainText><span lang=DE>All</span><o:p></o:p></p><p class=MsoPlainText><span lang=DE> </span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>Sorry, I made a typo. The correct identification code should look like this:</span><o:p></o:p></p><p class=MsoPlainText><span lang=DE> </span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>        cpu := SYSTEM.H(2019) MOD <b><span style='color:red'>100H</span></b>;</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>        IF cpu = 53H THEN       (* RISC5: with interrupts + floating-point, 31.8.2018 *)</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>        ELSIF cpu = 54H THEN (* RISC5a: no interrupts, no floating-point, 1.9.2018*)</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>        ELSIF cpu = <b><span style='color:red'>0A0H</span></b> THEN (* RISC0, 26.12.2013 *)</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>        </span><span lang=DE>END ;</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US style='color:black'>First of all, the CPU version identification is an undocumented feature. So only NW knows, if it will be supported in the future.</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US style='color:black'>Perhaps we as Oberon community can agree on how <b>emulators</b> shall identify itself. I see four thinkable ways</span><o:p></o:p></p><ol style='margin-top:0cm' start=1 type=a><li class=MsoPlainText style='color:black;mso-list:l2 level1 lfo3'><span lang=EN-US>Return one of the values above, as the real FPGA HW would do. Be totally transparent to the Oberon code.</span><o:p></o:p></li><li class=MsoPlainText style='color:black;mso-list:l2 level1 lfo3'><span lang=EN-US>Return another value, so the Oberon code might find out that it’s running on an emulator if he wants to do so</span><o:p></o:p></li><li class=MsoPlainText style='color:black;mso-list:l2 level1 lfo3'><span lang=EN-US>Use a few of the 20 unused bits in the instruction, currently set to 0. This has the benefit that the CPU version is still one of the defined ones, and we can detect the CPU feature set foreseen by NW. We still have the possibility to detect on what emulator this CPU is implemented.</span><o:p></o:p></li><li class=MsoPlainText style='color:black;mso-list:l2 level1 lfo3'><span lang=EN-US>Define a new (still unused) instruction to just return the emulator version.</span><o:p></o:p></li></ol><p class=MsoPlainText><span lang=EN-US style='color:black'> </span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US style='color:black'>My recommendation would be: c). Just as an idea: use the second lowest byte to identify the emulator.</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US style='color:black'>As example: SYSTEM.H(2019) DIV 100H MOD 100H would identify the emulator.</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US> </span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>br</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US>Jörg</span><o:p></o:p></p><p class=MsoPlainText><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;mso-fareast-language:DE'>-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon <o:p></o:p></span></p></div></body></html>