APPLICATIONSPROGRAMMATION ★ RSX VFIND: VARIABLE FIND (COMPUTING WITH THE AMSTRAD) ★

Variable Dump (Computing With the Amstrad)RSX Vfind: Variable Find (Computing with the Amstrad)
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

VARIABLE Find is a machine code program to complement Roland Waddilove's Variable Dump published in the February 1987 issue of Computing with the Amstrad. Having identified mistyped variable names with |VARDUMP you can now pinpoint the offending line number using SVFIND, the RSX added by this program.

Type in Program I which is the Basic loader for the machine code. Save it before trying to run it because once you have debugged the data statements the Basic will erase itself from memory when it has installed the RSX.

The new command can be used with or without Vardump in memory and will accept upper or lower case as valid input. To use it put the variable name into a string, such as A$="FRED". It doesn't have to be A$, you could use F$ or just about anything else that takes your fancy. You should omit suffixes such as $ and % from the name otherwise they will be treated as part of the name and produce a nil return.

Then type |VFIND,@A$ and a list of line numbers will be printed out. Don't forget the (a before A$ as this is vital to the way your Amstrad extracts the variable name from the string.

The search routine has been kept fairly simple for the sake of speed, economy of memory and your fingers. Consequences of this are that the routine does not distinguish between string or numeric variable names and may print out spurious line numbers for one of two reasons.

Firstly, if your variable name also happens to be embedded at the end of a longer name then the line number containing the longer name will be listed. An example of this would be printing a line number containing OLDFRED$ when what you were really after was FRED. Of course line numbers containing FRED would also be listed out, so this is not too much of a problem.

Secondly, if your variable name is very short, particularly only one or two characters in length, it is quite likely that other bytes of program data will match the Ascii values of the name. These line numbers will be listed out for no apparent reason.

In practice you are unlikely to be searching for one or two character long variable names, and even if you are |VFIND will produce a shortlist of line numbers among that are correct lines which are easily checked.

Program II is a listing of the assembly language source code. Budding machine coders among you should find it helpful to look at the way it works, particularly the method for passing the contents of a string variable over to a machine code program, the search method and the routine for printing out a decimal.

You may know that if you make a call to a machine code routine either by RSX or direct CALL and if a parameter follows your call - such as CALL &A000,3 or CALL &A000,z where z is a numeric variable - the IX register points to the low byte of the last parameter passed and the A register contains the number of parameters.

This is easy enough to deal with if a number or numeric variable is being used but what happens if you want to pass a string? Well unfortunately you can't CALL &A000, FRED and hope that FRED will be available to your routine. You must put FRED into a string such as A$ and then CALL & A000, @A$, or in our case |VFIND,@A$.

On arrival at the machine code the A register still contains the number of parameters passed, but the IX register points to the address of the storage location of the variable A$. The (& before A$ tells your micro to pass the address of a variable rather than its value.

This address stores the location of the string descriptor block, which in turn points to the address of the contents of the string as well as giving the number of characters it holds. After sorting all that out we're finally in a position to access the string from our machine code program.

Having found the start of the string it is transferred to a store while being converted to upper case if necessary. 128 is added to the value of the last character. The stored variable name now matches the form in which it appears in the Basic program, assuming upper case. As you may have originally used lower case or may have mixed upper and lower case the search routine converts all lower case to upper case before comparison.

The search begins at address & 170 where all Basic programs start. To help you understand how this of program data. If at any stage mismatch occurs then carry on th main search where it was left of otherwise if a total match was found convert the line number to decirnal print it and continue searching on th next line.

The routine to convert a 16 bit number to decimal and print it out if fairly simple and is just the job for printing out, for example, the Score if your latest arcade masterpiece Vardurnp and Vfind together should save you hours in debugging you Basic programs. Happy hunting.

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEARS: 1986 , 1987
★ CONFIG: ???
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTIONS: COMPUTING WITH THE AMSTRAD 1986 , COMPUTING WITH THE AMSTRAD-AUSTRALIAN
★ AUTHOR: Ian C. Sharpe
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» VFind    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-23
DL: 218
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 Cyls
.HFE: Χ

» Vfind    (Computing  with  the  Amstrad)    ENGLISH    LISTINGDATE: 2020-07-23
DL: 272
TYPE: text
SiZE: 4Ko
NOTE:

» VFind    (Source)    (Computing  with  the  Amstrad)    ENGLISH    LISTINGDATE: 2021-02-02
DL: 187
TYPE: PDF
SiZE: 175Ko
NOTE: 3 pages/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » File'n Find
» Applications » RSX Find (CPC Amstrad International)
» Applications » Planet - Finder (CPC Amstrad International)
» Applications » RSX Remfind (Happy Computer)
» Applications » Prime numbers : Prime generator & Prime finder
» Applications » RSX Find
Je participe au site:
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 206 millisecondes et consultée 1603 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.