• [symbos8bit] =?utf-8?Q?Creating_SymbOS_Applications_Using_EXX?=

    From alvin albrecht alvin_albrecht@hotmail.com [symbos8bit]@symbos8bit@yahoogroups.com to =?utf-8?Q?symbos8bit@yahoogroups.com?= on Sun Nov 29 17:10:43 2015
    --_10029F7C-19EC-4928-AF8B-4403D21B4112_
    Content-Transfer-Encoding: base64
    Content-Type: text/plain; charset="utf-8"

    SSBoYXZlIGEgY291cGxlIG9mIHF1ZXN0aW9ucyBhYm91dCB3cml0aW5nIGFwcGxpY2F0aW9u cyBmb3IgU3ltYk9TLg0KDQoNClRoZSBmaXJzdCBvbmUgaXMgZWFzeTogIEFyZSBjb21tYW5k IGxpbmVzIGFsd2F5cyB6ZXJvIHRlcm1pbmF0ZWQsIGluY2x1ZGluZyAyNTYtYnl0ZSBsb25n IG9uZXM/DQoNCg0KVGhlIHNlY29uZCBvbmUgaXMgbGVzcyBlYXN5LiAgSW4gdGhlIGtpbmQg b2YgYXBwbGljYXRpb25zIEkgaGF2ZSBpbiBtaW5kIGl0IGlzIG5vdCBwb3NzaWJsZSB0byBm b3JlZ28gdXNlIG9mIHRoZSBleHggcmVnaXN0ZXJzLiAgRnJvbSB0aGUgcmVhZGluZyBJIGhh dmUgZG9uZSwgYWxsIGNvbW11bmljYXRpb24gd2l0aCB0aGUga2VybmVsIGFuZCBvdGhlciBw cm9jZXNzZXMgaXMgdGhyb3VnaCB0aGUgejgwIHJlc3RhcnRzLCBhbmQgaXQgaXMgcG9zc2li bGUgdGhhdCBzZXZlcmFsIGFwcGxpY2F0aW9ucyBjb3VsZCBleGlzdCBpbiB0aGUgc2FtZSA2 NGsgYmFuayBzbyB0aGF0IHRoZXkgc2hhcmUgdGhvc2UgcmVzdGFydHMuDQoNCg0KU28gd2hh dCBJIGhhdmUgaW4gbWluZCB0byBnZXQgYXJvdW5kIHRoaXMgaXMgdG8gcGF0Y2ggcnN0IzM4 IChpbTEgaW50ZXJydXB0KSBhdCBwcm9ncmFtIHN0YXJ0LXVwIHRvIGp1bXAgaW50byBhIHN1 YnJvdXRpbmUgdGhhdCB3b3VsZCBzYXZlIHRoZSBjdXJyZW50IGV4eCBzZXQgb24gdGhlIHN0 YWNrLCBsb2FkIHRoZSBleHggc2V0IHZhbHVlcyBleHBlY3RlZCBieSBTeW1iT1MsIHVucGF0 Y2ggcnN0IzM4LCBjYWxsICMzOC4gIE9uIHJldHVybiBmcm9tIHRoZSBjYWxsLCBzYXZlIFN5 bWJPUyBleHggc2V0IHZhbHVlcywgcGF0Y2ggcnN0IzM4LCBwb3AgZXh4IHNldCB2YWx1ZXMg ZnJvbSB0aGUgc3RhY2sgYW5kIHJldHVybiB0byAodGhpcykgcHJvZ3JhbS4NCg0KDQpUaGUg aWRlYSBpcyByc3QjMzggd291bGQgb25seSBiZSBwYXRjaGVkIHdoaWxlIHRoaXMgc3BlY2lh bCBwcm9ncmFtIHdhcyBydW5uaW5nIGFuZCB3b3VsZCBiZSBub3JtYWwgZm9yIGFsbCBvdGhl ciBwcm9jZXNzZXMuICBUaGUgb3RoZXIgcnN0IGVudHJ5IHBvaW50cyB3b3VsZCBub3QgYmUg cGF0Y2hlZCBidXQgdGhlIHByb2dyYW0gd291bGQgYmUgZ2l2ZW4gb3RoZXIgbG9jYWwgc3Vi cm91dGluZXMgdG8gY2FsbCB0aGF0IHdvdWxkIGRlYWwgd2l0aCB0aGUgZXh4IHNldCBhcHBy b3ByaWF0ZXkgYmVmb3JlIGp1bXBpbmcgaW50byB0aGUgcmVzdGFydC4NCg0KDQpNeSBxdWVz dGlvbiBpcywgaXMgdGhpcyBzb21ldGhpbmcgdGhhdCB3b3VsZCB3b3JrIHdpdGhpbiBTeW1i
    T1M/

    --_10029F7C-19EC-4928-AF8B-4403D21B4112_
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: 7bit





    <head>

    <style type="text/css">
    <!--

    /* start of attachment style */
    .ygrp-photo-title{
    clear: both;
    font-size: smaller;
    height: 15px;
    overflow: hidden;
    text-align: center;
    width: 75px;
    }
    div.ygrp-photo{
    background-position: center;
    background-repeat: no-repeat;
    background-color: white;
    border: 1px solid black;
    height: 62px;
    width: 62px;
    }

    div.photo-title
    a,
    div.photo-title a:active,
    div.photo-title a:hover,
    div.photo-title a:visited {
    text-decoration: none;
    }

    div.attach-table div.attach-row {
    clear: both;
    }

    div.attach-table div.attach-row div {
    float: left;
    /* margin: 2px;*/
    }

    p {
    clear: both;
    padding: 15px 0 3px 0;
    overflow: hidden;
    }

    div.ygrp-file {
    width: 30px;
    valign: middle;
    }
    div.attach-table div.attach-row div div a {
    text-decoration: none;
    }

    div.attach-table div.attach-row div div span {
    font-weight: normal;
    }

    div.ygrp-file-title {
    font-weight: bold;
    }
    /* end of attachment style */
    -->
    </style>
    </head>
    <html><head><style data-externalstyle="true"><!--
    p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
    margin-top:0in;
    margin-right:0in;
    margin-bottom:0in;
    margin-left:.5in;
    margin-bottom:.0001pt;
    }

    p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
    margin-top:0in;
    margin-right:0in;
    margin-bottom:0in;
    margin-left:.5in;
    margin-bottom:.0001pt;
    line-height:115%;
    }
    </style></head><body>


    <!-- |**|begin egp html banner|**| -->

    <br><br>

    <!-- |**|end egp html banner|**| -->


    <div data-externalstyle="false" dir="ltr" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:12pt;"><div>I have a couple of questions about writing applications for SymbOS.</div><div>&nbsp;</div><div>The first one is easy:&nbsp; Are command lines always zero terminated, including 256-byte long ones?</div><div>&nbsp;</div><div>The second one is less easy.&nbsp; In the kind of applications I have in mind it is not possible to forego use of the exx registers.&nbsp; From the reading I have done, all communication with the kernel and other processes is through the z80 restarts, and it is possible that several applications could exist in the same 64k bank so that they share those restarts.</div><div>&nbsp;</div><div>So what I have in mind to get around this is to patch rst#38 (im1 interrupt) at program start-up to jump into a subroutine that would save the current exx set on the stack, load the
    exx set values expected by SymbOS, unpatch rst#38, call #38.&nbsp; On return from the call, save SymbOS exx set values, patch rst#38, pop exx set values from the stack and return to (this) program.</div><div>&nbsp;</div><div>The idea is rst#38 would only be patched while this special program was running and would be normal for all other processes.&nbsp; The other rst entry points would not be patched but the program would be given other local subroutines to call that would deal with the exx set appropriatey before jumping into the restart.</div><div>&nbsp;</div><div>My question is, is this something that would work within SymbOS?</div><div>&nbsp;</div></div>



    <!-- |**|begin egp html banner|**| -->






    <!-- |**|end egp html banner|**| -->


    <div width="1" style="color: white; clear: both;"/>__._,_.___</div>





    <div id="fromDMARC" style="clear:both; margin-top: 10px;">
    <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
    Posted by: alvin albrecht &lt;alvin_albrecht@hotmail.com&gt; <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
    </div>
    <!-- Start Recommendations -->
    <!-- End Recommendations -->



    <!-- |**|begin egp html banner|**| -->

    <img src="http://geo.yahoo.com/serv?s=97476590/grpId=18448305/grpspId=1705006559/msgId=1414/stime=1448817798" width="1" height="1"> <br>

    <!-- |**|end egp html banner|**| -->


    <!-- |**|begin egp html banner|**| -->








    <!-- |**|begin egp html banner|**| -->
    <div id="ygrp-vital" style="background-color: #f2f2f2; font-family: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">

    <span id="vithd" style="font-weight: bold; color: #333; text-transform: uppercase; "><a href="https://groups.yahoo.com/neo/groups/symbos8bit/info;_ylc=X3oDMTJmdGMwb2xoBF9TAzk3MzU5NzE0BGdycElkAzE4NDQ4MzA1BGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzE0NDg4MTc3OTc-" style="text-decoration: none;">Visit Your Group</a></span>

    <ul style="list-style-type: none; margin: 0; padding: 0; display: inline;">
    </ul>
    </div>


    <div id="ft" style="font-family: Arial; font-size: 11px; margin-top: 5px; padding: 0 2px 0 0; clear: both;">
    <a href="https://groups.yahoo.com/neo;_ylc=X3oDMTJlajJvMHZjBF9TAzk3NDc2NTkwBGdycElkAzE4NDQ4MzA1BGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTQ0ODgxNzc5OA--" style="float: left;"><img src="http://l.yimg.com/ru/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height="15" width="137" alt="Yahoo! Groups" style="border: 0;"/></a>
    <div style="color: #747575; float: right;"> &bull; <a href="https://info.yahoo.com/privacy/us/yahoo/groups/details.html" style="text-decoration: none;">Privacy</a> &bull; <a href="mailto:symbos8bit-unsubscribe@yahoogroups.com?subject=Unsubscribe" style="text-decoration: none;">Unsubscribe</a> &bull; <a href="https://info.yahoo.com/legal/us/yahoo/utos/terms/" style="text-decoration: none;">Terms of Use</a> </div>
    </div>

    <!-- |**|end egp html banner|**| -->

    </div> <!-- ygrp-msg -->




    <br>

    <!-- |**|end egp html banner|**| -->


    <div style="color: white; clear: both;"/>__,_._,___</div>
    </body></html>
    --_10029F7C-19EC-4928-AF8B-4403D21B4112_--

  • From =?UTF-8?Q?J=c3=b6rn_Mika?= jmika@prodatron.net [symbos8bit]@symbos8bit@yahoogroups.com to symbos8bit@yahoogroups.com on Sun Nov 29 21:05:48 2015
    --------------020809060300020907040300
    Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit

    Hi Alvin,

    yes, command lines and in general all string in SymbOS are 0-terminated.
    As there is no "length" byte/word for strings, they could be of any
    length in general. This is how both the textinput controls (single and multiline) are working. SymShell expects strings with a length of 255
    bytes max because of the buffer.

    Regarding the 2nd register patch: That's an interesting idea! It would
    work exactly like you described. Please note, that on the Amstrad CPC interrupts are coming 300times/second, 6x compared to the other systems,
    so it could slow down the system a little bit, when working in the Ram
    bank with your application. But that shouldn't be a big deal.
    The only real issue would be, that the system will crash if someone just
    kills your application with the task manager. In this case it can't
    restore the vector, and as soon as another application is using its
    memory it will crash. Beside #38 you also have to patch #30 ("idle"), as
    it is working in the same way, it will call the scheduler as well. It's
    not needed, when you guarantee, that rst#30 calls are only done, when
    the 2nd register set is not touched :)

    During the last weeks I was porting an real Z80-based Un"ZIP"per
    (Deflate algorithm used for ZIP, GZIP, CAP, PNG etc.) from the MSX scene
    (coded by Grauw, additional optimizations by Wouter) to SymbOS. The
    challenge was not to use the 2nd registers, as they used it for several optimizations. The interesting thing was, that for some routines it was
    even faster not to use the 2nd registers :) But in general the "non EXX" version is a few % slower than the fastest version by Wouter - but only
    a few ;)

    CU,
    Prodatron

    PS: The first version of UNZIP for SymbOS will be released soon




    Am 29.11.2015 um 18:10 schrieb alvin albrecht alvin_albrecht@hotmail.com [symbos8bit]:
    I have a couple of questions about writing applications for SymbOS.
    The first one is easy: Are command lines always zero terminated,
    including 256-byte long ones?
    The second one is less easy. In the kind of applications I have in
    mind it is not possible to forego use of the exx registers. From the
    reading I have done, all communication with the kernel and other
    processes is through the z80 restarts, and it is possible that several applications could exist in the same 64k bank so that they share those restarts.
    So what I have in mind to get around this is to patch rst#38 (im1
    interrupt) at program start-up to jump into a subroutine that would
    save the current exx set on the stack, load the exx set values
    expected by SymbOS, unpatch rst#38, call #38. On return from the
    call, save SymbOS exx set values, patch rst#38, pop exx set values
    from the stack and return to (this) program.
    The idea is rst#38 would only be patched while this special program
    was running and would be normal for all other processes. The other
    rst entry points would not be patched but the program would be given
    other local subroutines to call that would deal with the exx set
    appropriatey before jumping into the restart.
    My question is, is this something that would work within SymbOS?



    --------------020809060300020907040300
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: 8bit





    <head>

    <style type="text/css">
    <!--

    /* start of attachment style */
    .ygrp-photo-title{
    clear: both;
    font-size: smaller;
    height: 15px;
    overflow: hidden;
    text-align: center;
    width: 75px;
    }
    div.ygrp-photo{
    background-position: center;
    background-repeat: no-repeat;
    background-color: white;
    border: 1px solid black;
    height: 62px;
    width: 62px;
    }

    div.photo-title
    a,
    div.photo-title a:active,
    div.photo-title a:hover,
    div.photo-title a:visited {
    text-decoration: none;
    }

    div.attach-table div.attach-row {
    clear: both;
    }

    div.attach-table div.attach-row div {
    float: left;
    /* margin: 2px;*/
    }

    p {
    clear: both;
    padding: 15px 0 3px 0;
    overflow: hidden;
    }

    div.ygrp-file {
    width: 30px;
    valign: middle;
    }
    div.attach-table div.attach-row div div a {
    text-decoration: none;
    }

    div.attach-table div.attach-row div div span {
    font-weight: normal;
    }

    div.ygrp-file-title {
    font-weight: bold;
    }
    /* end of attachment style */
    -->
    </style>
    </head>
    <html>
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">


    <!-- |**|begin egp html banner|**| -->

    <br><br>

    <!-- |**|end egp html banner|**| -->



    Hi Alvin,<br>
    <br>
    yes, command lines and in general all string in SymbOS are
    0-terminated. As there is no "length" byte/word for strings, they
    could be of any length in general. This is how both the textinput
    controls (single and multiline) are working. SymShell expects
    strings with a length of 255 bytes max because of the buffer.<br>
    <br>
    Regarding the 2nd register patch: That's an interesting idea! It
    would work exactly like you described. Please note, that on the
    Amstrad CPC interrupts are coming 300times/second, 6x compared to
    the other systems, so it could slow down the system a little bit,
    when working in the Ram bank with your application. But that
    shouldn't be a big deal.<br>
    The only real issue would be, that the system will crash if someone
    just kills your application with the task manager. In this case it
    can't restore the vector, and as soon as another application is
    using its memory it will crash. Beside #38 you also have to patch
    #30 ("idle"), as it is working in the same way, it will call the
    scheduler as well. It's not needed, when you guarantee, that rst#30
    calls are only done, when the 2nd register set is not touched :)<br>
    <br>
    During the last weeks I was porting an real Z80-based Un"ZIP"per
    (Deflate algorithm used for ZIP, GZIP, CAP, PNG etc.) from the MSX
    scene (coded by Grauw, additional optimizations by Wouter) to
    SymbOS. The challenge was not to use the 2nd registers, as they used
    it for several optimizations. The interesting thing was, that for
    some routines it was even faster not to use the 2nd registers :) But
    in general the "non EXX" version is a few % slower than the fastest
    version by Wouter - but only a few ;)<br>
    <br>
    CU,<br>
    Prodatron<br>
    <br>
    PS: The first version of UNZIP for SymbOS will be released soon<br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 29.11.2015 um 18:10 schrieb alvin
    albrecht <a class="moz-txt-link-abbreviated" href="mailto:alvin_albrecht@hotmail.com">alvin_albrecht@hotmail.com</a> [symbos8bit]:<br>
    </div>
    <blockquote
    cite="mid:BAY403-EAS11011EE57A41C67A84A7332EB010@phx.gbl"
    type="cite"> <span style="display:none"> </span>

    <div id="ygrp-text">
    <div data="false" dir="ltr" style="font-size:12pt;">
    <div>I have a couple of questions about writing
    applications for SymbOS.</div>
    <div> </div>
    <div>The first one is easy:  Are command lines always zero
    terminated, including 256-byte long ones?</div>
    <div> </div>
    <div>The second one is less easy.  In the kind of
    applications I have in mind it is not possible to forego
    use of the exx registers.  From the reading I have done,
    all communication with the kernel and other processes is
    through the z80 restarts, and it is possible that
    several applications could exist in the same 64k bank so
    that they share those restarts.</div>
    <div> </div>
    <div>So what I have in mind to get around this is to patch
    rst#38 (im1 interrupt) at program start-up to jump into
    a subroutine that would save the current exx set on the
    stack, load the exx set values expected by SymbOS,
    unpatch rst#38, call #38.  On return from the call, save
    SymbOS exx set values, patch rst#38, pop exx set values
    from the stack and return to (this) program.</div>
    <div> </div>
    <div>The idea is rst#38 would only be patched while this
    special program was running and would be normal for all
    other processes.  The other rst entry points would not
    be patched but the program would be given other local
    subroutines to call that would deal with the exx set
    appropriatey before jumping into the restart.</div>
    <div> </div>
    <div>My question is, is this something that would work
    within SymbOS?</div>
    <div> </div>
    </div>
    </div>


    <!-- end group email -->
    </blockquote>
    <br>




    <!-- |**|begin egp html banner|**| -->






    <!-- |**|end egp html banner|**| -->


    <div width="1" style="color: white; clear: both;"/>__._,_.___</div>





    <div id="fromDMARC" style="clear:both; margin-top: 10px;">
    <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
    Posted by: =?UTF-8?Q?J=c3=b6rn_Mika?= &lt;jmika@prodatron.net&gt; <hr style="height:2px ; border-width:0; color:#E3E3E3; background-color:#E3E3E3;">
    </div>
    <!-- Start Recommendations -->
    <!-- End Recommendations -->



    <!-- |**|begin egp html banner|**| -->

    <img src="http://geo.yahoo.com/serv?s=97476590/grpId=18448305/grpspId=1705006559/msgId=1415/stime=1448827551" width="1" height="1"> <br>

    <!-- |**|end egp html banner|**| -->


    <!-- |**|begin egp html banner|**| -->








    <!-- |**|begin egp html banner|**| -->
    <div id="ygrp-vital" style="background-color: #f2f2f2; font-family: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">

    <span id="vithd" style="font-weight: bold; color: #333; text-transform: uppercase; "><a href="https://groups.yahoo.com/neo/groups/symbos8bit/info;_ylc=X3oDMTJmMDNuaDNmBF9TAzk3MzU5NzE0BGdycElkAzE4NDQ4MzA1BGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzE0NDg4Mjc1NTE-" style="text-decoration: none;">Visit Your Group</a></span>

    <ul style="list-style-type: none; margin: 0; padding: 0; display: inline;">
    </ul>
    </div>


    <div id="ft" style="font-family: Arial; font-size: 11px; margin-top: 5px; padding: 0 2px 0 0; clear: both;">
    <a href="https://groups.yahoo.com/neo;_ylc=X3oDMTJlb2NwOGdnBF9TAzk3NDc2NTkwBGdycElkAzE4NDQ4MzA1BGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTQ0ODgyNzU1MQ--" style="float: left;"><img src="http://l.yimg.com/ru/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height="15" width="137" alt="Yahoo! Groups" style="border: 0;"/></a>
    <div style="color: #747575; float: right;"> &bull; <a href="https://info.yahoo.com/privacy/us/yahoo/groups/details.html" style="text-decoration: none;">Privacy</a> &bull; <a href="mailto:symbos8bit-unsubscribe@yahoogroups.com?subject=Unsubscribe" style="text-decoration: none;">Unsubscribe</a> &bull; <a href="https://info.yahoo.com/legal/us/yahoo/utos/terms/" style="text-decoration: none;">Terms of Use</a> </div>
    </div>

    <!-- |**|end egp html banner|**| -->

    </div> <!-- ygrp-msg -->




    <br>

    <!-- |**|end egp html banner|**| -->


    <div style="color: white; clear: both;"/>__,_._,___</div>
    </body>
    </html>

    --------------020809060300020907040300--