Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_39.ADF » P/+WRAP1

P/+WRAP1

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_39.ADF
Filename: P/+WRAP1
Read OK:
File size: 0D3E bytes
Load address: 2B204556
Exec address: 50415257
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
How to wordwrap in assembler
============================
Say we have a block of text which was written in 80 column mode,but we
want  to show this is 40 column mode instead.A crude way to do this would
be simply to print it out unmodified, but this would result in some words
being broken across the ends of lines.

It is therefore desireable to wordwrap the text. This may be done by
considering some special cases:

Here are the 40 columns 0123456789012345678901234567890123456789

Here's a random string  ABCDE EFGHIJK LMNOPQ . RTSUVWXYZ,abcdef                        
                       ghij.

Fortunately this will look OK even if we'd simply printed it out. To word
wrap you move a pointer to the 40th character,then back up 1 character at
a time until you find a space. Here, that occurs on the very first letter,
as there's a space at the end of the line.

Here are the 40 columns 0123456789012345678901234567890123456789
Here's a random string  ABCDE EFGHIJK LMNOPQ . RTSUVWXYZ,abcdefg
                        hij.

Applying the above rules the wordwrap will be made after the full stop as
that is where the first space is. It would appear as:

Here are the 40 columns 0123456789012345678901234567890123456789
Here's a random string  ABCDE EFGHIJK LMNOPQ .                        
                        RTSUVWXYZ,abcdefghij.

Which isn't very satisfactory. If instead we look for any charcter with an
ASCiivalue LESS THAN the letter '0' (number 48) then the wordwrap will
occur at the comma instead, as this has ASCii value 44. It'll look like

Here are the 40 columns 0123456789012345678901234567890123456789
Here's a random string  ABCDE EFGHIJK LMNOPQ . RTSUVWXYZ,
                        abcdefghij.

Much better. But what happens in the extreme cases? A 42 letter long word,
or a zero length word. Well, when tracking backwards in search of a
character less than ASCii 48 if you realise that you're at the beginning
of the string, at offset 0, then simply print out a fixed 40 letters. This
will leave you part way through a string, whereupon you can then jump
forward another 40 letters and carry on as before. In this way an 85
letter string would be split up into 2 fixed length 40 characters then a
'normal' string.

By a zero length word I mean one with a carriage return only in it. These
can be dealt with by performing a newline, then starting scanning again
after the CR character.

The program 'Wrap' (elsewhere on this disk) will print out a wordwrapped
textfile to 40 columns,stopping when ASCii 0 is found.

That should give you all some food for though if you're writing you own
word processors etc... as a wordwrap routine is often very
important. You'll probably want to do some range checking on the memory
pointer ' addrL' and 'addrH' as these must of course be somewhere in RAM.

Another feature which could prove handy is the handling of carriage re
turn markers used by other operating systems. DOS uses a CR and
linefeed, Archimedes just use the linefeed, the beeb uses both!

To do this - if you find a character LESS THAN or EQUAL TO 13 then a
newline is printed, then, you look ahead one byte to see if that is also
LESS THAN or EQUAL TO 13, but NOT the same as the other. This then takes
into account people who wanted two empty lines one after another in their
text. Discard the second byte if it IS different.

So there it is,
Sprow.






00000000  0d 48 6f 77 20 74 6f 20  77 6f 72 64 77 72 61 70  |.How to wordwrap|
00000010  20 69 6e 20 61 73 73 65  6d 62 6c 65 72 0d 3d 3d  | in assembler.==|
00000020  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00000030  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 0d 53 61 79 20 77  |==========.Say w|
00000040  65 20 68 61 76 65 20 61  20 62 6c 6f 63 6b 20 6f  |e have a block o|
00000050  66 20 74 65 78 74 20 77  68 69 63 68 20 77 61 73  |f text which was|
00000060  20 77 72 69 74 74 65 6e  20 69 6e 20 38 30 20 63  | written in 80 c|
00000070  6f 6c 75 6d 6e 20 6d 6f  64 65 2c 62 75 74 20 77  |olumn mode,but w|
00000080  65 0d 77 61 6e 74 20 20  74 6f 20 73 68 6f 77 20  |e.want  to show |
00000090  74 68 69 73 20 69 73 20  34 30 20 63 6f 6c 75 6d  |this is 40 colum|
000000a0  6e 20 6d 6f 64 65 20 69  6e 73 74 65 61 64 2e 41  |n mode instead.A|
000000b0  20 63 72 75 64 65 20 77  61 79 20 74 6f 20 64 6f  | crude way to do|
000000c0  20 74 68 69 73 20 77 6f  75 6c 64 0d 62 65 20 73  | this would.be s|
000000d0  69 6d 70 6c 79 20 74 6f  20 70 72 69 6e 74 20 69  |imply to print i|
000000e0  74 20 6f 75 74 20 75 6e  6d 6f 64 69 66 69 65 64  |t out unmodified|
000000f0  2c 20 62 75 74 20 74 68  69 73 20 77 6f 75 6c 64  |, but this would|
00000100  20 72 65 73 75 6c 74 20  69 6e 20 73 6f 6d 65 20  | result in some |
00000110  77 6f 72 64 73 0d 62 65  69 6e 67 20 62 72 6f 6b  |words.being brok|
00000120  65 6e 20 61 63 72 6f 73  73 20 74 68 65 20 65 6e  |en across the en|
00000130  64 73 20 6f 66 20 6c 69  6e 65 73 2e 0d 0d 49 74  |ds of lines...It|
00000140  20 69 73 20 74 68 65 72  65 66 6f 72 65 20 64 65  | is therefore de|
00000150  73 69 72 65 61 62 6c 65  20 74 6f 20 77 6f 72 64  |sireable to word|
00000160  77 72 61 70 20 74 68 65  20 74 65 78 74 2e 20 54  |wrap the text. T|
00000170  68 69 73 20 6d 61 79 20  62 65 20 64 6f 6e 65 20  |his may be done |
00000180  62 79 0d 63 6f 6e 73 69  64 65 72 69 6e 67 20 73  |by.considering s|
00000190  6f 6d 65 20 73 70 65 63  69 61 6c 20 63 61 73 65  |ome special case|
000001a0  73 3a 0d 0d 48 65 72 65  20 61 72 65 20 74 68 65  |s:..Here are the|
000001b0  20 34 30 20 63 6f 6c 75  6d 6e 73 20 30 31 32 33  | 40 columns 0123|
000001c0  34 35 36 37 38 39 30 31  32 33 34 35 36 37 38 39  |4567890123456789|
000001d0  30 31 32 33 34 35 36 37  38 39 30 31 32 33 34 35  |0123456789012345|
000001e0  36 37 38 39 0d 0d 48 65  72 65 27 73 20 61 20 72  |6789..Here's a r|
000001f0  61 6e 64 6f 6d 20 73 74  72 69 6e 67 20 20 41 42  |andom string  AB|
00000200  43 44 45 20 45 46 47 48  49 4a 4b 20 4c 4d 4e 4f  |CDE EFGHIJK LMNO|
00000210  50 51 20 2e 20 52 54 53  55 56 57 58 59 5a 2c 61  |PQ . RTSUVWXYZ,a|
00000220  62 63 64 65 66 20 20 20  20 20 20 20 20 20 20 20  |bcdef           |
00000230  20 20 20 20 20 20 20 20  20 20 20 20 20 0d 20 20  |             .  |
00000240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000250  20 20 20 20 20 67 68 69  6a 2e 0d 0d 46 6f 72 74  |     ghij...Fort|
00000260  75 6e 61 74 65 6c 79 20  74 68 69 73 20 77 69 6c  |unately this wil|
00000270  6c 20 6c 6f 6f 6b 20 4f  4b 20 65 76 65 6e 20 69  |l look OK even i|
00000280  66 20 77 65 27 64 20 73  69 6d 70 6c 79 20 70 72  |f we'd simply pr|
00000290  69 6e 74 65 64 20 69 74  20 6f 75 74 2e 20 54 6f  |inted it out. To|
000002a0  20 77 6f 72 64 0d 77 72  61 70 20 79 6f 75 20 6d  | word.wrap you m|
000002b0  6f 76 65 20 61 20 70 6f  69 6e 74 65 72 20 74 6f  |ove a pointer to|
000002c0  20 74 68 65 20 34 30 74  68 20 63 68 61 72 61 63  | the 40th charac|
000002d0  74 65 72 2c 74 68 65 6e  20 62 61 63 6b 20 75 70  |ter,then back up|
000002e0  20 31 20 63 68 61 72 61  63 74 65 72 20 61 74 0d  | 1 character at.|
000002f0  61 20 74 69 6d 65 20 75  6e 74 69 6c 20 79 6f 75  |a time until you|
00000300  20 66 69 6e 64 20 61 20  73 70 61 63 65 2e 20 48  | find a space. H|
00000310  65 72 65 2c 20 74 68 61  74 20 6f 63 63 75 72 73  |ere, that occurs|
00000320  20 6f 6e 20 74 68 65 20  76 65 72 79 20 66 69 72  | on the very fir|
00000330  73 74 20 6c 65 74 74 65  72 2c 0d 61 73 20 74 68  |st letter,.as th|
00000340  65 72 65 27 73 20 61 20  73 70 61 63 65 20 61 74  |ere's a space at|
00000350  20 74 68 65 20 65 6e 64  20 6f 66 20 74 68 65 20  | the end of the |
00000360  6c 69 6e 65 2e 0d 0d 48  65 72 65 20 61 72 65 20  |line...Here are |
00000370  74 68 65 20 34 30 20 63  6f 6c 75 6d 6e 73 20 30  |the 40 columns 0|
00000380  31 32 33 34 35 36 37 38  39 30 31 32 33 34 35 36  |1234567890123456|
00000390  37 38 39 30 31 32 33 34  35 36 37 38 39 30 31 32  |7890123456789012|
000003a0  33 34 35 36 37 38 39 0d  48 65 72 65 27 73 20 61  |3456789.Here's a|
000003b0  20 72 61 6e 64 6f 6d 20  73 74 72 69 6e 67 20 20  | random string  |
000003c0  41 42 43 44 45 20 45 46  47 48 49 4a 4b 20 4c 4d  |ABCDE EFGHIJK LM|
000003d0  4e 4f 50 51 20 2e 20 52  54 53 55 56 57 58 59 5a  |NOPQ . RTSUVWXYZ|
000003e0  2c 61 62 63 64 65 66 67  0d 20 20 20 20 20 20 20  |,abcdefg.       |
000003f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000400  20 68 69 6a 2e 0d 0d 41  70 70 6c 79 69 6e 67 20  | hij...Applying |
00000410  74 68 65 20 61 62 6f 76  65 20 72 75 6c 65 73 20  |the above rules |
00000420  74 68 65 20 77 6f 72 64  77 72 61 70 20 77 69 6c  |the wordwrap wil|
00000430  6c 20 62 65 20 6d 61 64  65 20 61 66 74 65 72 20  |l be made after |
00000440  74 68 65 20 66 75 6c 6c  20 73 74 6f 70 20 61 73  |the full stop as|
00000450  0d 74 68 61 74 20 69 73  20 77 68 65 72 65 20 74  |.that is where t|
00000460  68 65 20 66 69 72 73 74  20 73 70 61 63 65 20 69  |he first space i|
00000470  73 2e 20 49 74 20 77 6f  75 6c 64 20 61 70 70 65  |s. It would appe|
00000480  61 72 20 61 73 3a 0d 0d  48 65 72 65 20 61 72 65  |ar as:..Here are|
00000490  20 74 68 65 20 34 30 20  63 6f 6c 75 6d 6e 73 20  | the 40 columns |
000004a0  30 31 32 33 34 35 36 37  38 39 30 31 32 33 34 35  |0123456789012345|
000004b0  36 37 38 39 30 31 32 33  34 35 36 37 38 39 30 31  |6789012345678901|
000004c0  32 33 34 35 36 37 38 39  0d 48 65 72 65 27 73 20  |23456789.Here's |
000004d0  61 20 72 61 6e 64 6f 6d  20 73 74 72 69 6e 67 20  |a random string |
000004e0  20 41 42 43 44 45 20 45  46 47 48 49 4a 4b 20 4c  | ABCDE EFGHIJK L|
000004f0  4d 4e 4f 50 51 20 2e 20  20 20 20 20 20 20 20 20  |MNOPQ .         |
00000500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 0d  |               .|
00000510  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000520  20 20 20 20 20 20 20 20  52 54 53 55 56 57 58 59  |        RTSUVWXY|
00000530  5a 2c 61 62 63 64 65 66  67 68 69 6a 2e 0d 0d 57  |Z,abcdefghij...W|
00000540  68 69 63 68 20 69 73 6e  27 74 20 76 65 72 79 20  |hich isn't very |
00000550  73 61 74 69 73 66 61 63  74 6f 72 79 2e 20 49 66  |satisfactory. If|
00000560  20 69 6e 73 74 65 61 64  20 77 65 20 6c 6f 6f 6b  | instead we look|
00000570  20 66 6f 72 20 61 6e 79  20 63 68 61 72 63 74 65  | for any charcte|
00000580  72 20 77 69 74 68 20 61  6e 0d 41 53 43 69 69 76  |r with an.ASCiiv|
00000590  61 6c 75 65 20 4c 45 53  53 20 54 48 41 4e 20 74  |alue LESS THAN t|
000005a0  68 65 20 6c 65 74 74 65  72 20 27 30 27 20 28 6e  |he letter '0' (n|
000005b0  75 6d 62 65 72 20 34 38  29 20 74 68 65 6e 20 74  |umber 48) then t|
000005c0  68 65 20 77 6f 72 64 77  72 61 70 20 77 69 6c 6c  |he wordwrap will|
000005d0  0d 6f 63 63 75 72 20 61  74 20 74 68 65 20 63 6f  |.occur at the co|
000005e0  6d 6d 61 20 69 6e 73 74  65 61 64 2c 20 61 73 20  |mma instead, as |
000005f0  74 68 69 73 20 68 61 73  20 41 53 43 69 69 20 76  |this has ASCii v|
00000600  61 6c 75 65 20 34 34 2e  20 49 74 27 6c 6c 20 6c  |alue 44. It'll l|
00000610  6f 6f 6b 20 6c 69 6b 65  0d 0d 48 65 72 65 20 61  |ook like..Here a|
00000620  72 65 20 74 68 65 20 34  30 20 63 6f 6c 75 6d 6e  |re the 40 column|
00000630  73 20 30 31 32 33 34 35  36 37 38 39 30 31 32 33  |s 01234567890123|
00000640  34 35 36 37 38 39 30 31  32 33 34 35 36 37 38 39  |4567890123456789|
00000650  30 31 32 33 34 35 36 37  38 39 0d 48 65 72 65 27  |0123456789.Here'|
00000660  73 20 61 20 72 61 6e 64  6f 6d 20 73 74 72 69 6e  |s a random strin|
00000670  67 20 20 41 42 43 44 45  20 45 46 47 48 49 4a 4b  |g  ABCDE EFGHIJK|
00000680  20 4c 4d 4e 4f 50 51 20  2e 20 52 54 53 55 56 57  | LMNOPQ . RTSUVW|
00000690  58 59 5a 2c 0d 20 20 20  20 20 20 20 20 20 20 20  |XYZ,.           |
000006a0  20 20 20 20 20 20 20 20  20 20 20 20 20 61 62 63  |             abc|
000006b0  64 65 66 67 68 69 6a 2e  0d 0d 4d 75 63 68 20 62  |defghij...Much b|
000006c0  65 74 74 65 72 2e 20 42  75 74 20 77 68 61 74 20  |etter. But what |
000006d0  68 61 70 70 65 6e 73 20  69 6e 20 74 68 65 20 65  |happens in the e|
000006e0  78 74 72 65 6d 65 20 63  61 73 65 73 3f 20 41 20  |xtreme cases? A |
000006f0  34 32 20 6c 65 74 74 65  72 20 6c 6f 6e 67 20 77  |42 letter long w|
00000700  6f 72 64 2c 0d 6f 72 20  61 20 7a 65 72 6f 20 6c  |ord,.or a zero l|
00000710  65 6e 67 74 68 20 77 6f  72 64 2e 20 57 65 6c 6c  |ength word. Well|
00000720  2c 20 77 68 65 6e 20 74  72 61 63 6b 69 6e 67 20  |, when tracking |
00000730  62 61 63 6b 77 61 72 64  73 20 69 6e 20 73 65 61  |backwards in sea|
00000740  72 63 68 20 6f 66 20 61  0d 63 68 61 72 61 63 74  |rch of a.charact|
00000750  65 72 20 6c 65 73 73 20  74 68 61 6e 20 41 53 43  |er less than ASC|
00000760  69 69 20 34 38 20 69 66  20 79 6f 75 20 72 65 61  |ii 48 if you rea|
00000770  6c 69 73 65 20 74 68 61  74 20 79 6f 75 27 72 65  |lise that you're|
00000780  20 61 74 20 74 68 65 20  62 65 67 69 6e 6e 69 6e  | at the beginnin|
00000790  67 0d 6f 66 20 74 68 65  20 73 74 72 69 6e 67 2c  |g.of the string,|
000007a0  20 61 74 20 6f 66 66 73  65 74 20 30 2c 20 74 68  | at offset 0, th|
000007b0  65 6e 20 73 69 6d 70 6c  79 20 70 72 69 6e 74 20  |en simply print |
000007c0  6f 75 74 20 61 20 66 69  78 65 64 20 34 30 20 6c  |out a fixed 40 l|
000007d0  65 74 74 65 72 73 2e 20  54 68 69 73 0d 77 69 6c  |etters. This.wil|
000007e0  6c 20 6c 65 61 76 65 20  79 6f 75 20 70 61 72 74  |l leave you part|
000007f0  20 77 61 79 20 74 68 72  6f 75 67 68 20 61 20 73  | way through a s|
00000800  74 72 69 6e 67 2c 20 77  68 65 72 65 75 70 6f 6e  |tring, whereupon|
00000810  20 79 6f 75 20 63 61 6e  20 74 68 65 6e 20 6a 75  | you can then ju|
00000820  6d 70 0d 66 6f 72 77 61  72 64 20 61 6e 6f 74 68  |mp.forward anoth|
00000830  65 72 20 34 30 20 6c 65  74 74 65 72 73 20 61 6e  |er 40 letters an|
00000840  64 20 63 61 72 72 79 20  6f 6e 20 61 73 20 62 65  |d carry on as be|
00000850  66 6f 72 65 2e 20 49 6e  20 74 68 69 73 20 77 61  |fore. In this wa|
00000860  79 20 61 6e 20 38 35 0d  6c 65 74 74 65 72 20 73  |y an 85.letter s|
00000870  74 72 69 6e 67 20 77 6f  75 6c 64 20 62 65 20 73  |tring would be s|
00000880  70 6c 69 74 20 75 70 20  69 6e 74 6f 20 32 20 66  |plit up into 2 f|
00000890  69 78 65 64 20 6c 65 6e  67 74 68 20 34 30 20 63  |ixed length 40 c|
000008a0  68 61 72 61 63 74 65 72  73 20 74 68 65 6e 20 61  |haracters then a|
000008b0  0d 27 6e 6f 72 6d 61 6c  27 20 73 74 72 69 6e 67  |.'normal' string|
000008c0  2e 0d 0d 42 79 20 61 20  7a 65 72 6f 20 6c 65 6e  |...By a zero len|
000008d0  67 74 68 20 77 6f 72 64  20 49 20 6d 65 61 6e 20  |gth word I mean |
000008e0  6f 6e 65 20 77 69 74 68  20 61 20 63 61 72 72 69  |one with a carri|
000008f0  61 67 65 20 72 65 74 75  72 6e 20 6f 6e 6c 79 20  |age return only |
00000900  69 6e 20 69 74 2e 20 54  68 65 73 65 0d 63 61 6e  |in it. These.can|
00000910  20 62 65 20 64 65 61 6c  74 20 77 69 74 68 20 62  | be dealt with b|
00000920  79 20 70 65 72 66 6f 72  6d 69 6e 67 20 61 20 6e  |y performing a n|
00000930  65 77 6c 69 6e 65 2c 20  74 68 65 6e 20 73 74 61  |ewline, then sta|
00000940  72 74 69 6e 67 20 73 63  61 6e 6e 69 6e 67 20 61  |rting scanning a|
00000950  67 61 69 6e 0d 61 66 74  65 72 20 74 68 65 20 43  |gain.after the C|
00000960  52 20 63 68 61 72 61 63  74 65 72 2e 0d 0d 54 68  |R character...Th|
00000970  65 20 70 72 6f 67 72 61  6d 20 27 57 72 61 70 27  |e program 'Wrap'|
00000980  20 28 65 6c 73 65 77 68  65 72 65 20 6f 6e 20 74  | (elsewhere on t|
00000990  68 69 73 20 64 69 73 6b  29 20 77 69 6c 6c 20 70  |his disk) will p|
000009a0  72 69 6e 74 20 6f 75 74  20 61 20 77 6f 72 64 77  |rint out a wordw|
000009b0  72 61 70 70 65 64 0d 74  65 78 74 66 69 6c 65 20  |rapped.textfile |
000009c0  74 6f 20 34 30 20 63 6f  6c 75 6d 6e 73 2c 73 74  |to 40 columns,st|
000009d0  6f 70 70 69 6e 67 20 77  68 65 6e 20 41 53 43 69  |opping when ASCi|
000009e0  69 20 30 20 69 73 20 66  6f 75 6e 64 2e 0d 0d 54  |i 0 is found...T|
000009f0  68 61 74 20 73 68 6f 75  6c 64 20 67 69 76 65 20  |hat should give |
00000a00  79 6f 75 20 61 6c 6c 20  73 6f 6d 65 20 66 6f 6f  |you all some foo|
00000a10  64 20 66 6f 72 20 74 68  6f 75 67 68 20 69 66 20  |d for though if |
00000a20  79 6f 75 27 72 65 20 77  72 69 74 69 6e 67 20 79  |you're writing y|
00000a30  6f 75 20 6f 77 6e 0d 77  6f 72 64 20 70 72 6f 63  |ou own.word proc|
00000a40  65 73 73 6f 72 73 20 65  74 63 2e 2e 2e 20 61 73  |essors etc... as|
00000a50  20 61 20 77 6f 72 64 77  72 61 70 20 72 6f 75 74  | a wordwrap rout|
00000a60  69 6e 65 20 69 73 20 6f  66 74 65 6e 20 76 65 72  |ine is often ver|
00000a70  79 0d 69 6d 70 6f 72 74  61 6e 74 2e 20 59 6f 75  |y.important. You|
00000a80  27 6c 6c 20 70 72 6f 62  61 62 6c 79 20 77 61 6e  |'ll probably wan|
00000a90  74 20 74 6f 20 64 6f 20  73 6f 6d 65 20 72 61 6e  |t to do some ran|
00000aa0  67 65 20 63 68 65 63 6b  69 6e 67 20 6f 6e 20 74  |ge checking on t|
00000ab0  68 65 20 6d 65 6d 6f 72  79 0d 70 6f 69 6e 74 65  |he memory.pointe|
00000ac0  72 20 27 20 61 64 64 72  4c 27 20 61 6e 64 20 27  |r ' addrL' and '|
00000ad0  61 64 64 72 48 27 20 61  73 20 74 68 65 73 65 20  |addrH' as these |
00000ae0  6d 75 73 74 20 6f 66 20  63 6f 75 72 73 65 20 62  |must of course b|
00000af0  65 20 73 6f 6d 65 77 68  65 72 65 20 69 6e 20 52  |e somewhere in R|
00000b00  41 4d 2e 0d 0d 41 6e 6f  74 68 65 72 20 66 65 61  |AM...Another fea|
00000b10  74 75 72 65 20 77 68 69  63 68 20 63 6f 75 6c 64  |ture which could|
00000b20  20 70 72 6f 76 65 20 68  61 6e 64 79 20 69 73 20  | prove handy is |
00000b30  74 68 65 20 68 61 6e 64  6c 69 6e 67 20 6f 66 20  |the handling of |
00000b40  63 61 72 72 69 61 67 65  20 72 65 0d 74 75 72 6e  |carriage re.turn|
00000b50  20 6d 61 72 6b 65 72 73  20 75 73 65 64 20 62 79  | markers used by|
00000b60  20 6f 74 68 65 72 20 6f  70 65 72 61 74 69 6e 67  | other operating|
00000b70  20 73 79 73 74 65 6d 73  2e 20 44 4f 53 20 75 73  | systems. DOS us|
00000b80  65 73 20 61 20 43 52 20  61 6e 64 0d 6c 69 6e 65  |es a CR and.line|
00000b90  66 65 65 64 2c 20 41 72  63 68 69 6d 65 64 65 73  |feed, Archimedes|
00000ba0  20 6a 75 73 74 20 75 73  65 20 74 68 65 20 6c 69  | just use the li|
00000bb0  6e 65 66 65 65 64 2c 20  74 68 65 20 62 65 65 62  |nefeed, the beeb|
00000bc0  20 75 73 65 73 20 62 6f  74 68 21 0d 0d 54 6f 20  | uses both!..To |
00000bd0  64 6f 20 74 68 69 73 20  2d 20 69 66 20 79 6f 75  |do this - if you|
00000be0  20 66 69 6e 64 20 61 20  63 68 61 72 61 63 74 65  | find a characte|
00000bf0  72 20 4c 45 53 53 20 54  48 41 4e 20 6f 72 20 45  |r LESS THAN or E|
00000c00  51 55 41 4c 20 54 4f 20  31 33 20 74 68 65 6e 20  |QUAL TO 13 then |
00000c10  61 0d 6e 65 77 6c 69 6e  65 20 69 73 20 70 72 69  |a.newline is pri|
00000c20  6e 74 65 64 2c 20 74 68  65 6e 2c 20 79 6f 75 20  |nted, then, you |
00000c30  6c 6f 6f 6b 20 61 68 65  61 64 20 6f 6e 65 20 62  |look ahead one b|
00000c40  79 74 65 20 74 6f 20 73  65 65 20 69 66 20 74 68  |yte to see if th|
00000c50  61 74 20 69 73 20 61 6c  73 6f 0d 4c 45 53 53 20  |at is also.LESS |
00000c60  54 48 41 4e 20 6f 72 20  45 51 55 41 4c 20 54 4f  |THAN or EQUAL TO|
00000c70  20 31 33 2c 20 62 75 74  20 4e 4f 54 20 74 68 65  | 13, but NOT the|
00000c80  20 73 61 6d 65 20 61 73  20 74 68 65 20 6f 74 68  | same as the oth|
00000c90  65 72 2e 20 54 68 69 73  20 74 68 65 6e 20 74 61  |er. This then ta|
00000ca0  6b 65 73 0d 69 6e 74 6f  20 61 63 63 6f 75 6e 74  |kes.into account|
00000cb0  20 70 65 6f 70 6c 65 20  77 68 6f 20 77 61 6e 74  | people who want|
00000cc0  65 64 20 74 77 6f 20 65  6d 70 74 79 20 6c 69 6e  |ed two empty lin|
00000cd0  65 73 20 6f 6e 65 20 61  66 74 65 72 20 61 6e 6f  |es one after ano|
00000ce0  74 68 65 72 20 69 6e 20  74 68 65 69 72 0d 74 65  |ther in their.te|
00000cf0  78 74 2e 20 44 69 73 63  61 72 64 20 74 68 65 20  |xt. Discard the |
00000d00  73 65 63 6f 6e 64 20 62  79 74 65 20 69 66 20 69  |second byte if i|
00000d10  74 20 49 53 20 64 69 66  66 65 72 65 6e 74 2e 0d  |t IS different..|
00000d20  0d 53 6f 20 74 68 65 72  65 20 69 74 20 69 73 2c  |.So there it is,|
00000d30  0d 53 70 72 6f 77 2e 0d  0d 0d 0d 0d 0d 0d        |.Sprow........|
00000d3e
P/+WRAP1.m0
P/+WRAP1.m1
P/+WRAP1.m2
P/+WRAP1.m4
P/+WRAP1.m5