SB BBC @ GBR Oldie hints/tips #191-193 Hints and tips from the archives of Wakefield BBC Micro User Group... 191. Uses of *SRWRITE on Master ~~~~~~~~~~~~~~~~~~~~~~~~~~ The *SRWRITE command is officially for the purpose of moving blocks of main memory into Sideways RAM slots. The complementary command is *SRREAD. Well, you can indeed use it in this way, but it can also be used for moving blocks of data around in main memory. The real advantage of using *SRWRITE is that apart from being a very simple command, it is very fast indeed. The syntax takes either of the two forms:- *SRWRITE or.. *SRWRITE + Note that in fact "finish" is actually the address of the first location AFTER the last byte to be moved, rather than of the last byte itself. You could, for example, move up to 16k of screen memory into sideways RAM, and then move it back again to restore the original screen contents. If you were using Mode 4, (not Shadow mode), then the command *SRWRITE 5800 8000 8000 5 will save the screen to bank 5. The command could also be used in the form *SRWRITE 5800+2800 8000 5 and the result would be identical. Personally I generally prefer this latter syntax. To restore the screen contents later, you would use the command *SRREAD with the identical syntax. There is yet another syntax form for these commands, but I won't go into them now. You couldn't save a 20k Mode 0 screen in one RAM bank, but you could save 16k of it, at the beginning, middle or end of the screen memory, or you could easily split it between two RAM banks, and use the spare 12k for something else. If you wished to move the screen memory into a reserved area of main memory, then you substitute the appropriate address for the final "8000" in the command examples given, and then the RAM slot number would be a dummy simply to satisfy the syntax - zero would be as good as any. To move the memory bank into the screen memory area, you use *SRWRITE again, not *SRREAD, and interchange the addresses as appropriate. I couldn't move a 16k Mode 4 screen into main memory, as I would have less than 16k free to start with, so here is an example with an 8k Mode 6 screen, to be stored at address &3000. *SRWRITE 6000+2000 3000 0 (copy screen memory to address &3000) *SRWRITE 3000+2000 6000 0 (copy original contents back to screen memory) alternatively: *SRWRITE 6000 8000 3000 0 and: *SRWRITE 3000 5000 6000 0 (See how the above syntax is simpler) 192. *EXEC files on Master ~~~~~~~~~~~~~~~~~~~~~ Just a reminder that if you try and *RUN files which have no sensible execution and/or load addresses, both DFS and ADFS on the Master will attempt to *EXEC them. Thus if you were running a DFS disc on drive 1, and wished to boot the disc, (you cannot use as it would boot drive 0), you could simply type *!BOOT instead of *EXEC !BOOT. This applies to any EXEC files, including *SPOOLed listings. Oh, if the filename clashes with a ROM command, then you can use *RUN instead, but this can be abbreviated to */. So, these are equivalent, but the last 2 options avoid clashes with ROMs:- *MYFILE */MYFILE *RUN MYFILE 193. Making the most of VIEW (1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Expanding your Macros! by Andrew G8YHI If you need to print a block of text more than once in a document then View offers you the facility to define it at the beginning and then recall it as and when needed. The idea of this is similar to using a procedure from within BASIC and the defined text is known as a macro. Each macro is given a two letter code which can be anything that is not already used by View, so AA would be fine but CE wouldn't. To define a macro press followed by DM and and then type in the two letter code; for example AA. Then type in your text making sure you start on the next line down and include any rulers or commands such as CE or RJ that you want. When completed move onto the next line down and press followed by EM and . So the start of your document might look like this; DM AA This bit of useful text is a macro. EM Wherever you wish to recall the defined text move the cursor to the appropriate line in your document and press (EDIT COMMAND> AA and then so that AA now appears in the margin. When the document is printed wherever AA has been set the text will appear. You can define as many macros as you wish and might store some on disc to be added to other documents using the READ command. Scientific formulae using complex sub and super-scripts are one possibility or perhaps a set of different rulers. Try out this simple macro technique for yourself and next I will show you how to use macros with parameters, which makes personalised mail-shots easy. 73 Rick G4BLT @ GB7WRG