APPLICATIONSPROGRAMMATION ★ Z-PACK ★

Z-PACK's (Amstrad Action)Z-PACK's (Amstrad Computer User)
★ 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 ★ 

Running with the pack

Alastair Scott finds that speed is of the essence, but not at the cost of getting in the way IF you want to program in machine code , you'll need two applications to help you - an assembler and a monitor-disassembler. Zenith Software's Z-Pack is the latest example of the latter. There are two versions -64k and 128k - on opposite sides of the disc.

On loading a small program is read in; it can be edited to produce different colours, or the value of HIMEM can be altered. Once loaded, you are in the memory editor. The screen clears to Mode 2 and 384 bytes, starting at &0000, are displayed in hex and Ascii. The current address, plus 8 bit and 16 bit representations of the current byte, are displayed in hex and decimal at the top of the screen.

You can scroll through memory using the cursor keys with optional Shift and Control for faster movement, using the Tab key to jump between hex and Ascii input. Bytes are entered at the current address by overtyping the old values with new values. An interesting feature is that the Clr key toggles between showing Ascii characters as is and converting them to printable characters by reducing them to the range 0-127, with control characters replaced by a full stop.

All keyed up

Z-Pack's most powerful features are unleashed by pressing a function key, at which point a menu drops down and the relevant text or prompts appear.

Pressing f0 gets you a help page, giving information about which keys to press. It also displays the location of the markers (see f4).

The memory pointer can be changed by pressing f1. This lets you jump to any location without having to scroll through pages of bytes.

The disassembler - accessed by pressing f2 - is standard Z80: its output can either be laid over the display of bytes or the whole screen can be used, in which case Ascii values are also displayed.

A given block of memory can be disassembled directly to disc or printer. The disc file is standard Ascii format and thus can be read directly by Maxam or any word processor. These files feature predefined labels. Unfortunately the Z-Pack format isn't perfect - if you add code to such a file the labels will become meaningless because the displacements will change (see right). But it's better than nothing. With a word processor or a good search and replace command, the labels can be changed to something more comprehensible.
The rst commands, which are CPC specific and confuse many assemblers, are disassembled correctly with the right number of parameters.
Crude breakpoints are also provided. You type the byte &F7 at the current address, then run your code. Whenever the breakpoint is reached the values of the Z80 registers, plus stack pointer and program counter, are displayed. Pressing any key continues with program execution., or pressing the Escape key drops you back into Z-Pack. There is no single stepping, which is a pity.

A calculator is available by pressing f3. Type in an expression, and it will be evaluated using integer arithmetic. The four arithmetic operators + - * / and the logical operators AND XOR and OR are all allowed.

Numbers can be in hex, decimal or binary, and must lie in the range 0 to 65535. You must be very careful - calculations are worked out from left to right and the normal order of precedence, which is * / + -, doesn't apply. For example: 100/10+10 = 10+10 = 20 but 10+100/10 = 110/10 = 11. While moving around memory, pressing the Copy key twice at different places will mark the start and end of a block. Pressing f4 will allow you to move the block unintelligently - JPs, CALLs and the like are not altered - save it to tape or disc, dump it to printer, or find a string of bytes. The string can be Ascii, hex or both, but wildcards are not permitted.

A unique feature is that the block can be filled with a byte which is the result of a simple calculation done with the calculator. Pressing f5 clears the screen and displays a bar. Type in the bar command name and it will behave just as though it were typed from Basic. You can use routines in RAM or expansion roms, and even whistle up Maxam.

Z-Pack has three RSX commands of its own; |Z and |ZPACK, which re-run the program, and |CAT, which is the same as the Basic command except that it is bugged - if you use Z-Packs'i CAT all other RSXs are turned off; you have to reset and start again to access them. Another problem is that an external RSX must not change the screen mode: if it does, the Z-Pack printing routine gets confused and starts printing rubbish - you must exit to Basic and restart to correct this.

You can page in the lower and upper roms and any expansion ROM {0-251) from option f6, after which they can be read by the memory editor. The 128k version also allows you to view and alter the second bank of RAM - but no more if you have more than 128k.

Normal disassembler
A000 LD B,255
A001 CALL &BB5A
A004 DJNZ &A001

"Perfect" disassembler
LD B,255
.LBL A001 CALL &BB5A
DJNZ LBLA001

Z-Pack disassembler
.LBLA001 EQU &A001
.
.
.

LD B,255
CALL &BB5A
DJNZ LBLA001

The problem with Z-Pack's disassembler

Two of the options allow you to overwrite the firmware jumpbiock with RAM banks. This will crash the computer, so why include them? On the plus side, no part of memory cannot be viewed or altered where appropriate. The 128k version uses bank 1 of the extra 64k, so it obviously isn't a good idea to alter that bank.

Option f7 lets you load a binary file from tape or disc to any address. It also provides a rudimentary header reader. A check is made, preventing Z-Pack from being accidentally overwritten.

Option f8 executes code from a chosen address, and option f9 returns you to Basic.

For a privately produced program, Z-Pack is certainly well presented. It has a 12 page printed manual, which is comprehensive with lots of examples. The only serious omission is a section on how Z-Pack affects user memory - absolutely crucial if you're going to be debugging longer programs that may not fit around it.

Z-Pack's most remarkable feature is its speed. The notoriously slow firmware routines that print a character on the screen have been replaced by specialised code, consequently it is possible to whizz quickly through memory. A further advantage is that output won't be affected if you write a routine that alters the printing firmware routines. A toggle between medium and high resolution would have been nice, particularly in the full screen disassembler, which looks rather odd with output only covering about half the width of the screen.

In fact, most things are very well done, although the |CAT bug needs fixing urgently and the labelling system in the disassembler could be improved.
However, problems turn up with a vengeance when you look at memory usage. The 128k version sets HIMEM to &7FFF, the 64k to &76F1. All • memory above there cannot be used because it is taken up by Z-Pack. This is very inconvenient -most people prefer to put their shorter machine code routines at &8000 or higher.

This problem occurs with most ram-based utilities, but I have seen 128k-specific routines which behave like pseudo roms; they take up a few bytes of user memory and store most of their code in the banked RAM. So why can't Z-Pack do likewise?

It is imperative that a machine code monitor takes up as little user memory as possible. A program that isn't relocatable and takes up 11 k of the most important area of memory is really little more than a nuisance.

ACU #8902

★ PUBLISHER: Zenith Software
★ YEAR: 1988
★ CONFIG: 64&128K + AMSDOS (All CPCs)
★ LANGUAGE:
★ LiCENCE: COMMERCIALE
★ AUTHOR(S): ???
★ PRICE: £10.95 (464/664/6128 disc only)



★ AMSTRAD CPC ★ DOWNLOAD ★

Advert/Publicité:
» Zenith  Software-Z-PackDATE: 2015-01-08
DL: 432
TYPE: image
SiZE: 62Ko
NOTE: w460*h309

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

Lien(s):
» Applications » ZMON (CPC Amstrad International)
» Applications » Confort-Inkey (Schneider Aktiv)
» Applications » Microsoft Cobol
» Applications » ZAPP: Z80 Assembly Programming Package
» Applications » Investigating CPC Roms (Amstrad Computer User)
» Applications » DLAN: Display LANguage
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.732-desktop
Page créée en 540 millisecondes et consultée 3713 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.