ZX Review #5-6
04 ноября 1997 |
|
Studies - The procedure for searching text files.
It may be worth based on studies and the deceased in a Bose section for beginners to create a corner of the programmer in which systematically cover the practical programming techniques. Level began to take place quite quickly, and between novice and master - large range of intermediate levels, whose representatives and constitute the majority of readers of the Revue. " To improve the overall Literacy would not hurt to systematize ways to reduce the size of standard procedures and improve their performance, especially for procedures to copy blocks of memory. In principle, it is all already given, but scattered for different numbers. But lately the program starts meet the fragments of type: LOOP LDI; 16 bars JP PE, LOOP; 10 cycles (Information about the run-time commands taken from the three-volume programming in machine code. "Inforkom, 1993). Obviously, the author read somewhere that LDI faster LDIR (21 cycle). As a result, the length of more three bytes, and performance below 5 cycles in each cycle displacement bytes. It seems that someone has offered to do collaborative programming. Leave this way to a game that has great commercial value, it is unlikely, not least because it was unlikely Does anyone have the strength to manually fill a huge number of sprites. But write another variant of TETRIS or BALL BREAKER with a minimum number of sprites is quite possible. The game itself not of paramount importance. Importantly - show all the process of creating a complete program. A designed for this time, the procedure can be continue to use their own developed programs. If the result will be More at least several tens of programmers who write for SPECTRUM, it would be better all because the software market software can not satisfy increasing number of programs we offer. The more programs, the more users and greater demand for other program. A number of topics for programming indefinitely. The search TEXT FILE I have not met yet not a single disk doctor that supports alternative character set, which became the de facto standard for text files ZX-SPECTRUM. To simplify the process of recovery discs containing text files ZX-WORD, ZX / IBM EDITOR, ZX-ASM and etc., the proposed procedure show discs destroyed catalog. The initial track and sector set in the variable TRACK. On displays the contents of three related sectors. At the top of the screen printed track number and sector, which begins with a conclusion. Sectors are highlighted in color. When you press BREAK exits from the procedure by pressing any other key dumps the following three sectors. At FONT during compilation is loaded decoder contains images of 256 character codes 0-255. LOADCODE - assembler directives XAS, retrieves the block codes. If you're using another assembler, replace it A similar directive to your assembler. For ZEUS this PLACE, for TASM, ALASM - INGBIN, ZX-ASM 3 - INSERT. Decoder can make their own, but much easier to retrieve it with the help of program's FIND EDIT FONT, from any text editor that uses a matrix of 6x8 pixels. Even easier to use one of character sets, attached to the ZX-ASM assembler 3. Procedure PRIN_42, used for printing in the format 42 character in the string is taken Review of the ZX-N4-5/96 p.101 ((c) A. Matyushev). 140. INIT LD HL, # 0100; H-TRK, L-SEC. TRACK EQU $ -2 LD (# 5CF4), HL XOR A OUT (# FE), A LD A, # 45 LD (# 5C8D), A START LD HL, # 4000 LD DE, # 4001 LD (HL), L LD BC, # 1840 LDIR LD A, # 30 LOOP1 LD C, # E0; B = 0 LD (HL), A LDIR SUB 8 CP # 18 JR NZ, LOOP1 LD C, 31 LD (HL), B LDIR LD A, 2 CALL # 1601 LD DE, MES1 LD C, MES2-MES1 CALL # 203C LD HL, # 5CF5 PUSH HL CALL NUMBER LD DE, MES2 LD BC, FONT-MES2 CALL # 203C POP HL DEC HL CALL NUMBER LD HL, # 0200 LD (XTXT), HL LD HL, BUFF PUSH HL LD DE, (# 5CF4) LD BC, # 0305 CALL # 3D13 POP HL LD C, # 03; B = 0 LOOP LD A, (HL) CALL PRIN_42 INC HL DJNZ LOOP PUSH HL LD HL, YTXT INC (HL) POP HL DEC C JR NZ, LOOP KEY XOR A IN A, (# FE) OR% 11100000 INC A JR Z, KEY CALL # 1F54; BREAK? RET NC JR START NUMBER LD C, (HL) LD B, 0 CALL # 2D2B JP # 2DE3 MES1 DEFB 22,00,6 DEFM "TRACK:" MES2 DEFB 6 DEFM "SECTOR:" FONT LOADCODE "Font" PRIN_42 PUSH HL LD HL, XTXT LD A, 41 CP (HL) JR NC, WR2 XOR A LD (HL), A INC HL INC (HL) WR2 POP HL LD A, (HL) PRSYM EXX PUSH HL LD L, A LD H, 0 ADD HL, HL ADD HL, HL ADD HL, HL LD DE, FONT ADD HL, DE PUSH HL LD DE, (XTXT) LD A, E ADD A, A LD E, A ADD A, A ADD A, E LD E, 255 LD L, 8 CHPL1 INC E SUB L JR NC, CHPL1 ADD A, L LD H, A LD A, L SUB H LD (SL1-1), A LD (SL2-1), A LD A, D; AADR AND # 18 ADD A, # 40 LD H, A LD A, D AND 7 RRCA RRCA RRCA ADD A, E LD L, A POP DE LD C, 8 SCRL LD A, (DE) LD B, 0 SL1 SRL (HL) DJNZ SL1 AND A LD B, 0 SL2 RL A RL (HL) DJNZ SL2 INC HL LD (HL), A DEC HL INC H INC DE DEC C JR NZ, SCRL LD HL, XTXT INC (HL) POP HL EXX RET XTXT DEFB 0 YTXT DEFB 0 BUFF; buffer for loading of 3 sectors 2 Besides restoring the damaged disc, the above procedure can be used for translation of the text contained in the HELP-programs to note printable. Monitors, debuggers, unfortunately, also not yet understood porusski and faster may prove the following method: runs HELP, insert a blank disk and pushed MAGIC. The program can then hang up, but the text will be stored in uncompressed form. (Protect from MAGIC your ad product will be only a madman). It remains to crawl disk, extract the text and using text editor to remove trash code at the beginning and end of file. *
Other articles:
Similar articles:
В этот день... 21 November