APPLICATIONSPROGRAMMATION ★ Breakpoints ★

Breakpoints (Computing With the Amstrad)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 ★ 

WRITING machine code programs can be extremely frustrating at times. It's not often that a routine works straight away and I'm always surprised when it does.

When things go wrong in Basic you can always press Escape to stop the program or maybe it'll stop anyway with an error report.

Then you can usually see where it's gone wrong by listing the offending lines and easily correct them.

Machine code is totally different. When things go wrong they do so with a vengeance and often the only solution is to switch off the micro and start again.

It can be very difficult to work out why the program crashed, where it was up to and what it was doing.

Breakpoints is a routine that will enable you to run a machine code program and stop when the program counter reaches a preset value.

For instance you could run a routine at &9100 and instruct it to stop when the program counter reaches &9151. It's an essential tool for debugging machine code.

When you run Breakpoints it will set up |RUN, a new RSX which requires two parameters. The first is the entry address of the code and the second is where you want to stop. Take the following program for instance:

8008:3E F4 LD A,245
8002:06 08 LD B,8
8084:CB 08 RRC B
8006:80 ADD A,B
8007:EE FF XOR &FF
8009:CD 5A BB CALL &BB5A
800C:C9 RET


It is supposed to produce a beep by loading the A register with 7 - in a rather round about way - and calling &BB5A. If you run it nothing appears to happen and it's difficult to see why. If we |RUN the code we can stop it at any point. For instance:

|RUN,&8000,&8009


will run the code at &8000 until the program counter reaches &8009, just before the CALL &BB5A.
When the breakpoint is reached the contents of all the registers are printed along with the status of the flags. You can now see what code in

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1987
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1987
★ AUTHOR: ROLAND WADDILOVE
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» RSX-Breakpoints    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-08-24
DL: 185
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 Cyls
.HFE: Χ

» RSX-Breakpoints    (Computing  with  the  Amstrad)    LISTINGDATE: 2018-03-20
DL: 200
TYPE: text
SiZE: 2Ko
NOTE:

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

Lien(s):
» Applications » Jrt Pascal
» Applications » Z80 Assembler
» Applications » Basic Compiler (CPC Magazin)
» Applications » Pascal
» Applications » Autoformation à l'Assembleur
» Applications » ModeMax v1
Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» 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 520 millisecondes et consultée 1672 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.