Home » Archimedes archive » Acorn User » AU 1997-02 B.adf » Regulars » StarInfo/Rawle/!SwiConv/!Help

StarInfo/Rawle/!SwiConv/!Help

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 » Archimedes archive » Acorn User » AU 1997-02 B.adf » Regulars
Filename: StarInfo/Rawle/!SwiConv/!Help
Read OK:
File size: 0872 bytes
Load address: 0000
Exec address: 0000
Duplicates

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

File contents
SWI CONVERTER
Jonathan Rawle 1996


Instructions
------------

SWI converter is a useful tool for any BASIC programmers who use software
interrupts (SWIs) in their programs. SWIs are instructions to the operating
system, and are prefixed in BASIC with the keyword SYS. The command itself
can either be in the form of a string, or a number.

It is far more convenient for the programmer to use the string version as
these are easily remembered and make programs easier to follow. But the
strings take up more memory and disc space than their equivalent numbers,
and execute more slowly.

SWI converter solves this problem, by allowing the programmer to enter a
string and convert it to a number, or vice versa. To use the converter,
install on the iconbar�as usual.�Click to open the main window. Use the
arrow keys to move the caret into either the decimal number, hexadecimal or
text string icon, and enter the command. Press return or click OK, and the
SWI will be converted into the other two forms. You can continue like this,
or use the arrow icons to move through SWIs in numerical order.


A second, and either more useful feature of SWI converter, is the ability to
convert all the SWIs in a program automatically. To use this facility,
simply drag the program icon over the iconbar icon or the window. Another
window will open. Use the "destination" part of the window like an ordinary
save box, to indicate where the converted program should be saved (drag the
icon to a directory display). Use the radio icons to choose which types of
SWI should be converted to which and click OK. After a while, the new
program should be saved.

NOTE: It is not a good idea to save the converted program on top of the old
one. The new version should be tested before the old one is deleted.

If the original program had its SWIs in the form of numbers, and you convert
them to text, this may make some lines too long, and conversion will�fail.
If this happens, split the long lines and try again.

SWI converted will only convert the SWIs prefixed with SYS in BASIC
programs. It will not convert SWIs in assembler. 


Quit the program from the iconbar menu as usual.
00000000  53 57 49 20 43 4f 4e 56  45 52 54 45 52 0a 4a 6f  |SWI CONVERTER.Jo|
00000010  6e 61 74 68 61 6e 20 52  61 77 6c 65 20 31 39 39  |nathan Rawle 199|
00000020  36 0a 0a 0a 49 6e 73 74  72 75 63 74 69 6f 6e 73  |6...Instructions|
00000030  0a 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0a 0a 53  |.------------..S|
00000040  57 49 20 63 6f 6e 76 65  72 74 65 72 20 69 73 20  |WI converter is |
00000050  61 20 75 73 65 66 75 6c  20 74 6f 6f 6c 20 66 6f  |a useful tool fo|
00000060  72 20 61 6e 79 20 42 41  53 49 43 20 70 72 6f 67  |r any BASIC prog|
00000070  72 61 6d 6d 65 72 73 20  77 68 6f 20 75 73 65 20  |rammers who use |
00000080  73 6f 66 74 77 61 72 65  0a 69 6e 74 65 72 72 75  |software.interru|
00000090  70 74 73 20 28 53 57 49  73 29 20 69 6e 20 74 68  |pts (SWIs) in th|
000000a0  65 69 72 20 70 72 6f 67  72 61 6d 73 2e 20 53 57  |eir programs. SW|
000000b0  49 73 20 61 72 65 20 69  6e 73 74 72 75 63 74 69  |Is are instructi|
000000c0  6f 6e 73 20 74 6f 20 74  68 65 20 6f 70 65 72 61  |ons to the opera|
000000d0  74 69 6e 67 0a 73 79 73  74 65 6d 2c 20 61 6e 64  |ting.system, and|
000000e0  20 61 72 65 20 70 72 65  66 69 78 65 64 20 69 6e  | are prefixed in|
000000f0  20 42 41 53 49 43 20 77  69 74 68 20 74 68 65 20  | BASIC with the |
00000100  6b 65 79 77 6f 72 64 20  53 59 53 2e 20 54 68 65  |keyword SYS. The|
00000110  20 63 6f 6d 6d 61 6e 64  20 69 74 73 65 6c 66 0a  | command itself.|
00000120  63 61 6e 20 65 69 74 68  65 72 20 62 65 20 69 6e  |can either be in|
00000130  20 74 68 65 20 66 6f 72  6d 20 6f 66 20 61 20 73  | the form of a s|
00000140  74 72 69 6e 67 2c 20 6f  72 20 61 20 6e 75 6d 62  |tring, or a numb|
00000150  65 72 2e 0a 0a 49 74 20  69 73 20 66 61 72 20 6d  |er...It is far m|
00000160  6f 72 65 20 63 6f 6e 76  65 6e 69 65 6e 74 20 66  |ore convenient f|
00000170  6f 72 20 74 68 65 20 70  72 6f 67 72 61 6d 6d 65  |or the programme|
00000180  72 20 74 6f 20 75 73 65  20 74 68 65 20 73 74 72  |r to use the str|
00000190  69 6e 67 20 76 65 72 73  69 6f 6e 20 61 73 0a 74  |ing version as.t|
000001a0  68 65 73 65 20 61 72 65  20 65 61 73 69 6c 79 20  |hese are easily |
000001b0  72 65 6d 65 6d 62 65 72  65 64 20 61 6e 64 20 6d  |remembered and m|
000001c0  61 6b 65 20 70 72 6f 67  72 61 6d 73 20 65 61 73  |ake programs eas|
000001d0  69 65 72 20 74 6f 20 66  6f 6c 6c 6f 77 2e 20 42  |ier to follow. B|
000001e0  75 74 20 74 68 65 0a 73  74 72 69 6e 67 73 20 74  |ut the.strings t|
000001f0  61 6b 65 20 75 70 20 6d  6f 72 65 20 6d 65 6d 6f  |ake up more memo|
00000200  72 79 20 61 6e 64 20 64  69 73 63 20 73 70 61 63  |ry and disc spac|
00000210  65 20 74 68 61 6e 20 74  68 65 69 72 20 65 71 75  |e than their equ|
00000220  69 76 61 6c 65 6e 74 20  6e 75 6d 62 65 72 73 2c  |ivalent numbers,|
00000230  0a 61 6e 64 20 65 78 65  63 75 74 65 20 6d 6f 72  |.and execute mor|
00000240  65 20 73 6c 6f 77 6c 79  2e 0a 0a 53 57 49 20 63  |e slowly...SWI c|
00000250  6f 6e 76 65 72 74 65 72  20 73 6f 6c 76 65 73 20  |onverter solves |
00000260  74 68 69 73 20 70 72 6f  62 6c 65 6d 2c 20 62 79  |this problem, by|
00000270  20 61 6c 6c 6f 77 69 6e  67 20 74 68 65 20 70 72  | allowing the pr|
00000280  6f 67 72 61 6d 6d 65 72  20 74 6f 20 65 6e 74 65  |ogrammer to ente|
00000290  72 20 61 0a 73 74 72 69  6e 67 20 61 6e 64 20 63  |r a.string and c|
000002a0  6f 6e 76 65 72 74 20 69  74 20 74 6f 20 61 20 6e  |onvert it to a n|
000002b0  75 6d 62 65 72 2c 20 6f  72 20 76 69 63 65 20 76  |umber, or vice v|
000002c0  65 72 73 61 2e 20 54 6f  20 75 73 65 20 74 68 65  |ersa. To use the|
000002d0  20 63 6f 6e 76 65 72 74  65 72 2c 0a 69 6e 73 74  | converter,.inst|
000002e0  61 6c 6c 20 6f 6e 20 74  68 65 20 69 63 6f 6e 62  |all on the iconb|
000002f0  61 72 a0 61 73 20 75 73  75 61 6c 2e a0 43 6c 69  |ar.as usual..Cli|
00000300  63 6b 20 74 6f 20 6f 70  65 6e 20 74 68 65 20 6d  |ck to open the m|
00000310  61 69 6e 20 77 69 6e 64  6f 77 2e 20 55 73 65 20  |ain window. Use |
00000320  74 68 65 0a 61 72 72 6f  77 20 6b 65 79 73 20 74  |the.arrow keys t|
00000330  6f 20 6d 6f 76 65 20 74  68 65 20 63 61 72 65 74  |o move the caret|
00000340  20 69 6e 74 6f 20 65 69  74 68 65 72 20 74 68 65  | into either the|
00000350  20 64 65 63 69 6d 61 6c  20 6e 75 6d 62 65 72 2c  | decimal number,|
00000360  20 68 65 78 61 64 65 63  69 6d 61 6c 20 6f 72 0a  | hexadecimal or.|
00000370  74 65 78 74 20 73 74 72  69 6e 67 20 69 63 6f 6e  |text string icon|
00000380  2c 20 61 6e 64 20 65 6e  74 65 72 20 74 68 65 20  |, and enter the |
00000390  63 6f 6d 6d 61 6e 64 2e  20 50 72 65 73 73 20 72  |command. Press r|
000003a0  65 74 75 72 6e 20 6f 72  20 63 6c 69 63 6b 20 4f  |eturn or click O|
000003b0  4b 2c 20 61 6e 64 20 74  68 65 0a 53 57 49 20 77  |K, and the.SWI w|
000003c0  69 6c 6c 20 62 65 20 63  6f 6e 76 65 72 74 65 64  |ill be converted|
000003d0  20 69 6e 74 6f 20 74 68  65 20 6f 74 68 65 72 20  | into the other |
000003e0  74 77 6f 20 66 6f 72 6d  73 2e 20 59 6f 75 20 63  |two forms. You c|
000003f0  61 6e 20 63 6f 6e 74 69  6e 75 65 20 6c 69 6b 65  |an continue like|
00000400  20 74 68 69 73 2c 0a 6f  72 20 75 73 65 20 74 68  | this,.or use th|
00000410  65 20 61 72 72 6f 77 20  69 63 6f 6e 73 20 74 6f  |e arrow icons to|
00000420  20 6d 6f 76 65 20 74 68  72 6f 75 67 68 20 53 57  | move through SW|
00000430  49 73 20 69 6e 20 6e 75  6d 65 72 69 63 61 6c 20  |Is in numerical |
00000440  6f 72 64 65 72 2e 0a 0a  0a 41 20 73 65 63 6f 6e  |order....A secon|
00000450  64 2c 20 61 6e 64 20 65  69 74 68 65 72 20 6d 6f  |d, and either mo|
00000460  72 65 20 75 73 65 66 75  6c 20 66 65 61 74 75 72  |re useful featur|
00000470  65 20 6f 66 20 53 57 49  20 63 6f 6e 76 65 72 74  |e of SWI convert|
00000480  65 72 2c 20 69 73 20 74  68 65 20 61 62 69 6c 69  |er, is the abili|
00000490  74 79 20 74 6f 0a 63 6f  6e 76 65 72 74 20 61 6c  |ty to.convert al|
000004a0  6c 20 74 68 65 20 53 57  49 73 20 69 6e 20 61 20  |l the SWIs in a |
000004b0  70 72 6f 67 72 61 6d 20  61 75 74 6f 6d 61 74 69  |program automati|
000004c0  63 61 6c 6c 79 2e 20 54  6f 20 75 73 65 20 74 68  |cally. To use th|
000004d0  69 73 20 66 61 63 69 6c  69 74 79 2c 0a 73 69 6d  |is facility,.sim|
000004e0  70 6c 79 20 64 72 61 67  20 74 68 65 20 70 72 6f  |ply drag the pro|
000004f0  67 72 61 6d 20 69 63 6f  6e 20 6f 76 65 72 20 74  |gram icon over t|
00000500  68 65 20 69 63 6f 6e 62  61 72 20 69 63 6f 6e 20  |he iconbar icon |
00000510  6f 72 20 74 68 65 20 77  69 6e 64 6f 77 2e 20 41  |or the window. A|
00000520  6e 6f 74 68 65 72 0a 77  69 6e 64 6f 77 20 77 69  |nother.window wi|
00000530  6c 6c 20 6f 70 65 6e 2e  20 55 73 65 20 74 68 65  |ll open. Use the|
00000540  20 22 64 65 73 74 69 6e  61 74 69 6f 6e 22 20 70  | "destination" p|
00000550  61 72 74 20 6f 66 20 74  68 65 20 77 69 6e 64 6f  |art of the windo|
00000560  77 20 6c 69 6b 65 20 61  6e 20 6f 72 64 69 6e 61  |w like an ordina|
00000570  72 79 0a 73 61 76 65 20  62 6f 78 2c 20 74 6f 20  |ry.save box, to |
00000580  69 6e 64 69 63 61 74 65  20 77 68 65 72 65 20 74  |indicate where t|
00000590  68 65 20 63 6f 6e 76 65  72 74 65 64 20 70 72 6f  |he converted pro|
000005a0  67 72 61 6d 20 73 68 6f  75 6c 64 20 62 65 20 73  |gram should be s|
000005b0  61 76 65 64 20 28 64 72  61 67 20 74 68 65 0a 69  |aved (drag the.i|
000005c0  63 6f 6e 20 74 6f 20 61  20 64 69 72 65 63 74 6f  |con to a directo|
000005d0  72 79 20 64 69 73 70 6c  61 79 29 2e 20 55 73 65  |ry display). Use|
000005e0  20 74 68 65 20 72 61 64  69 6f 20 69 63 6f 6e 73  | the radio icons|
000005f0  20 74 6f 20 63 68 6f 6f  73 65 20 77 68 69 63 68  | to choose which|
00000600  20 74 79 70 65 73 20 6f  66 0a 53 57 49 20 73 68  | types of.SWI sh|
00000610  6f 75 6c 64 20 62 65 20  63 6f 6e 76 65 72 74 65  |ould be converte|
00000620  64 20 74 6f 20 77 68 69  63 68 20 61 6e 64 20 63  |d to which and c|
00000630  6c 69 63 6b 20 4f 4b 2e  20 41 66 74 65 72 20 61  |lick OK. After a|
00000640  20 77 68 69 6c 65 2c 20  74 68 65 20 6e 65 77 0a  | while, the new.|
00000650  70 72 6f 67 72 61 6d 20  73 68 6f 75 6c 64 20 62  |program should b|
00000660  65 20 73 61 76 65 64 2e  0a 0a 4e 4f 54 45 3a 20  |e saved...NOTE: |
00000670  49 74 20 69 73 20 6e 6f  74 20 61 20 67 6f 6f 64  |It is not a good|
00000680  20 69 64 65 61 20 74 6f  20 73 61 76 65 20 74 68  | idea to save th|
00000690  65 20 63 6f 6e 76 65 72  74 65 64 20 70 72 6f 67  |e converted prog|
000006a0  72 61 6d 20 6f 6e 20 74  6f 70 20 6f 66 20 74 68  |ram on top of th|
000006b0  65 20 6f 6c 64 0a 6f 6e  65 2e 20 54 68 65 20 6e  |e old.one. The n|
000006c0  65 77 20 76 65 72 73 69  6f 6e 20 73 68 6f 75 6c  |ew version shoul|
000006d0  64 20 62 65 20 74 65 73  74 65 64 20 62 65 66 6f  |d be tested befo|
000006e0  72 65 20 74 68 65 20 6f  6c 64 20 6f 6e 65 20 69  |re the old one i|
000006f0  73 20 64 65 6c 65 74 65  64 2e 0a 0a 49 66 20 74  |s deleted...If t|
00000700  68 65 20 6f 72 69 67 69  6e 61 6c 20 70 72 6f 67  |he original prog|
00000710  72 61 6d 20 68 61 64 20  69 74 73 20 53 57 49 73  |ram had its SWIs|
00000720  20 69 6e 20 74 68 65 20  66 6f 72 6d 20 6f 66 20  | in the form of |
00000730  6e 75 6d 62 65 72 73 2c  20 61 6e 64 20 79 6f 75  |numbers, and you|
00000740  20 63 6f 6e 76 65 72 74  0a 74 68 65 6d 20 74 6f  | convert.them to|
00000750  20 74 65 78 74 2c 20 74  68 69 73 20 6d 61 79 20  | text, this may |
00000760  6d 61 6b 65 20 73 6f 6d  65 20 6c 69 6e 65 73 20  |make some lines |
00000770  74 6f 6f 20 6c 6f 6e 67  2c 20 61 6e 64 20 63 6f  |too long, and co|
00000780  6e 76 65 72 73 69 6f 6e  20 77 69 6c 6c a0 66 61  |nversion will.fa|
00000790  69 6c 2e 0a 49 66 20 74  68 69 73 20 68 61 70 70  |il..If this happ|
000007a0  65 6e 73 2c 20 73 70 6c  69 74 20 74 68 65 20 6c  |ens, split the l|
000007b0  6f 6e 67 20 6c 69 6e 65  73 20 61 6e 64 20 74 72  |ong lines and tr|
000007c0  79 20 61 67 61 69 6e 2e  0a 0a 53 57 49 20 63 6f  |y again...SWI co|
000007d0  6e 76 65 72 74 65 64 20  77 69 6c 6c 20 6f 6e 6c  |nverted will onl|
000007e0  79 20 63 6f 6e 76 65 72  74 20 74 68 65 20 53 57  |y convert the SW|
000007f0  49 73 20 70 72 65 66 69  78 65 64 20 77 69 74 68  |Is prefixed with|
00000800  20 53 59 53 20 69 6e 20  42 41 53 49 43 0a 70 72  | SYS in BASIC.pr|
00000810  6f 67 72 61 6d 73 2e 20  49 74 20 77 69 6c 6c 20  |ograms. It will |
00000820  6e 6f 74 20 63 6f 6e 76  65 72 74 20 53 57 49 73  |not convert SWIs|
00000830  20 69 6e 20 61 73 73 65  6d 62 6c 65 72 2e 20 0a  | in assembler. .|
00000840  0a 0a 51 75 69 74 20 74  68 65 20 70 72 6f 67 72  |..Quit the progr|
00000850  61 6d 20 66 72 6f 6d 20  74 68 65 20 69 63 6f 6e  |am from the icon|
00000860  62 61 72 20 6d 65 6e 75  20 61 73 20 75 73 75 61  |bar menu as usua|
00000870  6c 2e                                             |l.|
00000872