Patch to Manual.htm for More Browsers.
Ralph Corderoy
ralph at inputplus.demon.co.uk
Tue Oct 30 17:58:32 GMT 2001
Hi,
I was having some problems reading Manual.htm on my browser because
many of the character entities weren't terminated by a semi-colon
causing them to be written out in full. Particuarly around the
formulas. Below is a patch that fixes those and also a couple of other
things, like <small> being started and not finished.
I used validator.w3c.org to check the result and identify other
problems.
Hope it's of use.
Ralph.
--- Manual.orig Tue Oct 30 10:18:57 2001
+++ Manual.htm Tue Oct 30 17:51:46 2001
@@ -1,4 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head>
<title>DefMod</title>
+</head>
<body>
<h1><tt>DefMod</tt></h1>
@@ -161,7 +165,7 @@
<p>One output register may be marked with a pling, in which case the
non-x form will return it as its result.</p>
- <p>Constants may be provided in decimal, hex (& or 0x) or binary (%
+ <p>Constants may be provided in decimal, hex (& or 0x) or binary (%
or 0b) or as a character value of up to 4 characters (e g, "TASK").</p>
<h2><a name = semantics>Semantics</a></h2>
@@ -301,7 +305,7 @@
#endif
</pre>
-and the <tt>-D__swi</tt> compiler flag must be provided when using the
+<p>and the <tt>-D__swi</tt> compiler flag must be provided when using the
header files. <tt>"Types.h"</tt> contains these lines.</p>
<h2><a name = "#bytewide">The <tt>ByteWide</tt> file</a></h2>
@@ -331,7 +335,7 @@
what <tt>DefMod</tt> does when generating library files: it generates a
veneer that assumes the C function has been called via
<small>A P C S</small> (in other words, the first 4
-arguments are in <tt>R0</tt>, ..., <tt>R3</tt>, and the rest are
+arguments are in <tt>R0</tt>, ..., <tt>R3</tt>, and the rest are
on the stack), and sets the registers up as they should be for calling
the <small>SWI</small>; that calls the <small>SWI</small>; and that then
puts all the registers back where they should be for the
@@ -345,23 +349,23 @@
<p>To simplify the discussion, we refer to the registers by 2 sets of
names. Considered as input to and output from the <small>SWI</small>, we
-call them <tt>R0</tt>, ..., <tt>R9</tt>; considered as
+call them <tt>R0</tt>, ..., <tt>R9</tt>; considered as
<small>A P C S</small> entry registers, we call them
-<tt>A0</tt>, ..., <tt>A3</tt> (the ``argument registers´´) and
-<tt>V0</tt>, ..., <tt>V5</tt> (the ``variable registers´´); also,
+<tt>A0</tt>, ..., <tt>A3</tt> (the ``argument registers´´) and
+<tt>V0</tt>, ..., <tt>V5</tt> (the ``variable registers´´); also,
when considered as the <small>A P C S</small> result register,
we call <tt>R0</tt> just <tt>R</tt>. The remaining 6 registers are always
called <tt>SL</tt>, <tt>FP</tt>, <tt>IP</tt>, <tt>SP</tt>, <tt>LR</tt>,
<tt>PC</tt>.</p>
<p>Let <i>i</i> be the number of registers provided on input, and let
-the registers be <i>I<sub>0</sub>, ..., I<sub>i-1</sub></i>; let
+the registers be <i>I<sub>0</sub>, ..., I<sub>i-1</sub></i>; let
<i>o</i> be the number of results required, and let the registers be
-<i>O<sub>0</sub>, ..., O<sub>o-1</sub></i>; let <i>c</i> be the
+<i>O<sub>0</sub>, ..., O<sub>o-1</sub></i>; let <i>c</i> be the
number of registers corrupted, and let the registers be
-<i>C<sub>0</sub>, ..., C<sub>c-1</sub></i>; let <i>k</i> be the
+<i>C<sub>0</sub>, ..., C<sub>c-1</sub></i>; let <i>k</i> be the
number of registers to be loaded with constants, and let the registers be
-<i>K<sub>0</sub>, ..., K<sub>k-1</sub></i>. Also, let <i>f</i> be 1
+<i>K<sub>0</sub>, ..., K<sub>k-1</sub></i>. Also, let <i>f</i> be 1
if flags are to be supplied on output, 0 if not.</p>
<p>Recall that on entry</p>
@@ -374,29 +378,29 @@
<tr>
<td>The <i>i</i><sup>th</sup> argument</td>
<td>is at</td>
- <td><tt>[SP, #4*(</tt><i>i</i><tt>-4)]</tt></td>
- <td>(<i>i</i> > 4)</td>
+ <td><tt>[SP, #4*(</tt><i>i</i><tt>-4)]</tt></td>
+ <td>(<i>i</i> > 4)</td>
</tr>
</table>
<p>So on entry,
-<tt>R</tt><i>I</i><sub>0</sub>, ..., <tt>R</tt><i>I</i><sub><i>i</i>-1</sub>
+<tt>R</tt><i>I</i><sub>0</sub>, ..., <tt>R</tt><i>I</i><sub><i>i</i>-1</sub>
must be copied from the
-0<sup>th</sup>, ..., (<i>i</i>-1)<sup>th</sup> arguments and
-<tt>R</tt><i>K</i><sub>0</sub>, ..., <tt>R</tt><i>K</i><sub><i>k</i>-1</sub>
+0<sup>th</sup>, ..., (<i>i</i>-1)<sup>th</sup> arguments and
+<tt>R</tt><i>K</i><sub>0</sub>, ..., <tt>R</tt><i>K</i><sub><i>k</i>-1</sub>
must be set to their values; and on exit,</p>
<table>
<tr>
- <td>If <tt>V</tt> is set</td>
+ <td>If <tt>V</tt> is set</td>
<td><tt>R</tt> must be set to an error block pointer (and <tt>V</tt>
cleared)</td>
</tr>
<tr>
- <td>If <tt>V</tt> is clear</td>
-<td><tt>R</tt><i>O</i><sub>0</sub>, ..., <tt>R</tt><i>O</i><sub><i>o</i>-1</sub>
+ <td>If <tt>V</tt> is clear</td>
+<td><tt>R</tt><i>O</i><sub>0</sub>, ..., <tt>R</tt><i>O</i><sub><i>o</i>-1</sub>
must be copied to (the addresses in) the
-<i>i</i><sup>th</sup>, ..., (<i>i</i>+<i>o</i>-1)<sup>th</sup> arguments;
+<i>i</i><sup>th</sup>, ..., (<i>i</i>+<i>o</i>-1)<sup>th</sup> arguments;
and if flags are required, they must be written to (the address in) the
(<i>i</i>+<i>o</i>)<sup>th</sup> argument, and <tt>R</tt> cleared.
</td>
@@ -410,21 +414,21 @@
<small>A P C S</small> requires to be preserved which we
will be using ourselves, or which the <small>SWI</small> corrupts:</p>
- <p>V</i> = {4 <u><</u> <i>r</i> < 10:
+ <p><i>V</i> = {4 <u><</u> <i>r</i> < 10:
there is an <i>x</i> such that
-<i>r</i> = <i>I</i><sub><i>x</i></sub> or
-<i>r</i> = <i>O</i><sub><i>x</i></sub> or
-<i>r</i> = <i>C</i><sub><i>x</i></sub> or
-<i>r</i> = <i>K</i><sub><i>x</i></sub>}</p>
+<i>r</i> = <i>I</i><sub><i>x</i></sub> or
+<i>r</i> = <i>O</i><sub><i>x</i></sub> or
+<i>r</i> = <i>C</i><sub><i>x</i></sub> or
+<i>r</i> = <i>K</i><sub><i>x</i></sub>}</p>
<p>Also consider those registers <i>A</i> which are going to have to be
saved over the call, because they contain addresses to be used for output.
These are those of the
-<i>i</i><sup>th</sup>, ..., (<i>i</i>+<i>o</i>+<i>f</i>-1)<sup>th</sup> arguments
-which are passed in <tt>R0</tt>, ..., <tt>R3</tt>:</p>
+<i>i</i><sup>th</sup>, ..., (<i>i</i>+<i>o</i>+<i>f</i>-1)<sup>th</sup> arguments
+which are passed in <tt>R0</tt>, ..., <tt>R3</tt>:</p>
- <p><i>A</i> = {0 <u><</u> <i>r</i> < 4:
-<i>i</i> <u><</u> <i>r</i> < <i>i</i>+sup(inf(<i>o</i>+<i>f</i>,4)-<i>i</i>,0)}</p>
+ <p><i>A</i> = {0 <u><</u> <i>r</i> < 4:
+<i>i</i> <u><</u> <i>r</i> < <i>i</i>+sup(inf(<i>o</i>+<i>f</i>,4)-<i>i</i>,0)}</p>
<h3>Input</h3>
@@ -451,7 +455,7 @@
</pre>
<p>(In fact,
-<tt>STMFD SP!, {</tt><i>V</i><tt>, </tt><i>A</i><tt>}</tt> will
+<tt>STMFD SP!, {</tt><i>V</i><tt>, </tt><i>A</i><tt>}</tt> will
do rather than the two instructions above.)</p>
<p>After all this,</p>
@@ -459,7 +463,7 @@
<table>
<tr>
<td>
- <tt>[SP, #4|</tt><i>A</i><tt>|+4|</tt><i>V</i><tt>|]</tt>
+ <tt>[SP, #4|</tt><i>A</i><tt>|+4|</tt><i>V</i><tt>|]</tt>
</td>
<td>
contains
@@ -470,7 +474,7 @@
</tr>
<tr>
<td>
- <tt>[SP, #4|</tt><i>A</i><tt>|]</tt>
+ <tt>[SP, #4|</tt><i>A</i><tt>|]</tt>
</td>
<td>
contains
@@ -494,10 +498,10 @@
</table>
<p>In fact, 2 variants are possible: first, if
-<i>i</i> <u><</u> 4, we do not need <tt>IP</tt> before the
+<i>i</i> <u><</u> 4, we do not need <tt>IP</tt> before the
<small>SWI</small> is called, so we can use it to save <tt>LR</tt> in. After
the <small>SWI</small>, <tt>LR</tt> is corrupted anyway, so we can use it as
-we see fit. Second, if <i>i</i> > 4, we stack <tt>LR</tt> along
+we see fit. Second, if <i>i</i> > 4, we stack <tt>LR</tt> along
with <i>V</i>, <i>A</i>. In the first case, on exit we have to do
<tt>MOVS PC, IP</tt>. In the second, we just add <tt>PC</tt> to the
list of registers to be restored on return.</p>
@@ -519,14 +523,14 @@
</pre>
<p>If <tt>V</tt> is clear, we have to retrieve the addresses passed in the
-(<i>i</i>+1)<sup>th</sup>, ..., (<i>i</i>+<i>o</i>-1)<sup>th</sup>
+(<i>i</i>+1)<sup>th</sup>, ..., (<i>i</i>+<i>o</i>-1)<sup>th</sup>
arguments. These have been saved in 2 different places: argument <i>i</i>+<i>x</i>
-is at <tt>[SP, #4</tt><i>x</i><tt>]</tt>
-(<i>i</i>+<i>x</i> < 4), or at
-<tt>[SP, #4|</tt><i>V</i><tt>|+4|</tt><i>A</i><tt>|+4*(</tt><i>i</i><tt>+</tt><i>x</i><tt>-4)]</tt>
+is at <tt>[SP, #4</tt><i>x</i><tt>]</tt>
+(<i>i</i>+<i>x</i> < 4), or at
+<tt>[SP, #4|</tt><i>V</i><tt>|+4|</tt><i>A</i><tt>|+4*(</tt><i>i</i><tt>+</tt><i>x</i><tt>-4)]</tt>
(otherwise).</p>
- <p>Initially, assume only that <i>i</i> <u>></u> 4:</p>
+ <p>Initially, assume only that <i>i</i> <u>></u> 4:</p>
<pre>
;get address for first argument
@@ -545,7 +549,7 @@
</pre>
<p>In fact, it may be the case that
-<i>i</i>+<i>o</i>+<i>f</i>-1 < 4. In this case, we have to replace
+<i>i</i>+<i>o</i>+<i>f</i>-1 < 4. In this case, we have to replace
any</p>
<pre>
@@ -553,7 +557,7 @@
STR O(x), [IP]
</pre>
- <p>sequences for which <i>i</i>+<i>x</i> < 4 by sequences that
+ <p>sequences for which <i>i</i>+<i>x</i> < 4 by sequences that
go</p>
<pre>
@@ -561,7 +565,7 @@
STR O(x), [IP]
</pre>
- <p>where <tt>[SP, #4</tt><i>x</i><tt>]</tt> is the value that
+ <p>where <tt>[SP, #4</tt><i>x</i><tt>]</tt> is the value that
<tt>R</tt>(<i>i</i>+<i>x</i>) had on entry to the code, as stacked at the
beginning.</p>
@@ -625,11 +629,11 @@
</tr>
<tr>
<td><tt>[</tt><i>const</i><tt>]</tt> <i>type</i></td>
- <td><i>CVT(type)</i> <tt>[</tt><i>VAL(const)</i><tt>]</tt></td>
+ <td><i>CVT(type)</i> <tt>[</tt><i>VAL(const)</i><tt>]</tt></td>
</tr>
<tr>
<td><i>id</i></td>
- <td><tt>Convert_To_Extern (</tt><i>id</i><tt>)</tt></td>
+ <td><tt>Convert_To_Extern (</tt><i>id</i><tt>)</tt></td>
</tr>
</table>
@@ -639,14 +643,14 @@
<tr>
<td><tt>=</tt> <i>type</i></td>
<td>becomes</td>
- <td><i>CVT(type)</i> on input, <i>CVT(type)</i> <tt>*</tt> on
+ <td><i>CVT(type)</i> on input, <i>CVT(type)</i> <tt>*</tt> on
output</td>
</tr>
<tr>
<td><tt>-></tt> <i>type</i></td>
<td>becomes</td>
- <td><i>CVT(type)</i> <tt>*</tt> on input,
-<i>CVT(type)</i> <tt>**</tt> on output</td>
+ <td><i>CVT(type)</i> <tt>*</tt> on input,
+<i>CVT(type)</i> <tt>**</tt> on output</td>
</tr>
<tr>
<td><tt>#</tt> <i>num</i></td>
@@ -664,7 +668,7 @@
<tr>
<td><tt>FLAGS</tt></td>
<td>becomes</td>
- <td><tt>unsigned *</tt> (output only)</td>
+ <td><tt>unsigned *</tt> (output only)</td>
</tr>
</table>
@@ -727,7 +731,7 @@
there is therefore an implementation of the parts of <tt>OSLib</tt> that
<tt>DefMod</tt> needs, as macros (using <tt>_swix()</tt>). This is
called <tt>SWILib</tt>. In principal, these could now be replaced with
-the output of <tt>DefMod -l</tt>, but this would be to introduce a
+the output of <tt>DefMod -l</tt>, but this would be to introduce a
potentially lethal feedback loop.</p>
<h2><a name = grammar>The grammar</a></h2>
@@ -827,10 +831,10 @@
FLAGS: f l a g s ws;
CONTAINS: '=' ws;
-REFERENCES: '-' '>' ws;
+REFERENCES: '-' '>' ws;
CONSTANT: '#' ws;
DISJOINS: '|' ws;
-CONJOINS: '&' ws;
+CONJOINS: '&' ws;
ADDS: '+' ws;
EXCLUSIVELY_DISJOINS: '^' ws;
CORRUPTED: '?' ws;
@@ -888,7 +892,7 @@
dec_num: digit_SEQUENCE | '-' digit_SEQUENCE;
-hex_num: '0' x hexit_SEQUENCE | '&' hexit_SEQUENCE;
+hex_num: '0' x hexit_SEQUENCE | '&' hexit_SEQUENCE;
bin_num: '0' b bit_SEQUENCE | '%' bit_SEQUENCE;
@@ -900,22 +904,18 @@
numchar: simplechar | compoundchar | spacechar | '"';
commentchar: simplechar | spacechar | '\\' | '"' | '\'';
spacechar: ' ' | '\xA0' | '\t';
-simplechar: letter | digit | '!' | '#' | '$' | '%' | '&' | '(' | ')' |
- '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' |
- '>' | '?' | '@' | '[' | ']' | '^' | '_' | '`' | ' | '|' |
- '}' ';} | '~' | /**/ '\x8C' | /**/ '\x8D' | /**/ '\x8E' |
- /**/ '\x8F' | /**/ '\x90' | /**/ '\x91' | /**/ '\x92' |
- /**/ '\x93' | /**/ '\x94' | /**/ '\x95' | /**/ '\x96' |
- /**/ '\x97' | /**/ '\x98' | /**/ '\x99' | /**/ '\x9C' |
- /**/ '\x9D' | /*¡*/ '\xA1' | /*¢*/ '\xA2' | /*£*/ '\xA3' |
- /*¤*/ '\xA4' | /*¥*/ '\xA5' | /*¦*/ '\xA6' | /*§*/ '\xA7' |
- /*¨*/ '\xA8' | /*©*/ '\xA9' | /*ª*/ '\xAA' | /*«*/ '\xAB' |
- /*¬*/ '\xAC' | /**/ '\xAD' | /*®*/ '\xAE' | /*¯*/ '\xAF' |
- /*°*/ '\xB0' | /*±*/ '\xB1' | /*¹*/ '\xB9' | /*²*/ '\xB2' |
- /*³*/ '\xB3' | /*´*/ '\xB4' | /*µ*/ '\xB5' | /*¶*/ '\xB6' |
- /*·*/ '\xB7' | /*¸*/ '\xB8' | /*º*/ '\xBA' | /*»*/ '\xBB' |
- /*¼*/ '\xBC' | /*½*/ '\xBD' | /*¾*/ '\xBE' | /*¿*/ '\xBF' |
- /*×*/ '\xD7' | /*÷*/ '\xF7';
+simplechar: letter | digit | '!' | '#' | '$' | '%' | '&' | '(' | ')' |
+ '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' |
+ '>' | '?' | '@' | '[' | ']' | '^' | '_' | '`' | '{' | '|' |
+ '}' | '~' | '\x8C' | '\x8D' | '\x8E' | '\x8F' | '\x90' |
+ '\x91' | '\x92' | '\x93' | '\x94' | '\x95' | '\x96' |
+ '\x97' | '\x98' | '\x99' | '\x9C' | '\x9D' | '\xA1' |
+ '\xA2' | '\xA3' | '\xA4' | '\xA5' | '\xA6' | '\xA7' |
+ '\xA8' | '\xA9' | '\xAA' | '\xAB' | '\xAC' | '\xAD' |
+ '\xAE' | '\xAF' | '\xB0' | '\xB1' | '\xB9' | '\xB2' |
+ '\xB3' | '\xB4' | '\xB5' | '\xB6' | '\xB7' | '\xB8' |
+ '\xBA' | '\xBB' | '\xBC' | '\xBD' | '\xBE' | '\xBF' |
+ '\xD7' | '\xF7';
compoundchar: '\\' escapedchar | '\\' x hexit hexit;
@@ -1064,7 +1064,7 @@
( NUMBER &47700 "For internal use only",
ENTRY
( R0 = .Int: model_no,
- R1 -> ColourPicker_Model: model,
+ R1 -> ColourPicker_Model: model,
R2 = .Ref Void: workspace
) ),
@@ -1085,7 +1085,7 @@
( NUMBER &47702 "Creates and opens a colour picker dialogue",
ENTRY
( R0 = ColourPicker_OpenFlags: flags,
- R1 -> ColourPicker_Dialogue: dialogue
+ R1 -> ColourPicker_Dialogue: dialogue
),
EXIT
( R0! = ColourPicker_D: d,
@@ -1122,7 +1122,7 @@
ENTRY
( R0 = ColourPicker_UpdateFlags: flags,
R1 = ColourPicker_D: d,
- R2 -> ColourPicker_Dialogue: dialogue
+ R2 -> ColourPicker_Dialogue: dialogue
) );
TYPE ColourPicker_ReadFlags = .Bits;
@@ -1147,7 +1147,7 @@
( NUMBER &47706 "Reserved for future expansion",
ENTRY
( R0 = ColourPicker_SetFlags: flags,
- R1 -> ColourPicker_Colour: colour
+ R1 -> ColourPicker_Colour: colour
) );
TYPE ColourPicker_HelpFlags = .Bits;
@@ -1157,7 +1157,7 @@
Message_HelpRequest with its own help text",
ENTRY
( R0 = ColourPicker_HelpFlags: flags,
- R1 -> Wimp_Message: help_request
+ R1 -> Wimp_Message: help_request
) );
SWI
@@ -1169,7 +1169,7 @@
ENTRY
( R0 # 0 "Informs the front end to send a message to the client,
if required",
- R1 -> ColourPicker_Colour: colour
+ R1 -> ColourPicker_Colour: colour
) ),
//Cause the Picker to send a message to the application. if required.
@@ -1178,7 +1178,7 @@
ENTRY
( R0 # 1 "Informs the front end to send a dragging message to the
client, if required",
- R1 -> ColourPicker_Colour: colour
+ R1 -> ColourPicker_Colour: colour
) ),
ColourPickerModelSWI_ClaimEvent =
@@ -1187,7 +1187,7 @@
( R0 # 2 "Informs the front end that the back end wants an event
type",
R1 = .Int: event,
- R2 -> ColourPicker_Colour: colour
+ R2 -> ColourPicker_Colour: colour
) ),
ColourPickerModelSWI_ReleaseEvent =
@@ -1196,7 +1196,7 @@
( R0 # 3 "Informs the front end that the back end no longer wants an
event type",
R1 = .Int: event,
- R2 -> ColourPicker_Colour: colour
+ R2 -> ColourPicker_Colour: colour
) ),
ColourPickerModelSWI_ProcessKey =
@@ -1204,7 +1204,7 @@
ENTRY
( R0 # 4 "Passes an unhandled key press on to the front end",
R1 = .Int: c,
- R2 -> ColourPicker_Colour: colour
+ R2 -> ColourPicker_Colour: colour
) );
SWI
@@ -1212,7 +1212,7 @@
( NUMBER 0x30,
ENTRY
( R1 # &93 "For internal use only",
- R2 -> .Asm: loaded_service,
+ R2 -> .Asm: loaded_service,
R3 = .Ref Void: workspace
) )
</pre>
@@ -1224,7 +1224,7 @@
argument to be saved on calls that use a value and then update it.</p>
<p>Could have more knowledge about buffers and buffer lengths, and
-provide a more consistent interface. (S<small>WI<small>'s that fill
+provide a more consistent interface. (S<small>WI</small>'s that fill
buffers have two arguments, usually called <tt>buffer</tt> and
<tt>size</tt>, and may return one of: a pointer to the next free byte
(called <tt>end</tt>); a number of bytes written (called <tt>used</tt>);
@@ -1240,7 +1240,7 @@
allowable values of that type. We could also have support for sets of
enumerated types.</p>
- <p>Some S<small>WI<small>'s have two or more registers that are
+ <p>Some S<small>WI</small>'s have two or more registers that are
equally likely to be needed as results. Could they be persuaded to
return a structure-valued result? Under C release 5, it's easy for the
non-x case, but it would have to work for <em>all</em> cases to be
@@ -1294,7 +1294,7 @@
<td>J R C</td>
<td>Handling of <tt>BLOCK</tt> arguments. (If there is no <tt>EXIT</tt>
clause, and the last <tt>ENTRY</tt> argument is of the form
-<tt>R</tt><i>x</i> <tt>-> .Struct ...</tt> then the constructed
+<tt>R</tt><i>x</i> <tt>-> .Struct ...</tt> then the constructed
interface assumes that the structure is passed by value, i e, its fields
are passed in order. See <tt>wimp_set_icon_state()</tt> for an instance of
this.)</td>
@@ -1323,8 +1323,11 @@
<!--
Notes. Remind me never to use H T M L for mathematics again ...
- In proportional text, extra spaces round '+' '-' '×' '÷' and
+ In proportional text, extra spaces round '+' '-' '×' '÷' and
before '(' in function calls seem superfluous, but spaces around relations
-'=' '>' '<' and ellipses '...' look good.
+'=' '>' '<' and ellipses '...' look good.
-->
+
+</body>
+</html>
More information about the oslib-user
mailing list