Micro #08
05 сентября 1998 |
|
Adapting programs to TR-DOS - Part 3
******************************** ADAPTATION PROGRAMMES OF SYSTEM TR-DOS. PART 3. ******************************** CHAPTER 1. = HOW TO FIGHT WITH BASIC. = (Continued) No less common technique protection BASIC programs is the addition of line BASIC program various control codes: INK, PAPER, AT, TAB, and others. To illustrate the difference between the control code and the operator INK INK. If when listing the program BASIC system meets the operator INK, she honestly presents it on screen without making no action. If, however, found the verification code INK, then followed him bytes BASIC system perceives as color code tone, and continues a listing in this color. All this holds for PAPER, FLASH, TAB, etc. must be taken into account only that the position of display is determined by two bytes that follow the control code AT and TAB, and no one, as for other control codes. Most of the control codes can be delete button Delete, causing beysikstroku for editing. Alternately, press the <> and Delete, and if the authors used the protection of the correct values of control codes, you will not complications sooner or later will get on screen is quite meaningful information. But it also happens: when, for example, BASIC interpreter asked to withdraw program listing 121-meter color of familiarity with the coordinates (240.86), then it simply stops the output listing on the screen, but when you try to edit the line starts a heart-rending yell. In this case it is necessary to first "shut his mouth" operator POKE 23608,0 and continue to operate under this scheme. Another extremely annoying thing that may interfere with the program to cope with adapting it to disk, this lack of memory. It can arise from the fact that First, TR-DOS allocates 112 bytes for their system variables, and secondly, the operators boot disk can hold in Memory is much more space than a similar statement for the tape (if you are used to calculate the memory in megabytes, the word "Significantly" take back), and thirdly, the system TR-DOS need a buffer of at least 256 bytes to read / write file output directory, etc. and even more for printing Catalog floppy command LIST. This additional memory consumption is enough to make your computer with the message: Out of memory, No room for line or else something like that. Do not worry, in this case (as indeed in all others), the computer can be obmanut.Naibolee simple and affordable way to boot this division into two or more frequently. Suppose the original tape loader looked like this: 10 CLEAR 24250 20 LOAD "" SCREEN $ 30 LOAD "" CODE 40 LOAD "" CODE 23296,256 50 RANDOMIZE USR 23296 60 LOAD "" CODE 70 RANDOMIZE USR 24576 Without a bit of doubt you have written boot disk for this program: 10 CLEAR 24250 20 RANDOMIZE USR 15619: REM: LOAD "bomb sc" CODE 16384 30 RANDOMIZE USR 15619: REM: LOAD "bomb mn "CODE 40 RANDOMIZE USR 15619: REM: LOAD "bomb pb" CODE 23296 50 RANDOMIZE USR 23296 60 RANDOMIZE USR 15619: REM: LOAD "bomb ls "CODE 70 RANDOMIZE USR 24576 and run the program, instead of the game were Post 4 Out of memory, 20:1. Just do not you dare to reach for @ bezyane (as some call button Magic, as in common the @ symbol, which marks the TR-DOS file names, "dumped" button Magic, often called a "monkey" or "dog". However, in general sounds pretty good, and corresponds to the true state of things). Try to split the loader in two parts. For example, in our case, the first part of the boot (we call this file "BOMB") will be look like this: 10 CLEAR 24250 20 RANDOMIZE USR 15619: REM: LOAD "bomb sc" CODE 16384 30 RANDOMIZE USR 15619: REM: LOAD "bomb mn "CODE 40 RANDOMIZE USR 15619: REM: LOAD "bomb bs " The second part is called "bomb bs": 10 RANDOMIZE USR 23296 20 RANDOMIZE USR 15619: REM: LOAD "bomb ls "CODE 30 RANDOMIZE USR 24576 The computer will load first the first boot "BOMB", which places the memory enough. Then, after given operation, the first loader loads the second ("bomb bs"), he, in turn, places too short. The second boot completes epic boot and run the program. There may be situations when you have to "saw" boot for three or more parts, but this happens very rarely. More precisely, this technique rarely helps. __________________ -*- CHAPTER 2. -* ----------------------- HOW TO FIGHT BREAK'om. In the previous chapter for details on how to deal with the loader in BASIC after having been received by his listing. Even if the resulting "something" bears little resemblance to listing.Vpolne legally you might be wondering how get this "something" (listing); as not always pressing the Break key after loading the first file, you get what hoteli.Rezultaty interference in the normal course load can be quite unpredictable, starting with the fact that the program is reset, to the fact that it hangs or you obzovet obscene word. More information will describe the effects possible with stop the program key Break, as well as ways in which these effects are achieved. This information can be useful rather not for opening other people's programs, and to protect their (do not forget, however, that taking advantage of following the guidelines below, you protect the program only on those who do not read this text). 1. After pressing the Break key loader continues to function normally. Crossed and refrain from thinking open the program to that you have not yet ready as can be guaranteed to declare that the loader is written in machine codes (this is unrelated to the professionals who read this work just to laugh at the author). 2. After pressing the Break the computer is reset. If the loader is written in BASIC, then most likely that it is used following statement: POKE (PEEK 23613 +256 * PEEK 23614) 0: POKE (PEEK 23613 +256 * PEEK 23614) 1.0 or similar. Performing such an operation changes the address the "return on error" to zero (a system variable ERR_SP). Thus, instead of having to go to the sub- ROM, which displays an error message program moves to the zero address: machine resets (those who have never seen as the machine is reset, can try enter RANDOMIZE USR 0 or press reset). 3. After pressing the Break the screen becomes black and the machine no matter what does not react (Except the reset button, I suppose). Likely to use the operator POKE 23659, 0, establishing the number of lines in service equal to the screen nulyu.K effect just described results in an attempt to BASIC interpreter put your message in the zero rows. 4. After pressing the Break the color screen is not changes, the bottom two lines of the screen are bordyura.Tsvet color screen can also be Border color (including black and not to be confused with the previous case). When you click on Keys can be heard a gentle heard, but screen does not change anything. If you have not yet clicked the keys, type BORDER 7 (or any other value) and, despite the fact that the screen nothing appears, press Enter. After this, you will likely see the words 0 OK, 0:1. Now you can work as usual. (If you have already clicked, then flip through the pre-pressing Delete). In this case, we used the operator POKE 23624, n, where n is the number that specifies the attributes of a service screen, and the 23624 address system variable BORDER. Pressing Break rather tasteless way of promotion programs. Much nicer to deprive auto-boot: then you get complete freedom of action. The simplest thing you can do it download copyist COPY86 / M or Out Copy (Which, in general, the same thing) and copy the loader, do not forget to write press R. Thus, you will receive program without autostart. Such things allows you to make and Other copiers, for example, written Tadeusz'em Wilczek'om (COPY NEW, NEW FORMAT COPY, COPY COPY, etc.). But suppose you have not found a Copy, which allows the program to deprive autostart. I'll try to help. Type the following program: 10 FOR A = 23296 TO 23334 20 READ S: POKE A, S 30 NEXT A 40 RANDOMIZE USR 23296 50 STOP 1960 DATA 221,33,0,128,17,17,0,62,0,55, 205,86,5,33,0,200,34,11,128,62,127, 219,254,203,71,32, -8,221,33,0,128,17, 17,0,62,0,195,194,4 When you start it, the machine enters download mode, but will get only the header. Then, when you press Space, program writes to tape a new title without autostart. For those who hear the word "assembler" and the question: "What time is it?" instead of "Eight thirty "says:" Two effects of the ninth, "cite the source with comments: ORG 23296; 5B00h LD IX, 32768; 8000h address zag; manual ultrasonic title LD DE, 17; 11h length Zago, agile LD A, 0; select "Headers; wok" SCF; check the "load" CALL 1366; 0556h download ; File LD HL, 33024; 8100h job ; Line auto- LD (32779), HL WAIT LD A, 127; 7Fh waiting for; zhatiya Space IN A, (254) RRA JR C, WAIT LD IX, 32768, see above LD DE, 17 LD A, 0 CALL 1218; 04C2h recording ; Tape RET Having a live boot, try it identified in terms of what you already known. As mentioned at the beginning of the first chapter, Loaders are in BASIC, in machine Codes and mixed. Pre-boot authentication can be made by examining allows you to upload files programmy.Beysik Only files with a title. Loader, native can download anything and you want, but usually downloads files without the header (in the original versions gaming software is loaded before folds than any normal copier: files of these programs are not copied). So Thus, if files are downloaded without a title, it definitely can say that loader, with whom you are dealing with, is written in machine code. If all files have header, then we can expect that the loader is written in BASIC, but definitely say that while it is impossible. If the files come across as a headline, and without it, we can assume anything, except that the loader in BASIC. It is not uncommon when the loader, written in BASIC, then loads and runs loader in the codes. For the final identification is necessary to examine the contents of your boot loader. If all the program files have a header, and the number of operators LOAD coincides with the number of files, you can be confident loader is almost certainly in BASIC. To be continued ... In the next issue of "Micro" wait for chapter 3 "MORE ON BASIC. ----------------------------- 03.09.98 Gloom Demons Inc. 'Computer Eye. Special for "Micro 8.
Other articles:
Similar articles:
В этот день... 21 November