--------------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?= <
jmika@prodatron.net> <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;"> • <a href="
https://info.yahoo.com/privacy/us/yahoo/groups/details.html" style="text-decoration: none;">Privacy</a> • <a href="mailto:
symbos8bit-unsubscribe@yahoogroups.com?subject=Unsubscribe" style="text-decoration: none;">Unsubscribe</a> • <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--