Home » CEEFAX disks » telesoftware3.adl » 04_12_87/T\OSB07
04_12_87/T\OSB07
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 » CEEFAX disks » telesoftware3.adl |
Filename: | 04_12_87/T\OSB07 |
Read OK: | ✔ |
File size: | 318C bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
OSBITS - An Exploration of the BBC Micro at Machine Level By Programmer ........................................................... Part 7: Operating System Calls (II) - I/0 In this second look at operating system routines I'll deal with those relating to input and output. It's one of the beauties of the BBC Micro OS that the routines for input and output (I/O) are independent of the source or destination of that I/O. The selection of source and destination (known as the input and output stream) are the province of some of the OSBYTE calls. To summarise the I/O routines first: Input is handled by OSRDCH which stands for OS Read Character Output is handled by OSWRCH which stands for OS Write Character together with the related calls OSASCI and OSNEWL Selection of source is by using OSBYTE 2 Selection of destination is by using OSBYTE 3 To recap, the OS routines are in fact subroutines entered at known addresses in the OS ROM. To use them the necessary values for the registers are set and then you JSR to the routine and it will RTS back to you when its work is done. OSRDCH starts at address &FFE0 and when called it works rather like the GET function in BBC BASIC. It will wait for the next character to enter the input buffer for whichever stream is selected and put it, or rather its ASCII value, into the accumulator. An error can occur while OSRDCH is operating. The most common is an ESCAPE in which case A will contain 27 and the carry flag will be set, as it is for any error. An ESCAPE must be acknowledged by calling OSBYTE 126. OSWRCH starts at address &FFEE and takes the ASCII value in the accumulator and sends it to the current output stream. Note that if certain control codes are sent to the VDU drivers, i.e. the screen, then some bytes following will be interpreted as parameters for VDU commands such as PLOT and TAB equivalents. [This is not the case when sending to, say, a printer only, when all bytes are passed on. There is a difference here between the effect of defining printer as the only output stream using OSBYTE 3 and prefixing a string of bytes with a 2 (as in VDU2) to select the printer. In the latter case the bytes associated with control codes are not sent.] There are two other routines related to OSWRCH. OSASCI, which starts at &FFE3, behaves exactly as OSWRCH except when the byte passed is 13 (&0D) which is a carriage return. In this case a line feed (10 or &0A) is sent followed by a carriage return. In other words a new line is selected. The code to do this is contained in OSNEWL at &FFE7 which, when called, will send a line feed followed by a carriage return. [As another aside, the choice of LF then CR is curious as the 'standard' dating from the days of mechanical teletypes is for a CR then an LF. This was so that during the carriage flyback a line feed would occur rather than a printable character. The appearance of a printable character at this time would probably result in it being printed during the flyback! If you ever send a telex from your micro make sure you perform a new line as CR+LF for that reason.] The input and output streams are these: For input you have the keyboard and the RS423. For output you have the screen (VDU), printer, RS423 and a spooled file. Note that the printer could operate through the RS423. Input selection is using OSBYTE 2 (*FX2) and you have three choices. The accumulator, obviously, contains 2. If X contains 0 (default) then the keyboard will be selected and the RS423 will be disabled (this means no carrier would be sent by a modem for example). If X contains 1 then the RS423 is both enabled and selected as input. If X contains 2 then the RS423 is enabled but input is from the keyboard. When OSBYTE 2 has been called the X register will contain a 0 if the previous input was from the keyboard and a 1 if it came from the RS423. Output selection is by using OSBYTE 3 and Y should contain 0. The selection or not of a particular output is related to the bits of X like this. If bit 0 is set then the RS423 driver is on If bit 1 is set then the VDU driver is off If bit 2 is set then the printer driver is off If bit 3 is set then the printer is selected without VDU 2 If bit 4 is set then the spooled output is disabled If bit 6 is set then the printer is disabled (except for characters preceded by VDU 1) Bits 5 and 7 are not used. The default is X=0 which means the RS423 is disabled, the VDU is selected and the printer driver is on if it is selected by VDU 2. You can also spool to a file. To send to a printer only then X should be set to 10. All characters will then go to the printer without being checked by the VDU drivers for control codes etc. Note that in the case of a spooled file you only enable the facility with OSBYTE 3 and do not actually generate the file itself. That has to be done separately such as by *SPOOL filename. After using OSBYTE 3 the X register will contain a byte holding the previous output stream configuration. This information would be useful if you wanted to change the output stream temporarily, do something, and then return to its previous configuration. You use OSBYTE 5 to select the printer destination you want with a choice of a sink (i.e. characters just vanish, useful for debugging), parallel, RS423, network and user routines. I won't go into detail here, you should refer to an advanced reference or user guide for information about all these calls. I've already said that sending to the VDU drivers with OSWRCH (and OSASCI) will sometimes carry out plots and the like. In fact you can think of these two as being the same: LDA #19:JSR oswrch:LDA #2:JSR oswrch:LDA #4:JSR oswrch: LDA #0:JSR oswrch:JSR oswrch:JSR oswrch and VDU 19,2,4,0,0,0 and they both set logical colour 2 to actual colour 4. Apart from the restriction that you have to work a byte at a time the use of OSWRCH in this way is exactly like BASIC's VDU codes for graphics and user defined characters and so on. The bytes to be sent down OSWRCH could be sent from a list, and there is an example of this in the program in the first module B/osb01 which prints out a message in this way. In a later module I will deal with modifying these OS routines for your own nefarious purposes by making use of the vectors. And so to this module's program. It is, I hope, reasonably self documenting and uses OSWRCH in a number of ways to print out a string proportionally spaced. The string to be printed is passed to the routine from BASIC using CALL with parameters. I've used this method to make it easy for you to experiment using the routine in your own programs. There is an important point to be made using CALL for machine code however, and that is the use of zero page for post-indexed indirect addressing. Now I know that's a bit of a mouthful but this is what it looks like. LDA (zp), Y In this case A is loaded with the value stored Y bytes above the address stored in zp and zp+1. zp is in zero page and you have to use the Y register for the index. If you remember that in 6502 assembler (memory) means the address stored in locations memory and memory+1 you should not go far wrong. [There is another, somewhat more esoteric, addressing mode called pre-indexed indirect addressing which uses X as an index and is written LDA (zp, X) In this case A is loaded with the value stored at the address stored in zp+X and zp+X+1.] Post (and pre) indexed addressing is also used with mnemonics other than LDA. If you design and write a sideways ROM which needs some private workspace, this is the sort of ROM that raises the value of PAGE, then the OS will allocate that workspace for you. To actually use this memory is not straightforward because you have to find out where it is from the OS when the ROM is initialised. So you put the workspace address into a couple of addresses in zero page you use post-indexed indirect addressing to access it. When you use CALL from BASIC with a set of parameters attached BASIC allocates a block of memory starting at &600 where these parameters are stored. If, however, one of these parameters is a string then the &600 block only contains a pointer to the start of a string information block. If you transfer this pointer into zero page you can then use post-indexed indirect addressing to look through the block, which is what B/osb07 does. Let's start at the beginning. B/osb07 only sets up the routine which will print out a string proportionally spaced. To use it you must be in Mode 1 or Mode 4 and define a string variable to be your required string, let's call it M$. The graphics cursor must be positioned where you want the printing to start by using MOVE. Then, since code% is the address of the routine, you CALL code%, M$ When you have run the assembler press f2 and a little sentence will be printed in Mode 4. Without shadow memory or a second processor you will not be able to get into Mode 1 with the assembler source in memory. The variable block% is defined as being &600, which is where the CALL parameter block lives. At block% itself is stored the number of parameters; we want a single one and if there are more we exit because there has been a mistake. I could have made the routine print out a message saying "Too Many Parameters for Proportional Spacing" or even generated an error, but for the moment I'll just exit. Error trapping will appear in a later module. At block%+3 is a byte which tells us what kind of parameter we have. If it is 129 then we have a string. (Full details of CALL with parameters is in the User Guide.) Once satisfied that we have a single string parameter available the program takes the address stored at block%+1 and block%+2 and copies it to a pair of zero page addresses. I chose &8A and &8B for this and zero_page% is defined as &8A early in the code. Initially these will contain the address of a string information block. The first two bytes of this block hold the address of the string itself and the third holds its length. If you can figure out this incredibly convoluted routine then you're not doing badly. The string length is stored away and then the start address is moved into our two zero page addresses with the help of a little bouncing to and from the stack. The next section stores the graphics cursor position, using OSWORD &D, in a block at os_block%. The X co-ordinates will be held from 4 bytes above os_block% itself and I have arranged for this to be address gpos. See lines 1930 and 1940. The reason for storing the old X position is so that if a carriage return is included in the string a new line will start directly under the start of the last one. Next the routine filters out any characters below 32 and above 127 since they are not printable (excepting a carriage return). On a new line the graphics cursor is moved down by 8 graphics units (i.e. the numbers used by a MOVE or PLOT) to space the lines out a little more (like Mode 6 would rather than Mode 4) and you will see in lines 840 to 950 that the assembler equivalent of a relative MOVE has been carried out using OSWRCH. The proportional spacing works by looking up in a table how many 'spare' pixels there are in front and behind a character. There will be spare pixels because the OS defines all characters in an 8x8 block. We can ignore the 8 pixels upwards. Here are two characters of different widths: ** ** *** The W is 7 pixels ** * ** ** wide and the l is ** * ** ** only 4 wide. Both ******* ** are only 7 deep as *** *** ** neither has a ** ** **** descender. So you can see that some characters occupy less of the 8 pixels across than others. The idea is for there to be a single pixel between adjacent characters and this is assumed to be the first of the 8 pixels across the character to the right. This information could be calculated by using OSWORD &A to read the OS definitions but a table is faster to use if slower to work out in the first place. You can see the table from line 1660. So the routine moves the next character across to the left before printing it such that only one pixel will separate it from the previous one. In MODE 1 and MODE 4 one pixel is four graphics units wide, hence the 4 in line 1510. In the next module I shall move back to basics briefly with logical operators AND ORA EOR BIT which will explain what line 1260 is all about (if you haven't already figured it out).
00000000 4f 53 42 49 54 53 20 2d 20 41 6e 20 45 78 70 6c |OSBITS - An Expl| 00000010 6f 72 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 42 |oration of the B| 00000020 42 43 20 4d 69 63 72 6f 20 61 74 20 4d 61 63 68 |BC Micro at Mach| 00000030 69 6e 65 20 4c 65 76 65 6c 0d 0d 42 79 20 50 72 |ine Level..By Pr| 00000040 6f 67 72 61 6d 6d 65 72 0d 0d 2e 2e 2e 2e 2e 2e |ogrammer........| 00000050 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e |................| * 00000080 2e 2e 2e 2e 2e 0d 0d 0d 50 61 72 74 20 37 3a 20 |........Part 7: | 00000090 4f 70 65 72 61 74 69 6e 67 20 53 79 73 74 65 6d |Operating System| 000000a0 20 43 61 6c 6c 73 20 28 49 49 29 20 2d 20 49 2f | Calls (II) - I/| 000000b0 30 0d 0d 0d 49 6e 20 74 68 69 73 20 73 65 63 6f |0...In this seco| 000000c0 6e 64 20 6c 6f 6f 6b 20 61 74 20 6f 70 65 72 61 |nd look at opera| 000000d0 74 69 6e 67 20 73 79 73 74 65 6d 20 72 6f 75 74 |ting system rout| 000000e0 69 6e 65 73 20 49 27 6c 6c 20 64 65 61 6c 0d 77 |ines I'll deal.w| 000000f0 69 74 68 20 74 68 6f 73 65 20 72 65 6c 61 74 69 |ith those relati| 00000100 6e 67 20 74 6f 20 69 6e 70 75 74 20 61 6e 64 20 |ng to input and | 00000110 6f 75 74 70 75 74 2e 20 20 49 74 27 73 20 6f 6e |output. It's on| 00000120 65 20 6f 66 20 74 68 65 0d 62 65 61 75 74 69 65 |e of the.beautie| 00000130 73 20 6f 66 20 74 68 65 20 42 42 43 20 4d 69 63 |s of the BBC Mic| 00000140 72 6f 20 4f 53 20 74 68 61 74 20 74 68 65 20 72 |ro OS that the r| 00000150 6f 75 74 69 6e 65 73 20 66 6f 72 20 69 6e 70 75 |outines for inpu| 00000160 74 20 61 6e 64 0d 6f 75 74 70 75 74 20 28 49 2f |t and.output (I/| 00000170 4f 29 20 61 72 65 20 69 6e 64 65 70 65 6e 64 65 |O) are independe| 00000180 6e 74 20 6f 66 20 74 68 65 20 73 6f 75 72 63 65 |nt of the source| 00000190 20 6f 72 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 | or destination | 000001a0 6f 66 0d 74 68 61 74 20 49 2f 4f 2e 20 20 54 68 |of.that I/O. Th| 000001b0 65 20 73 65 6c 65 63 74 69 6f 6e 20 6f 66 20 73 |e selection of s| 000001c0 6f 75 72 63 65 20 61 6e 64 20 64 65 73 74 69 6e |ource and destin| 000001d0 61 74 69 6f 6e 20 28 6b 6e 6f 77 6e 20 61 73 0d |ation (known as.| 000001e0 74 68 65 20 69 6e 70 75 74 20 61 6e 64 20 6f 75 |the input and ou| 000001f0 74 70 75 74 20 73 74 72 65 61 6d 29 20 61 72 65 |tput stream) are| 00000200 20 74 68 65 20 70 72 6f 76 69 6e 63 65 20 6f 66 | the province of| 00000210 20 73 6f 6d 65 20 6f 66 20 74 68 65 0d 4f 53 42 | some of the.OSB| 00000220 59 54 45 20 63 61 6c 6c 73 2e 0d 0d 54 6f 20 73 |YTE calls...To s| 00000230 75 6d 6d 61 72 69 73 65 20 74 68 65 20 49 2f 4f |ummarise the I/O| 00000240 20 72 6f 75 74 69 6e 65 73 20 66 69 72 73 74 3a | routines first:| 00000250 0d 0d 49 6e 70 75 74 20 69 73 20 68 61 6e 64 6c |..Input is handl| 00000260 65 64 20 62 79 20 4f 53 52 44 43 48 20 77 68 69 |ed by OSRDCH whi| 00000270 63 68 20 73 74 61 6e 64 73 20 66 6f 72 20 4f 53 |ch stands for OS| 00000280 20 52 65 61 64 0d 43 68 61 72 61 63 74 65 72 0d | Read.Character.| 00000290 0d 4f 75 74 70 75 74 20 69 73 20 68 61 6e 64 6c |.Output is handl| 000002a0 65 64 20 62 79 20 4f 53 57 52 43 48 20 77 68 69 |ed by OSWRCH whi| 000002b0 63 68 20 73 74 61 6e 64 73 20 66 6f 72 20 4f 53 |ch stands for OS| 000002c0 20 57 72 69 74 65 0d 43 68 61 72 61 63 74 65 72 | Write.Character| 000002d0 20 74 6f 67 65 74 68 65 72 20 77 69 74 68 20 74 | together with t| 000002e0 68 65 20 72 65 6c 61 74 65 64 20 63 61 6c 6c 73 |he related calls| 000002f0 20 4f 53 41 53 43 49 20 61 6e 64 20 4f 53 4e 45 | OSASCI and OSNE| 00000300 57 4c 0d 0d 53 65 6c 65 63 74 69 6f 6e 20 6f 66 |WL..Selection of| 00000310 20 73 6f 75 72 63 65 20 69 73 20 62 79 20 75 73 | source is by us| 00000320 69 6e 67 20 4f 53 42 59 54 45 20 32 0d 0d 53 65 |ing OSBYTE 2..Se| 00000330 6c 65 63 74 69 6f 6e 20 6f 66 20 64 65 73 74 69 |lection of desti| 00000340 6e 61 74 69 6f 6e 20 69 73 20 62 79 20 75 73 69 |nation is by usi| 00000350 6e 67 20 4f 53 42 59 54 45 20 33 0d 0d 54 6f 20 |ng OSBYTE 3..To | 00000360 72 65 63 61 70 2c 20 74 68 65 20 4f 53 20 72 6f |recap, the OS ro| 00000370 75 74 69 6e 65 73 20 61 72 65 20 69 6e 20 66 61 |utines are in fa| 00000380 63 74 20 73 75 62 72 6f 75 74 69 6e 65 73 20 65 |ct subroutines e| 00000390 6e 74 65 72 65 64 20 61 74 0d 6b 6e 6f 77 6e 20 |ntered at.known | 000003a0 61 64 64 72 65 73 73 65 73 20 69 6e 20 74 68 65 |addresses in the| 000003b0 20 4f 53 20 52 4f 4d 2e 20 20 54 6f 20 75 73 65 | OS ROM. To use| 000003c0 20 74 68 65 6d 20 74 68 65 20 6e 65 63 65 73 73 | them the necess| 000003d0 61 72 79 0d 76 61 6c 75 65 73 20 66 6f 72 20 74 |ary.values for t| 000003e0 68 65 20 72 65 67 69 73 74 65 72 73 20 61 72 65 |he registers are| 000003f0 20 73 65 74 20 61 6e 64 20 74 68 65 6e 20 79 6f | set and then yo| 00000400 75 20 4a 53 52 20 74 6f 20 74 68 65 0d 72 6f 75 |u JSR to the.rou| 00000410 74 69 6e 65 20 61 6e 64 20 69 74 20 77 69 6c 6c |tine and it will| 00000420 20 52 54 53 20 62 61 63 6b 20 74 6f 20 79 6f 75 | RTS back to you| 00000430 20 77 68 65 6e 20 69 74 73 20 77 6f 72 6b 20 69 | when its work i| 00000440 73 20 64 6f 6e 65 2e 0d 0d 4f 53 52 44 43 48 20 |s done...OSRDCH | 00000450 73 74 61 72 74 73 20 61 74 20 61 64 64 72 65 73 |starts at addres| 00000460 73 20 26 46 46 45 30 20 61 6e 64 20 77 68 65 6e |s &FFE0 and when| 00000470 20 63 61 6c 6c 65 64 20 69 74 20 77 6f 72 6b 73 | called it works| 00000480 0d 72 61 74 68 65 72 20 6c 69 6b 65 20 74 68 65 |.rather like the| 00000490 20 47 45 54 20 66 75 6e 63 74 69 6f 6e 20 69 6e | GET function in| 000004a0 20 42 42 43 20 42 41 53 49 43 2e 20 20 49 74 20 | BBC BASIC. It | 000004b0 77 69 6c 6c 20 77 61 69 74 20 66 6f 72 0d 74 68 |will wait for.th| 000004c0 65 20 6e 65 78 74 20 63 68 61 72 61 63 74 65 72 |e next character| 000004d0 20 74 6f 20 65 6e 74 65 72 20 74 68 65 20 69 6e | to enter the in| 000004e0 70 75 74 20 62 75 66 66 65 72 20 66 6f 72 20 77 |put buffer for w| 000004f0 68 69 63 68 65 76 65 72 0d 73 74 72 65 61 6d 20 |hichever.stream | 00000500 69 73 20 73 65 6c 65 63 74 65 64 20 61 6e 64 20 |is selected and | 00000510 70 75 74 20 69 74 2c 20 6f 72 20 72 61 74 68 65 |put it, or rathe| 00000520 72 20 69 74 73 20 41 53 43 49 49 20 76 61 6c 75 |r its ASCII valu| 00000530 65 2c 0d 69 6e 74 6f 20 74 68 65 20 61 63 63 75 |e,.into the accu| 00000540 6d 75 6c 61 74 6f 72 2e 0d 0d 41 6e 20 65 72 72 |mulator...An err| 00000550 6f 72 20 63 61 6e 20 6f 63 63 75 72 20 77 68 69 |or can occur whi| 00000560 6c 65 20 4f 53 52 44 43 48 20 69 73 20 6f 70 65 |le OSRDCH is ope| 00000570 72 61 74 69 6e 67 2e 20 20 54 68 65 20 6d 6f 73 |rating. The mos| 00000580 74 0d 63 6f 6d 6d 6f 6e 20 69 73 20 61 6e 20 45 |t.common is an E| 00000590 53 43 41 50 45 20 69 6e 20 77 68 69 63 68 20 63 |SCAPE in which c| 000005a0 61 73 65 20 41 20 77 69 6c 6c 20 63 6f 6e 74 61 |ase A will conta| 000005b0 69 6e 20 32 37 20 61 6e 64 20 74 68 65 0d 63 61 |in 27 and the.ca| 000005c0 72 72 79 20 66 6c 61 67 20 77 69 6c 6c 20 62 65 |rry flag will be| 000005d0 20 73 65 74 2c 20 61 73 20 69 74 20 69 73 20 66 | set, as it is f| 000005e0 6f 72 20 61 6e 79 20 65 72 72 6f 72 2e 20 20 41 |or any error. A| 000005f0 6e 20 45 53 43 41 50 45 0d 6d 75 73 74 20 62 65 |n ESCAPE.must be| 00000600 20 61 63 6b 6e 6f 77 6c 65 64 67 65 64 20 62 79 | acknowledged by| 00000610 20 63 61 6c 6c 69 6e 67 20 4f 53 42 59 54 45 20 | calling OSBYTE | 00000620 31 32 36 2e 0d 0d 4f 53 57 52 43 48 20 73 74 61 |126...OSWRCH sta| 00000630 72 74 73 20 61 74 20 61 64 64 72 65 73 73 20 26 |rts at address &| 00000640 46 46 45 45 20 61 6e 64 20 74 61 6b 65 73 20 74 |FFEE and takes t| 00000650 68 65 20 41 53 43 49 49 20 76 61 6c 75 65 20 69 |he ASCII value i| 00000660 6e 0d 74 68 65 20 61 63 63 75 6d 75 6c 61 74 6f |n.the accumulato| 00000670 72 20 61 6e 64 20 73 65 6e 64 73 20 69 74 20 74 |r and sends it t| 00000680 6f 20 74 68 65 20 63 75 72 72 65 6e 74 20 6f 75 |o the current ou| 00000690 74 70 75 74 20 73 74 72 65 61 6d 2e 20 0d 4e 6f |tput stream. .No| 000006a0 74 65 20 74 68 61 74 20 69 66 20 63 65 72 74 61 |te that if certa| 000006b0 69 6e 20 63 6f 6e 74 72 6f 6c 20 63 6f 64 65 73 |in control codes| 000006c0 20 61 72 65 20 73 65 6e 74 20 74 6f 20 74 68 65 | are sent to the| 000006d0 20 56 44 55 0d 64 72 69 76 65 72 73 2c 20 69 2e | VDU.drivers, i.| 000006e0 65 2e 20 74 68 65 20 73 63 72 65 65 6e 2c 20 74 |e. the screen, t| 000006f0 68 65 6e 20 73 6f 6d 65 20 62 79 74 65 73 20 66 |hen some bytes f| 00000700 6f 6c 6c 6f 77 69 6e 67 20 77 69 6c 6c 20 62 65 |ollowing will be| 00000710 0d 69 6e 74 65 72 70 72 65 74 65 64 20 61 73 20 |.interpreted as | 00000720 70 61 72 61 6d 65 74 65 72 73 20 66 6f 72 20 56 |parameters for V| 00000730 44 55 20 63 6f 6d 6d 61 6e 64 73 20 73 75 63 68 |DU commands such| 00000740 20 61 73 20 50 4c 4f 54 20 61 6e 64 0d 54 41 42 | as PLOT and.TAB| 00000750 20 65 71 75 69 76 61 6c 65 6e 74 73 2e 0d 0d 5b | equivalents...[| 00000760 54 68 69 73 20 69 73 20 6e 6f 74 20 74 68 65 20 |This is not the | 00000770 63 61 73 65 20 77 68 65 6e 20 73 65 6e 64 69 6e |case when sendin| 00000780 67 20 74 6f 2c 20 73 61 79 2c 20 61 20 70 72 69 |g to, say, a pri| 00000790 6e 74 65 72 20 6f 6e 6c 79 2c 0d 77 68 65 6e 20 |nter only,.when | 000007a0 61 6c 6c 20 62 79 74 65 73 20 61 72 65 20 70 61 |all bytes are pa| 000007b0 73 73 65 64 20 6f 6e 2e 20 20 54 68 65 72 65 20 |ssed on. There | 000007c0 69 73 20 61 20 64 69 66 66 65 72 65 6e 63 65 20 |is a difference | 000007d0 68 65 72 65 0d 62 65 74 77 65 65 6e 20 74 68 65 |here.between the| 000007e0 20 65 66 66 65 63 74 20 6f 66 20 64 65 66 69 6e | effect of defin| 000007f0 69 6e 67 20 70 72 69 6e 74 65 72 20 61 73 20 74 |ing printer as t| 00000800 68 65 20 6f 6e 6c 79 20 6f 75 74 70 75 74 0d 73 |he only output.s| 00000810 74 72 65 61 6d 20 75 73 69 6e 67 20 4f 53 42 59 |tream using OSBY| 00000820 54 45 20 33 20 61 6e 64 20 70 72 65 66 69 78 69 |TE 3 and prefixi| 00000830 6e 67 20 61 20 73 74 72 69 6e 67 20 6f 66 20 62 |ng a string of b| 00000840 79 74 65 73 20 77 69 74 68 20 61 0d 32 20 28 61 |ytes with a.2 (a| 00000850 73 20 69 6e 20 56 44 55 32 29 20 74 6f 20 73 65 |s in VDU2) to se| 00000860 6c 65 63 74 20 74 68 65 20 70 72 69 6e 74 65 72 |lect the printer| 00000870 2e 20 20 49 6e 20 74 68 65 20 6c 61 74 74 65 72 |. In the latter| 00000880 20 63 61 73 65 0d 74 68 65 20 62 79 74 65 73 20 | case.the bytes | 00000890 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 |associated with | 000008a0 63 6f 6e 74 72 6f 6c 20 63 6f 64 65 73 20 61 72 |control codes ar| 000008b0 65 20 6e 6f 74 20 73 65 6e 74 2e 5d 0d 0d 54 68 |e not sent.]..Th| 000008c0 65 72 65 20 61 72 65 20 74 77 6f 20 6f 74 68 65 |ere are two othe| 000008d0 72 20 72 6f 75 74 69 6e 65 73 20 72 65 6c 61 74 |r routines relat| 000008e0 65 64 20 74 6f 20 4f 53 57 52 43 48 2e 20 20 4f |ed to OSWRCH. O| 000008f0 53 41 53 43 49 2c 0d 77 68 69 63 68 20 73 74 61 |SASCI,.which sta| 00000900 72 74 73 20 61 74 20 26 46 46 45 33 2c 20 62 65 |rts at &FFE3, be| 00000910 68 61 76 65 73 20 65 78 61 63 74 6c 79 20 61 73 |haves exactly as| 00000920 20 4f 53 57 52 43 48 20 65 78 63 65 70 74 20 77 | OSWRCH except w| 00000930 68 65 6e 0d 74 68 65 20 62 79 74 65 20 70 61 73 |hen.the byte pas| 00000940 73 65 64 20 69 73 20 31 33 20 28 26 30 44 29 20 |sed is 13 (&0D) | 00000950 77 68 69 63 68 20 69 73 20 61 20 63 61 72 72 69 |which is a carri| 00000960 61 67 65 20 72 65 74 75 72 6e 2e 20 20 49 6e 0d |age return. In.| 00000970 74 68 69 73 20 63 61 73 65 20 61 20 6c 69 6e 65 |this case a line| 00000980 20 66 65 65 64 20 28 31 30 20 6f 72 20 26 30 41 | feed (10 or &0A| 00000990 29 20 69 73 20 73 65 6e 74 20 66 6f 6c 6c 6f 77 |) is sent follow| 000009a0 65 64 20 62 79 20 61 0d 63 61 72 72 69 61 67 65 |ed by a.carriage| 000009b0 20 72 65 74 75 72 6e 2e 20 20 49 6e 20 6f 74 68 | return. In oth| 000009c0 65 72 20 77 6f 72 64 73 20 61 20 6e 65 77 20 6c |er words a new l| 000009d0 69 6e 65 20 69 73 20 73 65 6c 65 63 74 65 64 2e |ine is selected.| 000009e0 20 0d 54 68 65 20 63 6f 64 65 20 74 6f 20 64 6f | .The code to do| 000009f0 20 74 68 69 73 20 69 73 20 63 6f 6e 74 61 69 6e | this is contain| 00000a00 65 64 20 69 6e 20 4f 53 4e 45 57 4c 20 61 74 20 |ed in OSNEWL at | 00000a10 26 46 46 45 37 20 77 68 69 63 68 2c 0d 77 68 65 |&FFE7 which,.whe| 00000a20 6e 20 63 61 6c 6c 65 64 2c 20 77 69 6c 6c 20 73 |n called, will s| 00000a30 65 6e 64 20 61 20 6c 69 6e 65 20 66 65 65 64 20 |end a line feed | 00000a40 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 20 63 61 |followed by a ca| 00000a50 72 72 69 61 67 65 0d 72 65 74 75 72 6e 2e 0d 0d |rriage.return...| 00000a60 5b 41 73 20 61 6e 6f 74 68 65 72 20 61 73 69 64 |[As another asid| 00000a70 65 2c 20 74 68 65 20 63 68 6f 69 63 65 20 6f 66 |e, the choice of| 00000a80 20 4c 46 20 74 68 65 6e 20 43 52 20 69 73 20 63 | LF then CR is c| 00000a90 75 72 69 6f 75 73 20 61 73 0d 74 68 65 20 27 73 |urious as.the 's| 00000aa0 74 61 6e 64 61 72 64 27 20 64 61 74 69 6e 67 20 |tandard' dating | 00000ab0 66 72 6f 6d 20 74 68 65 20 64 61 79 73 20 6f 66 |from the days of| 00000ac0 20 6d 65 63 68 61 6e 69 63 61 6c 20 74 65 6c 65 | mechanical tele| 00000ad0 74 79 70 65 73 0d 69 73 20 66 6f 72 20 61 20 43 |types.is for a C| 00000ae0 52 20 74 68 65 6e 20 61 6e 20 4c 46 2e 20 20 54 |R then an LF. T| 00000af0 68 69 73 20 77 61 73 20 73 6f 20 74 68 61 74 20 |his was so that | 00000b00 64 75 72 69 6e 67 20 74 68 65 0d 63 61 72 72 69 |during the.carri| 00000b10 61 67 65 20 66 6c 79 62 61 63 6b 20 61 20 6c 69 |age flyback a li| 00000b20 6e 65 20 66 65 65 64 20 77 6f 75 6c 64 20 6f 63 |ne feed would oc| 00000b30 63 75 72 20 72 61 74 68 65 72 20 74 68 61 6e 20 |cur rather than | 00000b40 61 0d 70 72 69 6e 74 61 62 6c 65 20 63 68 61 72 |a.printable char| 00000b50 61 63 74 65 72 2e 20 20 54 68 65 20 61 70 70 65 |acter. The appe| 00000b60 61 72 61 6e 63 65 20 6f 66 20 61 20 70 72 69 6e |arance of a prin| 00000b70 74 61 62 6c 65 0d 63 68 61 72 61 63 74 65 72 20 |table.character | 00000b80 61 74 20 74 68 69 73 20 74 69 6d 65 20 77 6f 75 |at this time wou| 00000b90 6c 64 20 70 72 6f 62 61 62 6c 79 20 72 65 73 75 |ld probably resu| 00000ba0 6c 74 20 69 6e 20 69 74 20 62 65 69 6e 67 0d 70 |lt in it being.p| 00000bb0 72 69 6e 74 65 64 20 64 75 72 69 6e 67 20 74 68 |rinted during th| 00000bc0 65 20 66 6c 79 62 61 63 6b 21 20 20 49 66 20 79 |e flyback! If y| 00000bd0 6f 75 20 65 76 65 72 20 73 65 6e 64 20 61 20 74 |ou ever send a t| 00000be0 65 6c 65 78 20 66 72 6f 6d 0d 79 6f 75 72 20 6d |elex from.your m| 00000bf0 69 63 72 6f 20 6d 61 6b 65 20 73 75 72 65 20 79 |icro make sure y| 00000c00 6f 75 20 70 65 72 66 6f 72 6d 20 61 20 6e 65 77 |ou perform a new| 00000c10 20 6c 69 6e 65 20 61 73 20 43 52 2b 4c 46 20 66 | line as CR+LF f| 00000c20 6f 72 0d 74 68 61 74 20 72 65 61 73 6f 6e 2e 5d |or.that reason.]| 00000c30 0d 0d 54 68 65 20 69 6e 70 75 74 20 61 6e 64 20 |..The input and | 00000c40 6f 75 74 70 75 74 20 73 74 72 65 61 6d 73 20 61 |output streams a| 00000c50 72 65 20 74 68 65 73 65 3a 0d 0d 46 6f 72 20 69 |re these:..For i| 00000c60 6e 70 75 74 20 79 6f 75 20 68 61 76 65 20 74 68 |nput you have th| 00000c70 65 20 6b 65 79 62 6f 61 72 64 20 61 6e 64 20 74 |e keyboard and t| 00000c80 68 65 20 52 53 34 32 33 2e 20 20 46 6f 72 20 6f |he RS423. For o| 00000c90 75 74 70 75 74 0d 79 6f 75 20 68 61 76 65 20 74 |utput.you have t| 00000ca0 68 65 20 73 63 72 65 65 6e 20 28 56 44 55 29 2c |he screen (VDU),| 00000cb0 20 70 72 69 6e 74 65 72 2c 20 52 53 34 32 33 20 | printer, RS423 | 00000cc0 61 6e 64 20 61 20 73 70 6f 6f 6c 65 64 0d 66 69 |and a spooled.fi| 00000cd0 6c 65 2e 20 20 4e 6f 74 65 20 74 68 61 74 20 74 |le. Note that t| 00000ce0 68 65 20 70 72 69 6e 74 65 72 20 63 6f 75 6c 64 |he printer could| 00000cf0 20 6f 70 65 72 61 74 65 20 74 68 72 6f 75 67 68 | operate through| 00000d00 20 74 68 65 0d 52 53 34 32 33 2e 0d 0d 49 6e 70 | the.RS423...Inp| 00000d10 75 74 20 73 65 6c 65 63 74 69 6f 6e 20 69 73 20 |ut selection is | 00000d20 75 73 69 6e 67 20 4f 53 42 59 54 45 20 32 20 28 |using OSBYTE 2 (| 00000d30 2a 46 58 32 29 20 61 6e 64 20 79 6f 75 20 68 61 |*FX2) and you ha| 00000d40 76 65 20 74 68 72 65 65 0d 63 68 6f 69 63 65 73 |ve three.choices| 00000d50 2e 20 20 54 68 65 20 61 63 63 75 6d 75 6c 61 74 |. The accumulat| 00000d60 6f 72 2c 20 6f 62 76 69 6f 75 73 6c 79 2c 20 63 |or, obviously, c| 00000d70 6f 6e 74 61 69 6e 73 20 32 2e 0d 0d 49 66 20 58 |ontains 2...If X| 00000d80 20 63 6f 6e 74 61 69 6e 73 20 30 20 28 64 65 66 | contains 0 (def| 00000d90 61 75 6c 74 29 20 74 68 65 6e 20 74 68 65 20 6b |ault) then the k| 00000da0 65 79 62 6f 61 72 64 20 77 69 6c 6c 20 62 65 20 |eyboard will be | 00000db0 73 65 6c 65 63 74 65 64 0d 61 6e 64 20 74 68 65 |selected.and the| 00000dc0 20 52 53 34 32 33 20 77 69 6c 6c 20 62 65 20 64 | RS423 will be d| 00000dd0 69 73 61 62 6c 65 64 20 28 74 68 69 73 20 6d 65 |isabled (this me| 00000de0 61 6e 73 20 6e 6f 20 63 61 72 72 69 65 72 20 77 |ans no carrier w| 00000df0 6f 75 6c 64 0d 62 65 20 73 65 6e 74 20 62 79 20 |ould.be sent by | 00000e00 61 20 6d 6f 64 65 6d 20 66 6f 72 20 65 78 61 6d |a modem for exam| 00000e10 70 6c 65 29 2e 0d 0d 49 66 20 58 20 63 6f 6e 74 |ple)...If X cont| 00000e20 61 69 6e 73 20 31 20 74 68 65 6e 20 74 68 65 20 |ains 1 then the | 00000e30 52 53 34 32 33 20 69 73 20 62 6f 74 68 20 65 6e |RS423 is both en| 00000e40 61 62 6c 65 64 20 61 6e 64 20 73 65 6c 65 63 74 |abled and select| 00000e50 65 64 0d 61 73 20 69 6e 70 75 74 2e 0d 0d 49 66 |ed.as input...If| 00000e60 20 58 20 63 6f 6e 74 61 69 6e 73 20 32 20 74 68 | X contains 2 th| 00000e70 65 6e 20 74 68 65 20 52 53 34 32 33 20 69 73 20 |en the RS423 is | 00000e80 65 6e 61 62 6c 65 64 20 62 75 74 20 69 6e 70 75 |enabled but inpu| 00000e90 74 20 69 73 20 66 72 6f 6d 0d 74 68 65 20 6b 65 |t is from.the ke| 00000ea0 79 62 6f 61 72 64 2e 0d 0d 57 68 65 6e 20 4f 53 |yboard...When OS| 00000eb0 42 59 54 45 20 32 20 68 61 73 20 62 65 65 6e 20 |BYTE 2 has been | 00000ec0 63 61 6c 6c 65 64 20 74 68 65 20 58 20 72 65 67 |called the X reg| 00000ed0 69 73 74 65 72 20 77 69 6c 6c 20 63 6f 6e 74 61 |ister will conta| 00000ee0 69 6e 20 61 0d 30 20 69 66 20 74 68 65 20 70 72 |in a.0 if the pr| 00000ef0 65 76 69 6f 75 73 20 69 6e 70 75 74 20 77 61 73 |evious input was| 00000f00 20 66 72 6f 6d 20 74 68 65 20 6b 65 79 62 6f 61 | from the keyboa| 00000f10 72 64 20 61 6e 64 20 61 20 31 20 69 66 20 69 74 |rd and a 1 if it| 00000f20 0d 63 61 6d 65 20 66 72 6f 6d 20 74 68 65 20 52 |.came from the R| 00000f30 53 34 32 33 2e 0d 0d 0d 4f 75 74 70 75 74 20 73 |S423....Output s| 00000f40 65 6c 65 63 74 69 6f 6e 20 69 73 20 62 79 20 75 |election is by u| 00000f50 73 69 6e 67 20 4f 53 42 59 54 45 20 33 20 61 6e |sing OSBYTE 3 an| 00000f60 64 20 59 20 73 68 6f 75 6c 64 20 63 6f 6e 74 61 |d Y should conta| 00000f70 69 6e 0d 30 2e 20 20 54 68 65 20 73 65 6c 65 63 |in.0. The selec| 00000f80 74 69 6f 6e 20 6f 72 20 6e 6f 74 20 6f 66 20 61 |tion or not of a| 00000f90 20 70 61 72 74 69 63 75 6c 61 72 20 6f 75 74 70 | particular outp| 00000fa0 75 74 20 69 73 20 72 65 6c 61 74 65 64 0d 74 6f |ut is related.to| 00000fb0 20 74 68 65 20 62 69 74 73 20 6f 66 20 58 20 6c | the bits of X l| 00000fc0 69 6b 65 20 74 68 69 73 2e 0d 0d 49 66 20 62 69 |ike this...If bi| 00000fd0 74 20 30 20 69 73 20 73 65 74 20 74 68 65 6e 20 |t 0 is set then | 00000fe0 74 68 65 20 52 53 34 32 33 20 64 72 69 76 65 72 |the RS423 driver| 00000ff0 20 69 73 20 6f 6e 0d 49 66 20 62 69 74 20 31 20 | is on.If bit 1 | 00001000 69 73 20 73 65 74 20 74 68 65 6e 20 74 68 65 20 |is set then the | 00001010 56 44 55 20 64 72 69 76 65 72 20 69 73 20 6f 66 |VDU driver is of| 00001020 66 0d 49 66 20 62 69 74 20 32 20 69 73 20 73 65 |f.If bit 2 is se| 00001030 74 20 74 68 65 6e 20 74 68 65 20 70 72 69 6e 74 |t then the print| 00001040 65 72 20 64 72 69 76 65 72 20 69 73 20 6f 66 66 |er driver is off| 00001050 0d 49 66 20 62 69 74 20 33 20 69 73 20 73 65 74 |.If bit 3 is set| 00001060 20 74 68 65 6e 20 74 68 65 20 70 72 69 6e 74 65 | then the printe| 00001070 72 20 69 73 20 73 65 6c 65 63 74 65 64 20 77 69 |r is selected wi| 00001080 74 68 6f 75 74 20 56 44 55 20 32 0d 49 66 20 62 |thout VDU 2.If b| 00001090 69 74 20 34 20 69 73 20 73 65 74 20 74 68 65 6e |it 4 is set then| 000010a0 20 74 68 65 20 73 70 6f 6f 6c 65 64 20 6f 75 74 | the spooled out| 000010b0 70 75 74 20 69 73 20 64 69 73 61 62 6c 65 64 0d |put is disabled.| 000010c0 49 66 20 62 69 74 20 36 20 69 73 20 73 65 74 20 |If bit 6 is set | 000010d0 74 68 65 6e 20 74 68 65 20 70 72 69 6e 74 65 72 |then the printer| 000010e0 20 69 73 20 64 69 73 61 62 6c 65 64 20 28 65 78 | is disabled (ex| 000010f0 63 65 70 74 20 66 6f 72 0d 63 68 61 72 61 63 74 |cept for.charact| 00001100 65 72 73 20 70 72 65 63 65 64 65 64 20 62 79 20 |ers preceded by | 00001110 56 44 55 20 31 29 0d 42 69 74 73 20 35 20 61 6e |VDU 1).Bits 5 an| 00001120 64 20 37 20 61 72 65 20 6e 6f 74 20 75 73 65 64 |d 7 are not used| 00001130 2e 0d 0d 54 68 65 20 64 65 66 61 75 6c 74 20 69 |...The default i| 00001140 73 20 58 3d 30 20 77 68 69 63 68 20 6d 65 61 6e |s X=0 which mean| 00001150 73 20 74 68 65 20 52 53 34 32 33 20 69 73 20 64 |s the RS423 is d| 00001160 69 73 61 62 6c 65 64 2c 20 74 68 65 0d 56 44 55 |isabled, the.VDU| 00001170 20 69 73 20 73 65 6c 65 63 74 65 64 20 61 6e 64 | is selected and| 00001180 20 74 68 65 20 70 72 69 6e 74 65 72 20 64 72 69 | the printer dri| 00001190 76 65 72 20 69 73 20 6f 6e 20 69 66 20 69 74 20 |ver is on if it | 000011a0 69 73 0d 73 65 6c 65 63 74 65 64 20 62 79 20 56 |is.selected by V| 000011b0 44 55 20 32 2e 20 20 59 6f 75 20 63 61 6e 20 61 |DU 2. You can a| 000011c0 6c 73 6f 20 73 70 6f 6f 6c 20 74 6f 20 61 20 66 |lso spool to a f| 000011d0 69 6c 65 2e 0d 0d 54 6f 20 73 65 6e 64 20 74 6f |ile...To send to| 000011e0 20 61 20 70 72 69 6e 74 65 72 20 6f 6e 6c 79 20 | a printer only | 000011f0 74 68 65 6e 20 58 20 73 68 6f 75 6c 64 20 62 65 |then X should be| 00001200 20 73 65 74 20 74 6f 20 31 30 2e 20 20 41 6c 6c | set to 10. All| 00001210 0d 63 68 61 72 61 63 74 65 72 73 20 77 69 6c 6c |.characters will| 00001220 20 74 68 65 6e 20 67 6f 20 74 6f 20 74 68 65 20 | then go to the | 00001230 70 72 69 6e 74 65 72 20 77 69 74 68 6f 75 74 20 |printer without | 00001240 62 65 69 6e 67 20 63 68 65 63 6b 65 64 0d 62 79 |being checked.by| 00001250 20 74 68 65 20 56 44 55 20 64 72 69 76 65 72 73 | the VDU drivers| 00001260 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 20 63 6f 64 | for control cod| 00001270 65 73 20 65 74 63 2e 20 20 4e 6f 74 65 20 74 68 |es etc. Note th| 00001280 61 74 20 69 6e 20 74 68 65 0d 63 61 73 65 20 6f |at in the.case o| 00001290 66 20 61 20 73 70 6f 6f 6c 65 64 20 66 69 6c 65 |f a spooled file| 000012a0 20 79 6f 75 20 6f 6e 6c 79 20 65 6e 61 62 6c 65 | you only enable| 000012b0 20 74 68 65 20 66 61 63 69 6c 69 74 79 20 77 69 | the facility wi| 000012c0 74 68 0d 4f 53 42 59 54 45 20 33 20 61 6e 64 20 |th.OSBYTE 3 and | 000012d0 64 6f 20 6e 6f 74 20 61 63 74 75 61 6c 6c 79 20 |do not actually | 000012e0 67 65 6e 65 72 61 74 65 20 74 68 65 20 66 69 6c |generate the fil| 000012f0 65 20 69 74 73 65 6c 66 2e 20 20 54 68 61 74 0d |e itself. That.| 00001300 68 61 73 20 74 6f 20 62 65 20 64 6f 6e 65 20 73 |has to be done s| 00001310 65 70 61 72 61 74 65 6c 79 20 73 75 63 68 20 61 |eparately such a| 00001320 73 20 62 79 20 2a 53 50 4f 4f 4c 20 66 69 6c 65 |s by *SPOOL file| 00001330 6e 61 6d 65 2e 0d 0d 41 66 74 65 72 20 75 73 69 |name...After usi| 00001340 6e 67 20 4f 53 42 59 54 45 20 33 20 74 68 65 20 |ng OSBYTE 3 the | 00001350 58 20 72 65 67 69 73 74 65 72 20 77 69 6c 6c 20 |X register will | 00001360 63 6f 6e 74 61 69 6e 20 61 20 62 79 74 65 0d 68 |contain a byte.h| 00001370 6f 6c 64 69 6e 67 20 74 68 65 20 70 72 65 76 69 |olding the previ| 00001380 6f 75 73 20 6f 75 74 70 75 74 20 73 74 72 65 61 |ous output strea| 00001390 6d 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e |m configuration.| 000013a0 20 20 54 68 69 73 0d 69 6e 66 6f 72 6d 61 74 69 | This.informati| 000013b0 6f 6e 20 77 6f 75 6c 64 20 62 65 20 75 73 65 66 |on would be usef| 000013c0 75 6c 20 69 66 20 79 6f 75 20 77 61 6e 74 65 64 |ul if you wanted| 000013d0 20 74 6f 20 63 68 61 6e 67 65 20 74 68 65 0d 6f | to change the.o| 000013e0 75 74 70 75 74 20 73 74 72 65 61 6d 20 74 65 6d |utput stream tem| 000013f0 70 6f 72 61 72 69 6c 79 2c 20 64 6f 20 73 6f 6d |porarily, do som| 00001400 65 74 68 69 6e 67 2c 20 61 6e 64 20 74 68 65 6e |ething, and then| 00001410 20 72 65 74 75 72 6e 20 74 6f 0d 69 74 73 20 70 | return to.its p| 00001420 72 65 76 69 6f 75 73 20 63 6f 6e 66 69 67 75 72 |revious configur| 00001430 61 74 69 6f 6e 2e 0d 0d 0d 59 6f 75 20 75 73 65 |ation....You use| 00001440 20 4f 53 42 59 54 45 20 35 20 74 6f 20 73 65 6c | OSBYTE 5 to sel| 00001450 65 63 74 20 74 68 65 20 70 72 69 6e 74 65 72 20 |ect the printer | 00001460 64 65 73 74 69 6e 61 74 69 6f 6e 20 79 6f 75 20 |destination you | 00001470 77 61 6e 74 0d 77 69 74 68 20 61 20 63 68 6f 69 |want.with a choi| 00001480 63 65 20 6f 66 20 61 20 73 69 6e 6b 20 28 69 2e |ce of a sink (i.| 00001490 65 2e 20 63 68 61 72 61 63 74 65 72 73 20 6a 75 |e. characters ju| 000014a0 73 74 20 76 61 6e 69 73 68 2c 20 75 73 65 66 75 |st vanish, usefu| 000014b0 6c 0d 66 6f 72 20 64 65 62 75 67 67 69 6e 67 29 |l.for debugging)| 000014c0 2c 20 70 61 72 61 6c 6c 65 6c 2c 20 52 53 34 32 |, parallel, RS42| 000014d0 33 2c 20 6e 65 74 77 6f 72 6b 20 61 6e 64 20 75 |3, network and u| 000014e0 73 65 72 20 72 6f 75 74 69 6e 65 73 2e 0d 0d 49 |ser routines...I| 000014f0 20 77 6f 6e 27 74 20 67 6f 20 69 6e 74 6f 20 64 | won't go into d| 00001500 65 74 61 69 6c 20 68 65 72 65 2c 20 79 6f 75 20 |etail here, you | 00001510 73 68 6f 75 6c 64 20 72 65 66 65 72 20 74 6f 20 |should refer to | 00001520 61 6e 20 61 64 76 61 6e 63 65 64 0d 72 65 66 65 |an advanced.refe| 00001530 72 65 6e 63 65 20 6f 72 20 75 73 65 72 20 67 75 |rence or user gu| 00001540 69 64 65 20 66 6f 72 20 69 6e 66 6f 72 6d 61 74 |ide for informat| 00001550 69 6f 6e 20 61 62 6f 75 74 20 61 6c 6c 20 74 68 |ion about all th| 00001560 65 73 65 0d 63 61 6c 6c 73 2e 0d 0d 49 27 76 65 |ese.calls...I've| 00001570 20 61 6c 72 65 61 64 79 20 73 61 69 64 20 74 68 | already said th| 00001580 61 74 20 73 65 6e 64 69 6e 67 20 74 6f 20 74 68 |at sending to th| 00001590 65 20 56 44 55 20 64 72 69 76 65 72 73 20 77 69 |e VDU drivers wi| 000015a0 74 68 0d 4f 53 57 52 43 48 20 28 61 6e 64 20 4f |th.OSWRCH (and O| 000015b0 53 41 53 43 49 29 20 77 69 6c 6c 20 73 6f 6d 65 |SASCI) will some| 000015c0 74 69 6d 65 73 20 63 61 72 72 79 20 6f 75 74 20 |times carry out | 000015d0 70 6c 6f 74 73 20 61 6e 64 20 74 68 65 0d 6c 69 |plots and the.li| 000015e0 6b 65 2e 20 20 49 6e 20 66 61 63 74 20 79 6f 75 |ke. In fact you| 000015f0 20 63 61 6e 20 74 68 69 6e 6b 20 6f 66 20 74 68 | can think of th| 00001600 65 73 65 20 74 77 6f 20 61 73 20 62 65 69 6e 67 |ese two as being| 00001610 20 74 68 65 20 73 61 6d 65 3a 0d 0d 4c 44 41 20 | the same:..LDA | 00001620 23 31 39 3a 4a 53 52 20 6f 73 77 72 63 68 3a 4c |#19:JSR oswrch:L| 00001630 44 41 20 23 32 3a 4a 53 52 20 6f 73 77 72 63 68 |DA #2:JSR oswrch| 00001640 3a 4c 44 41 20 23 34 3a 4a 53 52 20 6f 73 77 72 |:LDA #4:JSR oswr| 00001650 63 68 3a 0d 4c 44 41 20 23 30 3a 4a 53 52 20 6f |ch:.LDA #0:JSR o| 00001660 73 77 72 63 68 3a 4a 53 52 20 6f 73 77 72 63 68 |swrch:JSR oswrch| 00001670 3a 4a 53 52 20 6f 73 77 72 63 68 0d 0d 61 6e 64 |:JSR oswrch..and| 00001680 0d 0d 56 44 55 20 31 39 2c 32 2c 34 2c 30 2c 30 |..VDU 19,2,4,0,0| 00001690 2c 30 0d 0d 61 6e 64 20 74 68 65 79 20 62 6f 74 |,0..and they bot| 000016a0 68 20 73 65 74 20 6c 6f 67 69 63 61 6c 20 63 6f |h set logical co| 000016b0 6c 6f 75 72 20 32 20 74 6f 20 61 63 74 75 61 6c |lour 2 to actual| 000016c0 20 63 6f 6c 6f 75 72 20 34 2e 20 0d 41 70 61 72 | colour 4. .Apar| 000016d0 74 20 66 72 6f 6d 20 74 68 65 20 72 65 73 74 72 |t from the restr| 000016e0 69 63 74 69 6f 6e 20 74 68 61 74 20 79 6f 75 20 |iction that you | 000016f0 68 61 76 65 20 74 6f 20 77 6f 72 6b 20 61 20 62 |have to work a b| 00001700 79 74 65 20 61 74 20 61 0d 74 69 6d 65 20 74 68 |yte at a.time th| 00001710 65 20 75 73 65 20 6f 66 20 4f 53 57 52 43 48 20 |e use of OSWRCH | 00001720 69 6e 20 74 68 69 73 20 77 61 79 20 69 73 20 65 |in this way is e| 00001730 78 61 63 74 6c 79 20 6c 69 6b 65 20 42 41 53 49 |xactly like BASI| 00001740 43 27 73 0d 56 44 55 20 63 6f 64 65 73 20 66 6f |C's.VDU codes fo| 00001750 72 20 67 72 61 70 68 69 63 73 20 61 6e 64 20 75 |r graphics and u| 00001760 73 65 72 20 64 65 66 69 6e 65 64 20 63 68 61 72 |ser defined char| 00001770 61 63 74 65 72 73 20 61 6e 64 20 73 6f 20 6f 6e |acters and so on| 00001780 2e 20 0d 0d 54 68 65 20 62 79 74 65 73 20 74 6f |. ..The bytes to| 00001790 20 62 65 20 73 65 6e 74 20 64 6f 77 6e 20 4f 53 | be sent down OS| 000017a0 57 52 43 48 20 63 6f 75 6c 64 20 62 65 20 73 65 |WRCH could be se| 000017b0 6e 74 20 66 72 6f 6d 20 61 20 6c 69 73 74 2c 0d |nt from a list,.| 000017c0 61 6e 64 20 74 68 65 72 65 20 69 73 20 61 6e 20 |and there is an | 000017d0 65 78 61 6d 70 6c 65 20 6f 66 20 74 68 69 73 20 |example of this | 000017e0 69 6e 20 74 68 65 20 70 72 6f 67 72 61 6d 20 69 |in the program i| 000017f0 6e 20 74 68 65 20 66 69 72 73 74 0d 6d 6f 64 75 |n the first.modu| 00001800 6c 65 20 42 2f 6f 73 62 30 31 20 77 68 69 63 68 |le B/osb01 which| 00001810 20 70 72 69 6e 74 73 20 6f 75 74 20 61 20 6d 65 | prints out a me| 00001820 73 73 61 67 65 20 69 6e 20 74 68 69 73 20 77 61 |ssage in this wa| 00001830 79 2e 0d 0d 49 6e 20 61 20 6c 61 74 65 72 20 6d |y...In a later m| 00001840 6f 64 75 6c 65 20 49 20 77 69 6c 6c 20 64 65 61 |odule I will dea| 00001850 6c 20 77 69 74 68 20 6d 6f 64 69 66 79 69 6e 67 |l with modifying| 00001860 20 74 68 65 73 65 20 4f 53 0d 72 6f 75 74 69 6e | these OS.routin| 00001870 65 73 20 66 6f 72 20 79 6f 75 72 20 6f 77 6e 20 |es for your own | 00001880 6e 65 66 61 72 69 6f 75 73 20 70 75 72 70 6f 73 |nefarious purpos| 00001890 65 73 20 62 79 20 6d 61 6b 69 6e 67 20 75 73 65 |es by making use| 000018a0 20 6f 66 0d 74 68 65 20 76 65 63 74 6f 72 73 2e | of.the vectors.| 000018b0 0d 0d 41 6e 64 20 73 6f 20 74 6f 20 74 68 69 73 |..And so to this| 000018c0 20 6d 6f 64 75 6c 65 27 73 20 70 72 6f 67 72 61 | module's progra| 000018d0 6d 2e 20 20 49 74 20 69 73 2c 20 49 20 68 6f 70 |m. It is, I hop| 000018e0 65 2c 20 72 65 61 73 6f 6e 61 62 6c 79 0d 73 65 |e, reasonably.se| 000018f0 6c 66 20 64 6f 63 75 6d 65 6e 74 69 6e 67 20 61 |lf documenting a| 00001900 6e 64 20 75 73 65 73 20 4f 53 57 52 43 48 20 69 |nd uses OSWRCH i| 00001910 6e 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 77 61 |n a number of wa| 00001920 79 73 20 74 6f 0d 70 72 69 6e 74 20 6f 75 74 20 |ys to.print out | 00001930 61 20 73 74 72 69 6e 67 20 70 72 6f 70 6f 72 74 |a string proport| 00001940 69 6f 6e 61 6c 6c 79 20 73 70 61 63 65 64 2e 0d |ionally spaced..| 00001950 0d 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 62 |.The string to b| 00001960 65 20 70 72 69 6e 74 65 64 20 69 73 20 70 61 73 |e printed is pas| 00001970 73 65 64 20 74 6f 20 74 68 65 20 72 6f 75 74 69 |sed to the routi| 00001980 6e 65 20 66 72 6f 6d 20 42 41 53 49 43 0d 75 73 |ne from BASIC.us| 00001990 69 6e 67 20 43 41 4c 4c 20 77 69 74 68 20 70 61 |ing CALL with pa| 000019a0 72 61 6d 65 74 65 72 73 2e 20 20 49 27 76 65 20 |rameters. I've | 000019b0 75 73 65 64 20 74 68 69 73 20 6d 65 74 68 6f 64 |used this method| 000019c0 20 74 6f 20 6d 61 6b 65 0d 69 74 20 65 61 73 79 | to make.it easy| 000019d0 20 66 6f 72 20 79 6f 75 20 74 6f 20 65 78 70 65 | for you to expe| 000019e0 72 69 6d 65 6e 74 20 75 73 69 6e 67 20 74 68 65 |riment using the| 000019f0 20 72 6f 75 74 69 6e 65 20 69 6e 20 79 6f 75 72 | routine in your| 00001a00 20 6f 77 6e 0d 70 72 6f 67 72 61 6d 73 2e 20 20 | own.programs. | 00001a10 54 68 65 72 65 20 69 73 20 61 6e 20 69 6d 70 6f |There is an impo| 00001a20 72 74 61 6e 74 20 70 6f 69 6e 74 20 74 6f 20 62 |rtant point to b| 00001a30 65 20 6d 61 64 65 20 75 73 69 6e 67 20 43 41 4c |e made using CAL| 00001a40 4c 0d 66 6f 72 20 6d 61 63 68 69 6e 65 20 63 6f |L.for machine co| 00001a50 64 65 20 68 6f 77 65 76 65 72 2c 20 61 6e 64 20 |de however, and | 00001a60 74 68 61 74 20 69 73 20 74 68 65 20 75 73 65 20 |that is the use | 00001a70 6f 66 20 7a 65 72 6f 20 70 61 67 65 0d 66 6f 72 |of zero page.for| 00001a80 20 70 6f 73 74 2d 69 6e 64 65 78 65 64 20 69 6e | post-indexed in| 00001a90 64 69 72 65 63 74 20 61 64 64 72 65 73 73 69 6e |direct addressin| 00001aa0 67 2e 20 20 4e 6f 77 20 49 20 6b 6e 6f 77 20 74 |g. Now I know t| 00001ab0 68 61 74 27 73 20 61 0d 62 69 74 20 6f 66 20 61 |hat's a.bit of a| 00001ac0 20 6d 6f 75 74 68 66 75 6c 20 62 75 74 20 74 68 | mouthful but th| 00001ad0 69 73 20 69 73 20 77 68 61 74 20 69 74 20 6c 6f |is is what it lo| 00001ae0 6f 6b 73 20 6c 69 6b 65 2e 0d 0d 20 20 20 20 20 |oks like... | 00001af0 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 44 41 | LDA| 00001b00 20 28 7a 70 29 2c 20 59 0d 0d 49 6e 20 74 68 69 | (zp), Y..In thi| 00001b10 73 20 63 61 73 65 20 41 20 69 73 20 6c 6f 61 64 |s case A is load| 00001b20 65 64 20 77 69 74 68 20 74 68 65 20 76 61 6c 75 |ed with the valu| 00001b30 65 20 73 74 6f 72 65 64 20 59 20 62 79 74 65 73 |e stored Y bytes| 00001b40 20 61 62 6f 76 65 0d 74 68 65 20 61 64 64 72 65 | above.the addre| 00001b50 73 73 20 73 74 6f 72 65 64 20 69 6e 20 7a 70 20 |ss stored in zp | 00001b60 61 6e 64 20 7a 70 2b 31 2e 20 20 7a 70 20 69 73 |and zp+1. zp is| 00001b70 20 69 6e 20 7a 65 72 6f 20 70 61 67 65 20 61 6e | in zero page an| 00001b80 64 0d 79 6f 75 20 68 61 76 65 20 74 6f 20 75 73 |d.you have to us| 00001b90 65 20 74 68 65 20 59 20 72 65 67 69 73 74 65 72 |e the Y register| 00001ba0 20 66 6f 72 20 74 68 65 20 69 6e 64 65 78 2e 20 | for the index. | 00001bb0 20 49 66 20 79 6f 75 0d 72 65 6d 65 6d 62 65 72 | If you.remember| 00001bc0 20 74 68 61 74 20 69 6e 20 36 35 30 32 20 61 73 | that in 6502 as| 00001bd0 73 65 6d 62 6c 65 72 20 28 6d 65 6d 6f 72 79 29 |sembler (memory)| 00001be0 20 6d 65 61 6e 73 20 74 68 65 20 61 64 64 72 65 | means the addre| 00001bf0 73 73 0d 73 74 6f 72 65 64 20 69 6e 20 6c 6f 63 |ss.stored in loc| 00001c00 61 74 69 6f 6e 73 20 6d 65 6d 6f 72 79 20 61 6e |ations memory an| 00001c10 64 20 6d 65 6d 6f 72 79 2b 31 20 79 6f 75 20 73 |d memory+1 you s| 00001c20 68 6f 75 6c 64 20 6e 6f 74 20 67 6f 0d 66 61 72 |hould not go.far| 00001c30 20 77 72 6f 6e 67 2e 0d 0d 5b 54 68 65 72 65 20 | wrong...[There | 00001c40 69 73 20 61 6e 6f 74 68 65 72 2c 20 73 6f 6d 65 |is another, some| 00001c50 77 68 61 74 20 6d 6f 72 65 20 65 73 6f 74 65 72 |what more esoter| 00001c60 69 63 2c 20 61 64 64 72 65 73 73 69 6e 67 20 6d |ic, addressing m| 00001c70 6f 64 65 0d 63 61 6c 6c 65 64 20 70 72 65 2d 69 |ode.called pre-i| 00001c80 6e 64 65 78 65 64 20 69 6e 64 69 72 65 63 74 20 |ndexed indirect | 00001c90 61 64 64 72 65 73 73 69 6e 67 20 77 68 69 63 68 |addressing which| 00001ca0 20 75 73 65 73 20 58 20 61 73 20 61 6e 0d 69 6e | uses X as an.in| 00001cb0 64 65 78 20 61 6e 64 20 69 73 20 77 72 69 74 74 |dex and is writt| 00001cc0 65 6e 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |en.. | 00001cd0 20 20 20 20 20 4c 44 41 20 28 7a 70 2c 20 58 29 | LDA (zp, X)| 00001ce0 0d 0d 49 6e 20 74 68 69 73 20 63 61 73 65 20 41 |..In this case A| 00001cf0 20 69 73 20 6c 6f 61 64 65 64 20 77 69 74 68 20 | is loaded with | 00001d00 74 68 65 20 76 61 6c 75 65 20 73 74 6f 72 65 64 |the value stored| 00001d10 20 61 74 20 74 68 65 0d 61 64 64 72 65 73 73 20 | at the.address | 00001d20 73 74 6f 72 65 64 20 69 6e 20 7a 70 2b 58 20 61 |stored in zp+X a| 00001d30 6e 64 20 7a 70 2b 58 2b 31 2e 5d 0d 0d 50 6f 73 |nd zp+X+1.]..Pos| 00001d40 74 20 28 61 6e 64 20 70 72 65 29 20 69 6e 64 65 |t (and pre) inde| 00001d50 78 65 64 20 61 64 64 72 65 73 73 69 6e 67 20 69 |xed addressing i| 00001d60 73 20 61 6c 73 6f 20 75 73 65 64 20 77 69 74 68 |s also used with| 00001d70 0d 6d 6e 65 6d 6f 6e 69 63 73 20 6f 74 68 65 72 |.mnemonics other| 00001d80 20 74 68 61 6e 20 4c 44 41 2e 20 20 49 66 20 79 | than LDA. If y| 00001d90 6f 75 20 64 65 73 69 67 6e 20 61 6e 64 20 77 72 |ou design and wr| 00001da0 69 74 65 20 61 0d 73 69 64 65 77 61 79 73 20 52 |ite a.sideways R| 00001db0 4f 4d 20 77 68 69 63 68 20 6e 65 65 64 73 20 73 |OM which needs s| 00001dc0 6f 6d 65 20 70 72 69 76 61 74 65 20 77 6f 72 6b |ome private work| 00001dd0 73 70 61 63 65 2c 20 74 68 69 73 20 69 73 20 74 |space, this is t| 00001de0 68 65 0d 73 6f 72 74 20 6f 66 20 52 4f 4d 20 74 |he.sort of ROM t| 00001df0 68 61 74 20 72 61 69 73 65 73 20 74 68 65 20 76 |hat raises the v| 00001e00 61 6c 75 65 20 6f 66 20 50 41 47 45 2c 20 74 68 |alue of PAGE, th| 00001e10 65 6e 20 74 68 65 20 4f 53 20 77 69 6c 6c 0d 61 |en the OS will.a| 00001e20 6c 6c 6f 63 61 74 65 20 74 68 61 74 20 77 6f 72 |llocate that wor| 00001e30 6b 73 70 61 63 65 20 66 6f 72 20 79 6f 75 2e 20 |kspace for you. | 00001e40 20 54 6f 20 61 63 74 75 61 6c 6c 79 20 75 73 65 | To actually use| 00001e50 20 74 68 69 73 0d 6d 65 6d 6f 72 79 20 69 73 20 | this.memory is | 00001e60 6e 6f 74 20 73 74 72 61 69 67 68 74 66 6f 72 77 |not straightforw| 00001e70 61 72 64 20 62 65 63 61 75 73 65 20 79 6f 75 20 |ard because you | 00001e80 68 61 76 65 20 74 6f 20 66 69 6e 64 20 6f 75 74 |have to find out| 00001e90 0d 77 68 65 72 65 20 69 74 20 69 73 20 66 72 6f |.where it is fro| 00001ea0 6d 20 74 68 65 20 4f 53 20 77 68 65 6e 20 74 68 |m the OS when th| 00001eb0 65 20 52 4f 4d 20 69 73 20 69 6e 69 74 69 61 6c |e ROM is initial| 00001ec0 69 73 65 64 2e 20 20 53 6f 20 79 6f 75 0d 70 75 |ised. So you.pu| 00001ed0 74 20 74 68 65 20 77 6f 72 6b 73 70 61 63 65 20 |t the workspace | 00001ee0 61 64 64 72 65 73 73 20 69 6e 74 6f 20 61 20 63 |address into a c| 00001ef0 6f 75 70 6c 65 20 6f 66 20 61 64 64 72 65 73 73 |ouple of address| 00001f00 65 73 20 69 6e 20 7a 65 72 6f 0d 70 61 67 65 20 |es in zero.page | 00001f10 79 6f 75 20 75 73 65 20 70 6f 73 74 2d 69 6e 64 |you use post-ind| 00001f20 65 78 65 64 20 69 6e 64 69 72 65 63 74 20 61 64 |exed indirect ad| 00001f30 64 72 65 73 73 69 6e 67 20 74 6f 20 61 63 63 65 |dressing to acce| 00001f40 73 73 20 69 74 2e 0d 0d 57 68 65 6e 20 79 6f 75 |ss it...When you| 00001f50 20 75 73 65 20 43 41 4c 4c 20 66 72 6f 6d 20 42 | use CALL from B| 00001f60 41 53 49 43 20 77 69 74 68 20 61 20 73 65 74 20 |ASIC with a set | 00001f70 6f 66 20 70 61 72 61 6d 65 74 65 72 73 0d 61 74 |of parameters.at| 00001f80 74 61 63 68 65 64 20 42 41 53 49 43 20 61 6c 6c |tached BASIC all| 00001f90 6f 63 61 74 65 73 20 61 20 62 6c 6f 63 6b 20 6f |ocates a block o| 00001fa0 66 20 6d 65 6d 6f 72 79 20 73 74 61 72 74 69 6e |f memory startin| 00001fb0 67 20 61 74 20 26 36 30 30 0d 77 68 65 72 65 20 |g at &600.where | 00001fc0 74 68 65 73 65 20 70 61 72 61 6d 65 74 65 72 73 |these parameters| 00001fd0 20 61 72 65 20 73 74 6f 72 65 64 2e 20 20 49 66 | are stored. If| 00001fe0 2c 20 68 6f 77 65 76 65 72 2c 20 6f 6e 65 20 6f |, however, one o| 00001ff0 66 0d 74 68 65 73 65 20 70 61 72 61 6d 65 74 65 |f.these paramete| 00002000 72 73 20 69 73 20 61 20 73 74 72 69 6e 67 20 74 |rs is a string t| 00002010 68 65 6e 20 74 68 65 20 26 36 30 30 20 62 6c 6f |hen the &600 blo| 00002020 63 6b 20 6f 6e 6c 79 0d 63 6f 6e 74 61 69 6e 73 |ck only.contains| 00002030 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 | a pointer to th| 00002040 65 20 73 74 61 72 74 20 6f 66 20 61 20 73 74 72 |e start of a str| 00002050 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 0d |ing information.| 00002060 62 6c 6f 63 6b 2e 20 20 49 66 20 79 6f 75 20 74 |block. If you t| 00002070 72 61 6e 73 66 65 72 20 74 68 69 73 20 70 6f 69 |ransfer this poi| 00002080 6e 74 65 72 20 69 6e 74 6f 20 7a 65 72 6f 20 70 |nter into zero p| 00002090 61 67 65 20 79 6f 75 20 63 61 6e 0d 74 68 65 6e |age you can.then| 000020a0 20 75 73 65 20 70 6f 73 74 2d 69 6e 64 65 78 65 | use post-indexe| 000020b0 64 20 69 6e 64 69 72 65 63 74 20 61 64 64 72 65 |d indirect addre| 000020c0 73 73 69 6e 67 20 74 6f 20 6c 6f 6f 6b 20 74 68 |ssing to look th| 000020d0 72 6f 75 67 68 0d 74 68 65 20 62 6c 6f 63 6b 2c |rough.the block,| 000020e0 20 77 68 69 63 68 20 69 73 20 77 68 61 74 20 42 | which is what B| 000020f0 2f 6f 73 62 30 37 20 64 6f 65 73 2e 0d 0d 4c 65 |/osb07 does...Le| 00002100 74 27 73 20 73 74 61 72 74 20 61 74 20 74 68 65 |t's start at the| 00002110 20 62 65 67 69 6e 6e 69 6e 67 2e 20 20 42 2f 6f | beginning. B/o| 00002120 73 62 30 37 20 6f 6e 6c 79 20 73 65 74 73 20 75 |sb07 only sets u| 00002130 70 20 74 68 65 0d 72 6f 75 74 69 6e 65 20 77 68 |p the.routine wh| 00002140 69 63 68 20 77 69 6c 6c 20 70 72 69 6e 74 20 6f |ich will print o| 00002150 75 74 20 61 20 73 74 72 69 6e 67 20 70 72 6f 70 |ut a string prop| 00002160 6f 72 74 69 6f 6e 61 6c 6c 79 20 73 70 61 63 65 |ortionally space| 00002170 64 2e 20 0d 54 6f 20 75 73 65 20 69 74 20 79 6f |d. .To use it yo| 00002180 75 20 6d 75 73 74 20 62 65 20 69 6e 20 4d 6f 64 |u must be in Mod| 00002190 65 20 31 20 6f 72 20 4d 6f 64 65 20 34 20 61 6e |e 1 or Mode 4 an| 000021a0 64 20 64 65 66 69 6e 65 20 61 0d 73 74 72 69 6e |d define a.strin| 000021b0 67 20 76 61 72 69 61 62 6c 65 20 74 6f 20 62 65 |g variable to be| 000021c0 20 79 6f 75 72 20 72 65 71 75 69 72 65 64 20 73 | your required s| 000021d0 74 72 69 6e 67 2c 20 6c 65 74 27 73 20 63 61 6c |tring, let's cal| 000021e0 6c 20 69 74 0d 4d 24 2e 20 54 68 65 20 67 72 61 |l it.M$. The gra| 000021f0 70 68 69 63 73 20 63 75 72 73 6f 72 20 6d 75 73 |phics cursor mus| 00002200 74 20 62 65 20 70 6f 73 69 74 69 6f 6e 65 64 20 |t be positioned | 00002210 77 68 65 72 65 20 79 6f 75 20 77 61 6e 74 0d 74 |where you want.t| 00002220 68 65 20 70 72 69 6e 74 69 6e 67 20 74 6f 20 73 |he printing to s| 00002230 74 61 72 74 20 62 79 20 75 73 69 6e 67 20 4d 4f |tart by using MO| 00002240 56 45 2e 0d 0d 54 68 65 6e 2c 20 73 69 6e 63 65 |VE...Then, since| 00002250 20 63 6f 64 65 25 20 69 73 20 74 68 65 20 61 64 | code% is the ad| 00002260 64 72 65 73 73 20 6f 66 20 74 68 65 20 72 6f 75 |dress of the rou| 00002270 74 69 6e 65 2c 20 79 6f 75 0d 0d 20 20 20 20 20 |tine, you.. | 00002280 20 20 20 20 20 20 20 20 20 20 20 43 41 4c 4c 20 | CALL | 00002290 63 6f 64 65 25 2c 20 4d 24 0d 0d 57 68 65 6e 20 |code%, M$..When | 000022a0 79 6f 75 20 68 61 76 65 20 72 75 6e 20 74 68 65 |you have run the| 000022b0 20 61 73 73 65 6d 62 6c 65 72 20 70 72 65 73 73 | assembler press| 000022c0 20 66 32 20 61 6e 64 20 61 20 6c 69 74 74 6c 65 | f2 and a little| 000022d0 0d 73 65 6e 74 65 6e 63 65 20 77 69 6c 6c 20 62 |.sentence will b| 000022e0 65 20 70 72 69 6e 74 65 64 20 69 6e 20 4d 6f 64 |e printed in Mod| 000022f0 65 20 34 2e 20 20 57 69 74 68 6f 75 74 20 73 68 |e 4. Without sh| 00002300 61 64 6f 77 20 6d 65 6d 6f 72 79 0d 6f 72 20 61 |adow memory.or a| 00002310 20 73 65 63 6f 6e 64 20 70 72 6f 63 65 73 73 6f | second processo| 00002320 72 20 79 6f 75 20 77 69 6c 6c 20 6e 6f 74 20 62 |r you will not b| 00002330 65 20 61 62 6c 65 20 74 6f 20 67 65 74 20 69 6e |e able to get in| 00002340 74 6f 20 4d 6f 64 65 0d 31 20 77 69 74 68 20 74 |to Mode.1 with t| 00002350 68 65 20 61 73 73 65 6d 62 6c 65 72 20 73 6f 75 |he assembler sou| 00002360 72 63 65 20 69 6e 20 6d 65 6d 6f 72 79 2e 0d 0d |rce in memory...| 00002370 54 68 65 20 76 61 72 69 61 62 6c 65 20 62 6c 6f |The variable blo| 00002380 63 6b 25 20 69 73 20 64 65 66 69 6e 65 64 20 61 |ck% is defined a| 00002390 73 20 62 65 69 6e 67 20 26 36 30 30 2c 20 77 68 |s being &600, wh| 000023a0 69 63 68 20 69 73 20 77 68 65 72 65 0d 74 68 65 |ich is where.the| 000023b0 20 43 41 4c 4c 20 70 61 72 61 6d 65 74 65 72 20 | CALL parameter | 000023c0 62 6c 6f 63 6b 20 6c 69 76 65 73 2e 20 20 41 74 |block lives. At| 000023d0 20 62 6c 6f 63 6b 25 20 69 74 73 65 6c 66 20 69 | block% itself i| 000023e0 73 20 73 74 6f 72 65 64 0d 74 68 65 20 6e 75 6d |s stored.the num| 000023f0 62 65 72 20 6f 66 20 70 61 72 61 6d 65 74 65 72 |ber of parameter| 00002400 73 3b 20 77 65 20 77 61 6e 74 20 61 20 73 69 6e |s; we want a sin| 00002410 67 6c 65 20 6f 6e 65 20 61 6e 64 20 69 66 20 74 |gle one and if t| 00002420 68 65 72 65 0d 61 72 65 20 6d 6f 72 65 20 77 65 |here.are more we| 00002430 20 65 78 69 74 20 62 65 63 61 75 73 65 20 74 68 | exit because th| 00002440 65 72 65 20 68 61 73 20 62 65 65 6e 20 61 20 6d |ere has been a m| 00002450 69 73 74 61 6b 65 2e 20 20 49 20 63 6f 75 6c 64 |istake. I could| 00002460 0d 68 61 76 65 20 6d 61 64 65 20 74 68 65 20 72 |.have made the r| 00002470 6f 75 74 69 6e 65 20 70 72 69 6e 74 20 6f 75 74 |outine print out| 00002480 20 61 20 6d 65 73 73 61 67 65 20 73 61 79 69 6e | a message sayin| 00002490 67 20 22 54 6f 6f 20 4d 61 6e 79 0d 50 61 72 61 |g "Too Many.Para| 000024a0 6d 65 74 65 72 73 20 66 6f 72 20 50 72 6f 70 6f |meters for Propo| 000024b0 72 74 69 6f 6e 61 6c 20 53 70 61 63 69 6e 67 22 |rtional Spacing"| 000024c0 20 6f 72 20 65 76 65 6e 20 67 65 6e 65 72 61 74 | or even generat| 000024d0 65 64 20 61 6e 0d 65 72 72 6f 72 2c 20 62 75 74 |ed an.error, but| 000024e0 20 66 6f 72 20 74 68 65 20 6d 6f 6d 65 6e 74 20 | for the moment | 000024f0 49 27 6c 6c 20 6a 75 73 74 20 65 78 69 74 2e 20 |I'll just exit. | 00002500 20 45 72 72 6f 72 20 74 72 61 70 70 69 6e 67 0d | Error trapping.| 00002510 77 69 6c 6c 20 61 70 70 65 61 72 20 69 6e 20 61 |will appear in a| 00002520 20 6c 61 74 65 72 20 6d 6f 64 75 6c 65 2e 0d 0d | later module...| 00002530 41 74 20 62 6c 6f 63 6b 25 2b 33 20 69 73 20 61 |At block%+3 is a| 00002540 20 62 79 74 65 20 77 68 69 63 68 20 74 65 6c 6c | byte which tell| 00002550 73 20 75 73 20 77 68 61 74 20 6b 69 6e 64 20 6f |s us what kind o| 00002560 66 20 70 61 72 61 6d 65 74 65 72 0d 77 65 20 68 |f parameter.we h| 00002570 61 76 65 2e 20 20 49 66 20 69 74 20 69 73 20 31 |ave. If it is 1| 00002580 32 39 20 74 68 65 6e 20 77 65 20 68 61 76 65 20 |29 then we have | 00002590 61 20 73 74 72 69 6e 67 2e 20 20 28 46 75 6c 6c |a string. (Full| 000025a0 20 64 65 74 61 69 6c 73 0d 6f 66 20 43 41 4c 4c | details.of CALL| 000025b0 20 77 69 74 68 20 70 61 72 61 6d 65 74 65 72 73 | with parameters| 000025c0 20 69 73 20 69 6e 20 74 68 65 20 55 73 65 72 20 | is in the User | 000025d0 47 75 69 64 65 2e 29 0d 0d 4f 6e 63 65 20 73 61 |Guide.)..Once sa| 000025e0 74 69 73 66 69 65 64 20 74 68 61 74 20 77 65 20 |tisfied that we | 000025f0 68 61 76 65 20 61 20 73 69 6e 67 6c 65 20 73 74 |have a single st| 00002600 72 69 6e 67 20 70 61 72 61 6d 65 74 65 72 0d 61 |ring parameter.a| 00002610 76 61 69 6c 61 62 6c 65 20 74 68 65 20 70 72 6f |vailable the pro| 00002620 67 72 61 6d 20 74 61 6b 65 73 20 74 68 65 20 61 |gram takes the a| 00002630 64 64 72 65 73 73 20 73 74 6f 72 65 64 20 61 74 |ddress stored at| 00002640 20 62 6c 6f 63 6b 25 2b 31 0d 61 6e 64 20 62 6c | block%+1.and bl| 00002650 6f 63 6b 25 2b 32 20 61 6e 64 20 63 6f 70 69 65 |ock%+2 and copie| 00002660 73 20 69 74 20 74 6f 20 61 20 70 61 69 72 20 6f |s it to a pair o| 00002670 66 20 7a 65 72 6f 20 70 61 67 65 20 61 64 64 72 |f zero page addr| 00002680 65 73 73 65 73 2e 20 0d 49 20 63 68 6f 73 65 20 |esses. .I chose | 00002690 26 38 41 20 61 6e 64 20 26 38 42 20 66 6f 72 20 |&8A and &8B for | 000026a0 74 68 69 73 20 61 6e 64 20 7a 65 72 6f 5f 70 61 |this and zero_pa| 000026b0 67 65 25 20 69 73 20 64 65 66 69 6e 65 64 20 61 |ge% is defined a| 000026c0 73 0d 26 38 41 20 65 61 72 6c 79 20 69 6e 20 74 |s.&8A early in t| 000026d0 68 65 20 63 6f 64 65 2e 0d 0d 49 6e 69 74 69 61 |he code...Initia| 000026e0 6c 6c 79 20 74 68 65 73 65 20 77 69 6c 6c 20 63 |lly these will c| 000026f0 6f 6e 74 61 69 6e 20 74 68 65 20 61 64 64 72 65 |ontain the addre| 00002700 73 73 20 6f 66 20 61 20 73 74 72 69 6e 67 0d 69 |ss of a string.i| 00002710 6e 66 6f 72 6d 61 74 69 6f 6e 20 62 6c 6f 63 6b |nformation block| 00002720 2e 20 20 54 68 65 20 66 69 72 73 74 20 74 77 6f |. The first two| 00002730 20 62 79 74 65 73 20 6f 66 20 74 68 69 73 20 62 | bytes of this b| 00002740 6c 6f 63 6b 20 68 6f 6c 64 0d 74 68 65 20 61 64 |lock hold.the ad| 00002750 64 72 65 73 73 20 6f 66 20 74 68 65 20 73 74 72 |dress of the str| 00002760 69 6e 67 20 69 74 73 65 6c 66 20 61 6e 64 20 74 |ing itself and t| 00002770 68 65 20 74 68 69 72 64 20 68 6f 6c 64 73 20 69 |he third holds i| 00002780 74 73 0d 6c 65 6e 67 74 68 2e 20 20 49 66 20 79 |ts.length. If y| 00002790 6f 75 20 63 61 6e 20 66 69 67 75 72 65 20 6f 75 |ou can figure ou| 000027a0 74 20 74 68 69 73 20 69 6e 63 72 65 64 69 62 6c |t this incredibl| 000027b0 79 20 63 6f 6e 76 6f 6c 75 74 65 64 0d 72 6f 75 |y convoluted.rou| 000027c0 74 69 6e 65 20 74 68 65 6e 20 79 6f 75 27 72 65 |tine then you're| 000027d0 20 6e 6f 74 20 64 6f 69 6e 67 20 62 61 64 6c 79 | not doing badly| 000027e0 2e 0d 0d 54 68 65 20 73 74 72 69 6e 67 20 6c 65 |...The string le| 000027f0 6e 67 74 68 20 69 73 20 73 74 6f 72 65 64 20 61 |ngth is stored a| 00002800 77 61 79 20 61 6e 64 20 74 68 65 6e 20 74 68 65 |way and then the| 00002810 20 73 74 61 72 74 20 61 64 64 72 65 73 73 0d 69 | start address.i| 00002820 73 20 6d 6f 76 65 64 20 69 6e 74 6f 20 6f 75 72 |s moved into our| 00002830 20 74 77 6f 20 7a 65 72 6f 20 70 61 67 65 20 61 | two zero page a| 00002840 64 64 72 65 73 73 65 73 20 77 69 74 68 20 74 68 |ddresses with th| 00002850 65 20 68 65 6c 70 20 6f 66 20 61 0d 6c 69 74 74 |e help of a.litt| 00002860 6c 65 20 62 6f 75 6e 63 69 6e 67 20 74 6f 20 61 |le bouncing to a| 00002870 6e 64 20 66 72 6f 6d 20 74 68 65 20 73 74 61 63 |nd from the stac| 00002880 6b 2e 0d 0d 54 68 65 20 6e 65 78 74 20 73 65 63 |k...The next sec| 00002890 74 69 6f 6e 20 73 74 6f 72 65 73 20 74 68 65 20 |tion stores the | 000028a0 67 72 61 70 68 69 63 73 20 63 75 72 73 6f 72 20 |graphics cursor | 000028b0 70 6f 73 69 74 69 6f 6e 2c 20 75 73 69 6e 67 0d |position, using.| 000028c0 4f 53 57 4f 52 44 20 26 44 2c 20 69 6e 20 61 20 |OSWORD &D, in a | 000028d0 62 6c 6f 63 6b 20 61 74 20 6f 73 5f 62 6c 6f 63 |block at os_bloc| 000028e0 6b 25 2e 20 20 54 68 65 20 58 20 63 6f 2d 6f 72 |k%. The X co-or| 000028f0 64 69 6e 61 74 65 73 20 77 69 6c 6c 0d 62 65 20 |dinates will.be | 00002900 68 65 6c 64 20 66 72 6f 6d 20 34 20 62 79 74 65 |held from 4 byte| 00002910 73 20 61 62 6f 76 65 20 6f 73 5f 62 6c 6f 63 6b |s above os_block| 00002920 25 20 69 74 73 65 6c 66 20 61 6e 64 20 49 20 68 |% itself and I h| 00002930 61 76 65 0d 61 72 72 61 6e 67 65 64 20 66 6f 72 |ave.arranged for| 00002940 20 74 68 69 73 20 74 6f 20 62 65 20 61 64 64 72 | this to be addr| 00002950 65 73 73 20 67 70 6f 73 2e 20 20 53 65 65 20 6c |ess gpos. See l| 00002960 69 6e 65 73 20 31 39 33 30 20 61 6e 64 0d 31 39 |ines 1930 and.19| 00002970 34 30 2e 20 20 54 68 65 20 72 65 61 73 6f 6e 20 |40. The reason | 00002980 66 6f 72 20 73 74 6f 72 69 6e 67 20 74 68 65 20 |for storing the | 00002990 6f 6c 64 20 58 20 70 6f 73 69 74 69 6f 6e 20 69 |old X position i| 000029a0 73 20 73 6f 20 74 68 61 74 0d 69 66 20 61 20 63 |s so that.if a c| 000029b0 61 72 72 69 61 67 65 20 72 65 74 75 72 6e 20 69 |arriage return i| 000029c0 73 20 69 6e 63 6c 75 64 65 64 20 69 6e 20 74 68 |s included in th| 000029d0 65 20 73 74 72 69 6e 67 20 61 20 6e 65 77 20 6c |e string a new l| 000029e0 69 6e 65 0d 77 69 6c 6c 20 73 74 61 72 74 20 64 |ine.will start d| 000029f0 69 72 65 63 74 6c 79 20 75 6e 64 65 72 20 74 68 |irectly under th| 00002a00 65 20 73 74 61 72 74 20 6f 66 20 74 68 65 20 6c |e start of the l| 00002a10 61 73 74 20 6f 6e 65 2e 0d 0d 4e 65 78 74 20 74 |ast one...Next t| 00002a20 68 65 20 72 6f 75 74 69 6e 65 20 66 69 6c 74 65 |he routine filte| 00002a30 72 73 20 6f 75 74 20 61 6e 79 20 63 68 61 72 61 |rs out any chara| 00002a40 63 74 65 72 73 20 62 65 6c 6f 77 20 33 32 20 61 |cters below 32 a| 00002a50 6e 64 0d 61 62 6f 76 65 20 31 32 37 20 73 69 6e |nd.above 127 sin| 00002a60 63 65 20 74 68 65 79 20 61 72 65 20 6e 6f 74 20 |ce they are not | 00002a70 70 72 69 6e 74 61 62 6c 65 20 28 65 78 63 65 70 |printable (excep| 00002a80 74 69 6e 67 20 61 20 63 61 72 72 69 61 67 65 0d |ting a carriage.| 00002a90 72 65 74 75 72 6e 29 2e 20 20 4f 6e 20 61 20 6e |return). On a n| 00002aa0 65 77 20 6c 69 6e 65 20 74 68 65 20 67 72 61 70 |ew line the grap| 00002ab0 68 69 63 73 20 63 75 72 73 6f 72 20 69 73 20 6d |hics cursor is m| 00002ac0 6f 76 65 64 20 64 6f 77 6e 20 62 79 0d 38 20 67 |oved down by.8 g| 00002ad0 72 61 70 68 69 63 73 20 75 6e 69 74 73 20 28 69 |raphics units (i| 00002ae0 2e 65 2e 20 74 68 65 20 6e 75 6d 62 65 72 73 20 |.e. the numbers | 00002af0 75 73 65 64 20 62 79 20 61 20 4d 4f 56 45 20 6f |used by a MOVE o| 00002b00 72 20 50 4c 4f 54 29 0d 74 6f 20 73 70 61 63 65 |r PLOT).to space| 00002b10 20 74 68 65 20 6c 69 6e 65 73 20 6f 75 74 20 61 | the lines out a| 00002b20 20 6c 69 74 74 6c 65 20 6d 6f 72 65 20 28 6c 69 | little more (li| 00002b30 6b 65 20 4d 6f 64 65 20 36 20 77 6f 75 6c 64 0d |ke Mode 6 would.| 00002b40 72 61 74 68 65 72 20 74 68 61 6e 20 4d 6f 64 65 |rather than Mode| 00002b50 20 34 29 20 61 6e 64 20 79 6f 75 20 77 69 6c 6c | 4) and you will| 00002b60 20 73 65 65 20 69 6e 20 6c 69 6e 65 73 20 38 34 | see in lines 84| 00002b70 30 20 74 6f 20 39 35 30 0d 74 68 61 74 20 74 68 |0 to 950.that th| 00002b80 65 20 61 73 73 65 6d 62 6c 65 72 20 65 71 75 69 |e assembler equi| 00002b90 76 61 6c 65 6e 74 20 6f 66 20 61 20 72 65 6c 61 |valent of a rela| 00002ba0 74 69 76 65 20 4d 4f 56 45 20 68 61 73 20 62 65 |tive MOVE has be| 00002bb0 65 6e 0d 63 61 72 72 69 65 64 20 6f 75 74 20 75 |en.carried out u| 00002bc0 73 69 6e 67 20 4f 53 57 52 43 48 2e 0d 0d 54 68 |sing OSWRCH...Th| 00002bd0 65 20 70 72 6f 70 6f 72 74 69 6f 6e 61 6c 20 73 |e proportional s| 00002be0 70 61 63 69 6e 67 20 77 6f 72 6b 73 20 62 79 20 |pacing works by | 00002bf0 6c 6f 6f 6b 69 6e 67 20 75 70 20 69 6e 20 61 20 |looking up in a | 00002c00 74 61 62 6c 65 20 68 6f 77 0d 6d 61 6e 79 20 27 |table how.many '| 00002c10 73 70 61 72 65 27 20 70 69 78 65 6c 73 20 74 68 |spare' pixels th| 00002c20 65 72 65 20 61 72 65 20 69 6e 20 66 72 6f 6e 74 |ere are in front| 00002c30 20 61 6e 64 20 62 65 68 69 6e 64 20 61 0d 63 68 | and behind a.ch| 00002c40 61 72 61 63 74 65 72 2e 20 20 54 68 65 72 65 20 |aracter. There | 00002c50 77 69 6c 6c 20 62 65 20 73 70 61 72 65 20 70 69 |will be spare pi| 00002c60 78 65 6c 73 20 62 65 63 61 75 73 65 20 74 68 65 |xels because the| 00002c70 20 4f 53 0d 64 65 66 69 6e 65 73 20 61 6c 6c 20 | OS.defines all | 00002c80 63 68 61 72 61 63 74 65 72 73 20 69 6e 20 61 6e |characters in an| 00002c90 20 38 78 38 20 62 6c 6f 63 6b 2e 20 20 57 65 20 | 8x8 block. We | 00002ca0 63 61 6e 20 69 67 6e 6f 72 65 20 74 68 65 20 38 |can ignore the 8| 00002cb0 0d 70 69 78 65 6c 73 20 75 70 77 61 72 64 73 2e |.pixels upwards.| 00002cc0 20 20 48 65 72 65 20 61 72 65 20 74 77 6f 20 63 | Here are two c| 00002cd0 68 61 72 61 63 74 65 72 73 20 6f 66 20 64 69 66 |haracters of dif| 00002ce0 66 65 72 65 6e 74 0d 77 69 64 74 68 73 3a 0d 0d |ferent.widths:..| 00002cf0 0d 20 20 20 20 2a 2a 20 20 20 2a 2a 20 20 20 20 |. ** ** | 00002d00 20 20 20 20 20 20 20 20 2a 2a 2a 20 20 20 20 20 | *** | 00002d10 20 20 20 20 20 20 20 54 68 65 20 57 20 69 73 20 | The W is | 00002d20 37 20 70 69 78 65 6c 73 0d 20 20 20 20 2a 2a 20 |7 pixels. ** | 00002d30 2a 20 2a 2a 20 20 20 20 20 20 20 20 20 20 20 20 |* ** | 00002d40 20 2a 2a 20 20 20 20 20 20 20 20 20 20 20 20 77 | ** w| 00002d50 69 64 65 20 61 6e 64 20 74 68 65 20 6c 20 69 73 |ide and the l is| 00002d60 0d 20 20 20 20 2a 2a 20 2a 20 2a 2a 20 20 20 20 |. ** * ** | 00002d70 20 20 20 20 20 20 20 20 20 2a 2a 20 20 20 20 20 | ** | 00002d80 20 20 20 20 20 20 20 6f 6e 6c 79 20 34 20 77 69 | only 4 wi| 00002d90 64 65 2e 20 20 42 6f 74 68 0d 20 20 20 20 2a 2a |de. Both. **| 00002da0 2a 2a 2a 2a 2a 20 20 20 20 20 20 20 20 20 20 20 |***** | 00002db0 20 20 2a 2a 20 20 20 20 20 20 20 20 20 20 20 20 | ** | 00002dc0 61 72 65 20 6f 6e 6c 79 20 37 20 64 65 65 70 20 |are only 7 deep | 00002dd0 61 73 0d 20 20 20 20 2a 2a 2a 20 2a 2a 2a 20 20 |as. *** *** | 00002de0 20 20 20 20 20 20 20 20 20 20 20 2a 2a 20 20 20 | ** | 00002df0 20 20 20 20 20 20 20 20 20 6e 65 69 74 68 65 72 | neither| 00002e00 20 68 61 73 20 61 0d 20 20 20 20 2a 2a 20 20 20 | has a. ** | 00002e10 2a 2a 20 20 20 20 20 20 20 20 20 20 20 20 2a 2a |** **| 00002e20 2a 2a 20 20 20 20 20 20 20 20 20 20 20 64 65 73 |** des| 00002e30 63 65 6e 64 65 72 2e 0d 0d 53 6f 20 79 6f 75 20 |cender...So you | 00002e40 63 61 6e 20 73 65 65 20 74 68 61 74 20 73 6f 6d |can see that som| 00002e50 65 20 63 68 61 72 61 63 74 65 72 73 20 6f 63 63 |e characters occ| 00002e60 75 70 79 20 6c 65 73 73 20 6f 66 20 74 68 65 20 |upy less of the | 00002e70 38 0d 70 69 78 65 6c 73 20 61 63 72 6f 73 73 20 |8.pixels across | 00002e80 74 68 61 6e 20 6f 74 68 65 72 73 2e 0d 0d 54 68 |than others...Th| 00002e90 65 20 69 64 65 61 20 69 73 20 66 6f 72 20 74 68 |e idea is for th| 00002ea0 65 72 65 20 74 6f 20 62 65 20 61 20 73 69 6e 67 |ere to be a sing| 00002eb0 6c 65 20 70 69 78 65 6c 20 62 65 74 77 65 65 6e |le pixel between| 00002ec0 20 61 64 6a 61 63 65 6e 74 0d 63 68 61 72 61 63 | adjacent.charac| 00002ed0 74 65 72 73 20 61 6e 64 20 74 68 69 73 20 69 73 |ters and this is| 00002ee0 20 61 73 73 75 6d 65 64 20 74 6f 20 62 65 20 74 | assumed to be t| 00002ef0 68 65 20 66 69 72 73 74 20 6f 66 20 74 68 65 20 |he first of the | 00002f00 38 0d 70 69 78 65 6c 73 20 61 63 72 6f 73 73 20 |8.pixels across | 00002f10 74 68 65 20 63 68 61 72 61 63 74 65 72 20 74 6f |the character to| 00002f20 20 74 68 65 20 72 69 67 68 74 2e 20 20 54 68 69 | the right. Thi| 00002f30 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 0d 63 6f |s information.co| 00002f40 75 6c 64 20 62 65 20 63 61 6c 63 75 6c 61 74 65 |uld be calculate| 00002f50 64 20 62 79 20 75 73 69 6e 67 20 4f 53 57 4f 52 |d by using OSWOR| 00002f60 44 20 26 41 20 74 6f 20 72 65 61 64 20 74 68 65 |D &A to read the| 00002f70 20 4f 53 0d 64 65 66 69 6e 69 74 69 6f 6e 73 20 | OS.definitions | 00002f80 62 75 74 20 61 20 74 61 62 6c 65 20 69 73 20 66 |but a table is f| 00002f90 61 73 74 65 72 20 74 6f 20 75 73 65 20 69 66 20 |aster to use if | 00002fa0 73 6c 6f 77 65 72 20 74 6f 20 77 6f 72 6b 0d 6f |slower to work.o| 00002fb0 75 74 20 69 6e 20 74 68 65 20 66 69 72 73 74 20 |ut in the first | 00002fc0 70 6c 61 63 65 2e 20 20 59 6f 75 20 63 61 6e 20 |place. You can | 00002fd0 73 65 65 20 74 68 65 20 74 61 62 6c 65 20 66 72 |see the table fr| 00002fe0 6f 6d 20 6c 69 6e 65 0d 31 36 36 30 2e 0d 0d 53 |om line.1660...S| 00002ff0 6f 20 74 68 65 20 72 6f 75 74 69 6e 65 20 6d 6f |o the routine mo| 00003000 76 65 73 20 74 68 65 20 6e 65 78 74 20 63 68 61 |ves the next cha| 00003010 72 61 63 74 65 72 20 61 63 72 6f 73 73 20 74 6f |racter across to| 00003020 20 74 68 65 20 6c 65 66 74 0d 62 65 66 6f 72 65 | the left.before| 00003030 20 70 72 69 6e 74 69 6e 67 20 69 74 20 73 75 63 | printing it suc| 00003040 68 20 74 68 61 74 20 6f 6e 6c 79 20 6f 6e 65 20 |h that only one | 00003050 70 69 78 65 6c 20 77 69 6c 6c 20 73 65 70 61 72 |pixel will separ| 00003060 61 74 65 20 69 74 0d 66 72 6f 6d 20 74 68 65 20 |ate it.from the | 00003070 70 72 65 76 69 6f 75 73 20 6f 6e 65 2e 20 20 49 |previous one. I| 00003080 6e 20 4d 4f 44 45 20 31 20 61 6e 64 20 4d 4f 44 |n MODE 1 and MOD| 00003090 45 20 34 20 6f 6e 65 20 70 69 78 65 6c 20 69 73 |E 4 one pixel is| 000030a0 0d 66 6f 75 72 20 67 72 61 70 68 69 63 73 20 75 |.four graphics u| 000030b0 6e 69 74 73 20 77 69 64 65 2c 20 68 65 6e 63 65 |nits wide, hence| 000030c0 20 74 68 65 20 34 20 69 6e 20 6c 69 6e 65 20 31 | the 4 in line 1| 000030d0 35 31 30 2e 0d 0d 49 6e 20 74 68 65 20 6e 65 78 |510...In the nex| 000030e0 74 20 6d 6f 64 75 6c 65 20 49 20 73 68 61 6c 6c |t module I shall| 000030f0 20 6d 6f 76 65 20 62 61 63 6b 20 74 6f 20 62 61 | move back to ba| 00003100 73 69 63 73 20 62 72 69 65 66 6c 79 20 77 69 74 |sics briefly wit| 00003110 68 0d 6c 6f 67 69 63 61 6c 20 6f 70 65 72 61 74 |h.logical operat| 00003120 6f 72 73 20 41 4e 44 20 4f 52 41 20 45 4f 52 20 |ors AND ORA EOR | 00003130 42 49 54 20 77 68 69 63 68 20 77 69 6c 6c 20 65 |BIT which will e| 00003140 78 70 6c 61 69 6e 20 77 68 61 74 0d 6c 69 6e 65 |xplain what.line| 00003150 20 31 32 36 30 20 69 73 20 61 6c 6c 20 61 62 6f | 1260 is all abo| 00003160 75 74 20 28 69 66 20 79 6f 75 20 68 61 76 65 6e |ut (if you haven| 00003170 27 74 20 61 6c 72 65 61 64 79 20 66 69 67 75 72 |'t already figur| 00003180 65 64 20 69 74 0d 6f 75 74 29 2e 0d |ed it.out)..| 0000318c