ZX Review #7-8-9-10
08 ноября 1997

Retro - 40 best procedures: Exchange token.

<b>Retro</b> - 40 best procedures: Exchange token.
       7.2. Exchanging tokens


   Note: a "token"
means any keyword
call (command, function) of
"Dictionary" BASIC, which is considered by the program
(Both computer and interpreter) in the form of some code.

  Length: 46

  Number of variables: 2

  Checksum: 5000

  Purpose: The change any occurrence of a given token in a 
BASIC program on another token (For example, all operators PRINT

may be changed at LPRINT).

  Variables:

     Name: chr old

     Length: 1

     Cell: 23296

     Comment: The code replaces the token.

     Name: chr new

     Length: 1

     Cell: 23297

     Comment: The code is a replacement token.

  Calling the program:

     RANDOMIZE USR address

  Error checking: If BEYSIKprogrammy not in memory or a
of the two specified tokens has
code is less than 32, then the procedure returns to BASIC.

  Comment: This procedure
very quickly, but the longer
BASIC program, the slower
it works.


   LISTING machine code
Assembly label number to VVODA147.


       LD BC, (23296) 237 75 0 91

       LD A, 31 62 31

       CP B 184

       RET NC 208

       CP C 185

       RET NC 208

       LD HL, (23635) 42 83 92
NXT_CH INC HL 35

       INC HL 35

       INC HL 35
CHECK LD DE, (23,627) two hundred thirty-seven 91 75 92

       AND A 167

       SBC HL, DE 237 82

       RET NC 208

       ADD HL, DE 25

       INC HL 35

       LD A, (HL) 126

       INC HL 35

       CP 13254 1913

       JR Z, NXT_CH 40237

       CP 14254 1914

       JR NZ, COMP 32 3

       INC HL 35

       JR NEXT_CHR 24230
CONP DEC HL 1943

       CP C 185

       JR NZ, CHECK 32229

       LD (HL), B 112

       JR CHECK 24226
2

  How it works:

  In the registers B and C are loaded
old and new tokens, respectively. If any of the tokens
has a code less than 32, then
the program returns to BASIC.

  In a pair of HL recorded address of the start-BASIC program. 
A pair of registers, and then increases compared with the 
address field variables. If HL is not less

than the start address of the variables, the program returns to
BASIC.

  Pair HL is increased, pointing to the next character. Code
this character is loaded into the accumulator and HL increases
again. If the value in the accumulator is equal to 13 or 14 
(ENTER or NUMBER), routine returns to NXT_CH, and HL increased, 
pointing to the next symbol. If the battery does not contain 13 
or 14, the stored value is compared with the chr old. If a 
couple is found, this symbol replaced by chr new.


  Then return to the test
(CHECK) at the end of the processed
program.







Other articles:

TR-DOS for beginners - The end.

Computer novella - Prince of Persia.

Computer novella - Laser team (the game Laser Squad).

Crossing Dragon - Game Rapscallion.

Crossing Dragon - Playing The Runes of Zendos.

Crossing Dragon - Playing The Saga.

Crossing Dragon - Game Witch's Cauldron.

Crossing Dragon - Create Adventyuru. Review of the editors.

Crossing Dragon - Create a dictionary to Adventyurnoy game.

Program, which we choose - The possible consequences of using undocumented commands.

Program, which we choose - About noticed irregularities in some programs and suggestions for future versions.

Program, which we choose - A proposal to all the authors of software, printers, memory dump. Programmers protect discs from being copied.

Program, which we choose - A few suggestions to improve the assembly.

Program, which we choose - Suggestions for refining ZX Word v2.5.

Program, which we choose - The "Spectrum emulator" v1.2.

Program, which we choose - What could want in a perfect assembly.

Retro - 40 best procedures: Copying data in memory.

Retro - 40 best procedures: Exchange token.

Retro - 40 best procedures: Determination addresses BASIC string.

Retro - 40 best procedures: Determination of the length of BASIC programs.

Retro - 40 best procedures: Determination of the amount of free memory.

Retro - 40 best procedures for: Search and replace strings.

Retro - 40 best procedure: Find the string.

Retro - 40 best procedures: Search for the string.

Retro - 40 best procedures: the list of variables.

Retro - 40 best procedures: an increase and up the screen.

Retro - 40 best treatments: Removal of REM-strings.

Retro - 40 best procedures: Remove the block of the program.

Expert Tips - Game Fredloader.

Expert Tips - Game Robin of Sherwood: The Touchstones of Rhianon.

Expert Tips - Game Scorpions: Die Machines.

Expert Tips - Game Terropods.

page iS-DOS - Description of system restarts IS DOS.

Forum - An algorithm for recognizing characters.

Forum - Time undocumented command processor Z80.

Forum - The concept of a high-color screen resolution.

Forum - A few Pokes to a game. Program Hacman96.

Forum - As for the new DOS and BIOS settings for the Spectrum.

Forum - Multicolor program on any computer model. Using the 2 nd screen Multicolor'a. Demonstration of the text. Electronic journals.

Forum - Project ZX Config.

Forum - Improve Art Studio. Ideas on file compression.

Forum - ZX Spectrum emulator for IBM. About the hexadecimal system. Program ZX-Stars. Oddities in the Elita

Forum - The effects on the curb and Multicolor.

reader-reader - ZX Spectrum 128 - new opportunities, new challenges.

reader-reader - With 'Light'. Spectrum and expert system.

reader-reader - The printer driver for the Scorpion.

reader-reader - Print numbers in different number systems.

reader-reader - Programming arcade game with scrolling screen.

reader-reader - The procedure for printing labels assembler XAS to monitor debugger STS 4.3.

Studies - attribute scrolling text. "Gasilka" screen. A simplified version of the procedure, "Curtain". Procedure is enriched with pictures. Procedure display images on the points.

Studies - Graphic effect "color bars".

Studies - Driver screen printing 64 characters per line.

Studies - Set of protective boot.

Studies - Address to the drive mode IM 2. Working with non-standard disc format.

Studies - Print the character, magnified by 8 times. The program "pouring" screen. The procedure for screen-saver on the points. Clear screen in Terminator'e. Search strings in memory. System character set conversion.

Studies - Program - cataloger of disks.

Studies - Program the output values of the amplitude channel music. coprocessor on the curb.

Studies - Program the output image.

Studies - The program plugs sprite.

Studies - Cleanup of the specified window screen.

Studies - The program sort the array in ascending order. The procedure for filling the screen specified attribute. Procedure display pictures. The effect of moving towards the stars. "Shower", coming from the upper left corner of the screen. The procedure of "shedding" pictures on the pixel lines. The program of "pulling" the picture at an angle of 45 degrees. Three procedures "Scroll".

Studies - The printing of numbers.

Studies - The procedure for drawing a character with attributes.

Studies - The procedure for display pictures. Fade-OUT effect (picture goes beyond the edge of the screen). Visual effect "Fountain." Fade-OUT effect, mimicking the TV off. Procedure "Ignition" pictures. The program continuously drawing a picture.

Studies - The procedure for drawing a line.

Studies - The procedure for making optimal symbol table.

Studies - scrolling lines of text in the specified window. Attribute scroller. Diagonal scrolling.

Studies - sprite scroller. Procedure display screen.

Studies - Short procedure indicating the amplitude channel music. coprocessor. Way to subtract a constant from a register pair HL.

Studies - The formula for calculating the day of the week.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Music - BEST POP MUSIC.
From the authors - As amended by the ZX-News earned first Hayes modem.
ANDY CAPP - Game Description ANDY CAPP.
Promotion - the passage of text adventyury Island of Darkness (Island Darkness).

В этот день...   16 September