APPLICATIONSPROGRAMMATION ★ MEMORY SEARCH ★

Memory Search (Popular Computing Weekly)Applications Programmation
★ 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 ★ 

The program enclosed is a fast memory search. It will search through the whole 64K of computer memory in 16 seconds for any given string.

A blow by blow description follows:

Program notes

  • Line 10. Set up windows.
  • Line 20. Create a dummy string (F$) and prompt user. Line 30. This method to input user commands is not the most efficient when only two options are required. It was included as an interesting way to accept keys. It can be used with any number of keys, on any computer supporting the Instr function, (you can do away with the Upper$ if required. Note the leading space in the quotes is required to catch nulL entries.
  • Line 40 Catches any illegal key pressed.
  • Line 50. Accepts string to search for (if required).
  • Lines 60, 70 Accepts string of values which are concatenated into the search string.
  • Line 80. Accepts starting address. The complex pari at the end converts those nasty negative values BASIC returns when you take the value of a number larger than &7FFF.
  • Line 90. Sets up a counter (A) to step through the memory.


Converts the address into MSB/LSB form. Note we can't use amstrads modulus division here as it falls over at values greater than &7FFF, (not a bug. its only supposed work on integers!). The pokes are the heart of the routine. Basic has stored the address of the dummy string (F$). We poke the new values into this area and fool the system into thinking the string lives elsewhere, at our address. The Instr function is used to check this string for the search string.

  • Line 100. Prints the current address being searched, closes the loop, and finishes.
  • Line 110. Subroutine to display the address of any matching bytes.

Notes.

All values can be entered in decimal or hex (preceeded by &). The routine can be converted to other machines which support the Instr command. The pokes on line 90 may have to be replaced with: Poke VARPTR(F$) + 1, A-M*256 :Poke VARPTR(F$) + 2,M. The window commands may be omitted for other machines.

PopularComputingWeekly841220

★ PUBLISHER: POPULAR COMPUTING WEEKLY
★ YEAR: 1984
★ AUTHOR: Mark Rice

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

Lien(s):
» Applications » Trace (CPC Amstrad International)
» Applications » RSX-Lib: The RSX Library Utility (Amstrad Computer User)
» Applications » LambdaSpeak Speech Synthesizer
» Applications » RSX-Center (Sizin Amstrad)
» Applications » Befehlserweiterung ohne RSX
» Applications » ROM Disabler (CPC Attack)
Je participe au site:

» 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 204 millisecondes et consultée 1414 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.