Adventurer #08
31 августа 1998
  Софт  

Presentation - HELP Z_80: User's Guide.

<b>Presentation</b> - HELP Z_80: User's Guide.
     (C) Ivan Roshchin 9. 04. 1997.



        HELP_Z80 (beta-version)


       User Guide



   Introduction



     HELP_Z80 - it's free
(Freeware), which has no analogues utility
which is an electronic
Command Reference Microprocessor
Z80. With it you can learn a mnemonic
(And its meaning), encoding an impact on
flags and run time for each command processor, as well as other 
useful information. HELP contains a description of 1136

teams, including the undocumented, is in about nine kilobytes 
of memory and can run on ZX SPECTRUM 48 ... 512K. The beta 
version of the program differs from the full only by the fact 
that for the teams Z80 does not specify the corresponding 
computer codes. 



   Loading and Running



     In the simplest case to start
HELP'a enough to enter the command TR-DOS:


     RUN "HELP_Z80"


     This command starts the BASIC loader that performs the 
following actions: 


     -If the launch is made from the regime
128K, the computer switches to 48K with
open pages;

     -In the seventh page of memory load file "help_z80";

     , Control is passed to address
56064 = # DB00.


     HELP can be loaded in any
another memory page, but you have to either rewrite the boot or 
take an appropriate action manually. I will cite a few examples:



     a) BASIC. Download 1-st Page:


     RANDOMIZE USR 0

     CLEAR 24999

     OUT 32765, 17

     RANDOMIZE USR 15616

     LOAD "help_z80" CODE

     RANDOMIZE USR 56064


     Restarting:


     OUT 32765, 17: RANDOMIZE USR 56064



     b) STS. Download 1-st Page:


     [B] # 11

     [L] help_z80, # DB00, # 2500

     [J] # DB00


     When using the STS version 5. 0
above can be run using the command HELP [C] # DB00. In this 
case, after leaving HELP'a will return to the STS. 



     c) Run the already loaded in the 1-st
Page HELP'a from the program in assembly language:


     LD BC, # 7FFD

     LD A, # 11

     OUT (C), A

     CALL # DB00



   Working with HELP'om



     After the appearance of a small shouts
with the name of the program and information about the author, 
press any key and you will see the main program screen:




      The instruction set processor Z80


          Symbols

 - Flag is not changed;

   flag is set in accordance

   with the result of the operation;
 1 flag is turned on;
 0 flag is turned off;
 ? flag is undefined;
 P flag overflow / parity works

   as the parity flag;
 V flag overflow / parity works

   as the overflow flag;

For some teams in the column t two values:

-Commands for conditional JR, CALL, RET second

  value is the number of cycles at

  Satisfaction.

-For "cyclical" commands (DJNZ, LDIR, ..)



     The ability to watch
information as plain text, using
control keys:


     [CS +6], [CS +7] (CURSOR)-displacement
to the line up and down;

     [CS +3]-PageUp;

     [CS +4]-PageDown;


     [CS +1] (EDIT)-switching screens
(As in the STS). Acts

     unless HELP uses the second
screen. This feature is useful,
If HELP is loaded instead of the STS, and is invoked from 
assembler. Moreover, we can "simultaneously" see source code 
and information about teams Z80. 


     [Q]-exit HELP'a (in assembler or
the calling program). When the recovered processor state at the 
time of launch HELP'a (see "System Information"). To go to the 
assembler, HELP establishes four memory page and executes the 
command JP # C000. At the same time port's registers A, B, C, 
and and five bytes of memory at address # 57E0

(However, it does not really matter).

     In some cases, to avoid
trouble, instead of out in the assembler
exits to the caller.

     Output in the assembler is not possible if:

     - Assembly is not loaded (at
# C000 is 0);

     - HELP run in 48K;

     - HELP is a 4 page;

     - Stack is above 25000.



     When you press the key combination
[CS + SS] (EXT. MODE) mode is activated
Command, which has the following
Keys:


     [CS +7] (up arrow), go to
beginning of the text;

     [CS +6] (down arrow), go to
end text;

     [Q]-an alternative way to exit
HELP'a;


     [S] - search for information about any
command processor.

     You must enter mnemonics
in the same form in which it is presented
HELP'a in the text (you can specify only the first few 
characters). If a team is found, the information about it 
appears in the top of the screen, otherwise the HELP signal to 
change the color border. Searching always starts with the line

HELP'a, which is located at the top of the screen,
and continues cyclically. At any time
it can be stopped by pressing
BREAK.


     Example: search for information about the team
LD L, N



   Command: Search LD L, N

      The instruction set processor Z80


          Symbols

 - Flag is not changed;

     ...................................



     After the search:


 LD L, N 2E N - - - - 7

 LD HX, N DD 26 N - - - - 11
 LD LX, N DD 2E N - - - - 11
 LD HY, N FD 26 N - - - - 11
 LD LY, N FD 2E N - - - - 11

    ...................................



     Using the same function can be learned, what is the 
meaning of a mnemonic assembler. To do this, go to the 
beginning of the text and listed as rows to find the right 
mnemonic. 


     Example: search for information on mnemonics
LD



   Command: Search LD

      The instruction set processor Z80


          Symbols

 - Flag is not changed;

     ..................................



     After the search:


 LD - LoaD


                         Flags t
 Mnemonic code

                      C Z P / V S N H

 LD A, N 3E N - - - - - - 7

   ...................................



     [M]-all background information is written into the memory 
at address # 6000 = 24,576 in a plain text format.

This feature is useful if you
want to write the content in HELP'a
text file, for example, to follow
Print.

     Since the text is very large in terms of
(1670 lines, more than 66K), it will be broken
into three parts and each function call
in another part of memory is formed.
At the same time displays a message like:


     Command:

     Making part 1, 24576, 23936


     The first number indicates the start address
text, and the second length. For the record
text on the disk you can use the TR-DOS or STS.



   HELP_Z80 + ASM



     You can download the HELP in any assembler debugger 
instead of STS. For example, in assembler "ZX ASM 3. 0", which 
I use, there is an option "Load sts". When it choosing to 
specify a file name that will be loaded as a debugger. You can 
specify the name of "help_z80", to work with HELP'om, and then, 
if necessary, download STS and work with him. In other 
assemblers (TASM, MASM, ALASM) a useful option is not so in 
this case would have or rename the file "help_z80", say, "sts5. 
1a", or download HELP manually. What can you do, there is still 
no such assembler that fully supports all features HELP'a, but 
we hope that this is a temporary phenomenon.




   HELP_Z80 + ASM + STS



     If the memory there's space,
You can simultaneously place in it and assembler, and debugger, 
and HELP. In this case, you can call the HELP of the BASIC or 
STS as it is stated in section Download and run. " You can also 
write User-function to call the STS and HELP with it

using (see example).

     For users of assembler ZX ASM
3. 0 I can advise in place HELP
3 banks of memory, thus you will
the use of STS. Note
that part of the bank's limited size Pool size, is used to load 
from disk to compile. To HELP was not erased, you must install 
the Pool size = 7168 bytes. If you are using a double nested 
text, this value will decrease to about double (up to

3584 bytes).


     Example of User-function to call
HELP'a when STS is 7
page, HELP in the third, and the resident is located at # 5B90:


         LD HL, HLP_RES

         LD DE, # 5B90; address resident STS

         LD BC, 14; its length

         LDIR; establish a new

                         ; Resident

         LD BC, # 7FFD

         LD HL, # 1B1F; memory banks

         LD (# 5B9B), SP; saved SP

         JP # 5B90; call resident

HLP_RES OUT (C), H; established bank

                          ; HELP'a

         LD SP, # 0000 New to SP

                  , (To remember the return address)

         CALL # DB00; caused HELP

         OUT (C), L; established bank STS

         LD SP, # 0000 restored the old

                          ; To SP

         RET; and returned to the STS.



    A shorter version of this function
for STS 5.1:

# FE2A: LD HL, # FE33; set the address.

         CALL # E354; This sub-

                          ; Establish resident

         JP # E33D; and this, run it.

; This piece will work on addresses # 5B90-# 5BA4:

# FE33: LD HL, # 1B1F; a number of banks

                           ; Memory

         LD (# 5BA2), SP; saved SP

         OUT (C), H; established bank

                          ; HELP'a

         LD SP, # 0000 New to SP

                          , (To remember the return address)

         CALL # DB00; call HELP'a

         OUT (C), L; established bank STS

         LD SP, # 0000 restored the old value of SP

         RET; and returned to the STS.



   System information



     Presented in this section information will be useful as an 
ordinary user, and to anyone who wants to write (Or remake), 
assembler or debugger in order to take full advantage of HELP'a.




   Storage allocation



     As you can see, the distribution of memory HELP very 
similar to the well-known debugger STS. This is done 
specifically in order to ensure convenient to use in 
conjunction with HELP'a assembler. HELP can be located in

any page in memory at address # DB00 = 56064 and
takes # 24FE bytes to address # FFFD (last two bytes are not 
used). 

     Supported memory expansion up to
512K on port # 7FFD.

     Determine their own location and used the screen is
each time HELP'a, so you can freely move it from
one page in memory to another. Perhaps
the presence of multiple copies in memory
HELP'a.

     If HELP is loaded in the 7 page, or
When run, it found that a 7 page contains STS, for displaying 
information will use the second screen, or

standard.

     You might ask: how
HELP also know there is a 7 page, or STS
No? The fact is that in any version of the STS
contains the character string "SZ5", which
and looking for HELP.



   Features of



     When you start HELP'a at # DB00
the following occurs:


     - Remembered SP, after which the stack
reset;

     - Saved values ​​of all processor registers;

     - Verify mode interrupts (enabled / disabled), after which 
they prohibited;


     - Check what ROM is connected,
after which connects the 48-th ROM.


     When you exit the HELP'a all returned to their seats:


     - Includes a standard screen (if
HELP was launched in full screen mode);

     - Connect ROM, which was on
the time of launch;

     - Resets the values ​​of registers, including the SP, and 
operation interruptions. 


     Determining ROM connected in the same way as in one of the 
procedures TR-DOS, on the basis of content analysis

memory at 949. If it
contains the number 243, it is considered that
connected 48-th ROM, or 128-e.


     HELP does not spoil the value of a single
memory cells, eliminating himself and screen area. Thus, it is 
completely autonomous. 


     The value of R register after
HELP'a work (ie, after executing the command RET) will be 1 
more than that which was right after it is run (ie, after 
executing the command CALL # DB00). Thus, after performing any 
of the the following two commands the contents of R

will be the same (at # 0052, as
is known, is just RET):


     1. CALL # DB00 2. CALL # 0052


     This is done to ensure that after
Launch of STS HELP'a with the command
[C] contents of the registers being debugged
program has not changed. However, with this start changing two 
bytes from the stack the program being debugged (in which STS 
stores the return address). 



   Additional features



     Opportunities are not limited HELP'a
easy viewing of background information.
Imagine, for example, the following situation: you type a 
program in assembler and study it with a debugger. Cursor on 
any team. You press a certain key combination,

and displays a window with background
information on this team. For users of IBM PC is the usual 
style of work, but on the Speccy, I do not like seen.


     Of course, to use this opportunity to make substantial 
changes to the assembler and / or debugger. That's all 
necessary information to use for this purpose, the point of 
entry with the address # DB02: 


     When the procedure is called at # DB02
on the screen to be built box with information about the 
desired command, then control is returned to the caller 
program. Saves the contents of the screen under the window is 
not performed, the attributes and not installed, so this should 
take care of the caller. After calling this procedure, unlike

entry point # DB00, registers AF, B, DE change their values. 
Possible that, when HELP was unable to find the information, 
for example due to incorrect job line with mnemonics. In

this case, it displays "Not
found ".


     Parameters:


     IX - points to a string with the text
command reference for which to get. The string ends with a null 
byte and must reside in memory below

# C000.


     A - indicates which screen is
produced output. 0 corresponds to the standard screen, 1 second
screen.


     Command text should be indicated with
given values ​​of the operands. Mnemonics
must be separated from them by a single space,
for example:


     LD HL, (12345)

     ADD A, # 87

     IM 0

     SET 4, A, (IX +31)


     Example: depict the main screen
window with background information about the team
EX AF, AF ':


     LD IX, TEXT

     XOR A

     CALL # DB02

     ...

     TEXT DB "EX AF, AF '", 0



   The entry point for STS



     This entry point is located on
at # DB04, is designed to output
on-screen help on a command assembler
on which the cursor is in the debugger STS.
Basically, it performs the same action,
that # DB02, but specially designed to ensure that changes made 
to the STS has been minimal and allow easy adaptation of any 
version of the debugger. Requires the user to specify the 
command with the cursor, double press ENTER (or press ENTER, 
and BREAK), to enter into edit mode and get out of it, and then 
use key combination [SS + U] to call a user function (which, in 
turn, will cause # DB04). The callee represents the center of 
the screen window with information about the team, sets the 
attributes (The color of the window is the same as the color of 
the listing), waits for any key and returned to the STS. After 
completing her of the value registers AF, B, DE will be

changed.


 # 0000 F3 AF 11 FF FF C3 CB 11 s / ccCK
PC # 0000 # 0000 F3 DI
SP # 5FE8 # 0001 AF XOR A
IX # 8685 # 0002 11FFFF LD DE, # FFFF
IY # 5C3A # 0005 C3CB11 JP # 11CB
HL # C07A # 0008 2A5D5C LD HL, (# 5C5D)
DE # 5B45 # 000B 225F5C LD (# 5C5F), HL
BC # 7FFD # 000E 1843 JR # 0053
AF # 172C # 0010 C3F215 JP # 15F2
IR # 3F16 # 001 1938

  INT # 001 JP NN 8

  3P # 001 May 8

         # 001 CZP / VSNH t = 10 August

         # 001 - - --- 8

         # 001 (# 5C5D)

         # 001B HL)

         # 001C CD7D00 CALL # 007D

         # 001F D0 RET NC

         # 0020 CD7400 CALL # 0074

         # 0023 18F7 JR # 001C

         # 0025 FF RST # 38

         # 0026 FF RST # 38

         # 0027 FF RST # 38


                                Bank # 18


     Parameters:


     IX - indicates the address of buffer
line editing in STS. Later
We denote this address as BEGIN_S.
In the version of STS 5. 1, it is # FF80.


     A - indicates which screen is
produced output. 0 corresponds to the standard screen, 1 second
screen.


     L - number of memory banks in which
is STS, ie, the number to be
recorded in the port # 7FFD to install this
Bank.


     Example of User-function to call
HELP'a when STS is 7
page, HELP in the third, and the resident is located at # 5B90:


         LD IX, BEGIN_S; buffer address

         LD A, 1, display number

         LD HL, HLP_RES

         LD DE, # 5B90; address resident STS

         LD BC, 14; its length

         LDIR; establish a new resident

         LD BC, # 7FFD

         LD HL, # 1B1F; memory banks

         LD (# 5B9B), SP; saved SP

         JP # 5B90; call resident

HLP_RES OUT (C), H; established bank HELP'a

         LD SP, # 0000 New to SP

                         , (To remember the return address)

         CALL # DB04; caused HELP

         OUT (C), L; established bank STS

         LD SP, # 0000 restored the old

                           ; To SP

         RET; and returned to the STS.


     Note: if we replace
Address # DB04 at # DB00, the same User-function to be called 
in fullscreen HELP mode.




   Literature



     1. A. Larchenko, N. Rodionov "ZX
Spectrum and TR-DOS users, and
programmers.


     2. Inforkom "Programming in machine code and assembly 
language." 


     3. Evdokimov, A. Kapultsevich, I.
Kapultsevich "How to write a game in assembly language for the 
ZX Spectrum". 


     4. SP Shutov, M. Mukhametshin
"Z-80 microprocessor. Guidebook.


     5. VP Fedin, Yu "A complete description and
full disassembler ROM TR-DOS 5. 04T (5.
03).


     6. VA PRINT "Assembler Z80".


     7. Steve Kramer "Operating System
Spectrum.


     8. "ZX-REVIEW", "SPECTROFON",
"ZX-FORMAT", "ON-LINE", etc.







Other articles:

From the Author - help: New bugs in the new shell.

From the Author - the author: about the authors of the magazine.

Presentation - Content of the program: Installer to AUTORUN DISK v2. 0 adventyurnaya game Diamond.

Presentation - a program for protecting programs TRICK v1. 003b.

Presentation - HELP Z_80: User's Guide.

Interface - letters from readers: Black Raven, The Secret Game NEW DIZZY, On the errors of the game APOLLO, a new debugger Veros STS 6.2, How to beat the game Svyatogor.

Interface - PC vs Amiga: Is AMIGA RULEZ? First impressions neophyte.

Interface - support for producers of "iron" their "creations" after they (the creatures) get into the hands of users.

Interface - thinking out loud: "SPECCY computer for young people. If we have so many cool coders, why so little steep domestic soft'a?"

Interface - pens from CAV inc: "SPECCY it does not work, this rest is, even more than the rest, it's a lifestyle, and if by that you still manage to get the money. .. "

Interface - SPECCY pros and cons, Reflections Spy / Eternity Industry.

System - Overview of system programming: ZX-IBM Editor v1.5M, PPF v1.05, Multistudio v2.0p, Mods Player v2.0, Bitmap Viewer v2.0, Corrector v2.0, Storm v1.1, 866 v1.2, HRUM v3.5, TDU v1.0, HRUST v1.0, RLE-Compressor v1.21, Overlays Consul Commander.

Toy Review - An overview of new gaming software: Rabbit Jazzy, Quadrax, Komplex, Math of the day, Cue Boy, Zly Sen, Prva Aakcia, Outlaw, The Dark Empire, Gary Linekers.

Toy Review - Demos: Little Ghost, The Dark Empire, Worms, Smagli 3 Monster Land, Civilization, Mysteries of Captain Shelton.

Guests - Presentation of a group of Kovrova - Eternity Industry.

Guests - Filix about creating games Winnie The Pooh-2.

Guests - ekstremalschiki: new section which highlights aspects of the life and work of extreme Rybinsk musicians. Today, a visit Marat and Demon - stood at the origins of such well-known (in the narrow circles) team "Disgust".

Promotion - How to play the game Encyclopedia of WAR.

Promotion - the passing game Where time Stood Still.

Promotion - description of the game Elopement: back to the Earth.

Promotion - the passage of text adventyury Island of Darkness (Island Darkness).

Promotion - the passage of text adventyury Knightmare.

Exchange of experience - Russian glitches: The Island of Darkness Game (how NOT to write adventyurnye game).

Exchange of experience - Finalization ZX-ASM v3.0 by Ivan Roshchina.

Exchange of experience - Features video controller ZX Spectrum (for programmers).

Exchange of experience - Graphic effect IRIS (plasma).

Exchange of experience - the procedure output window frame.

Exchange of experience - on how to operate in the assembly with the long numbers of type Long.

Exchange of experience - Art Studio and the principle of open architecture (how to write their own modules to the editor).

Exchange of experience - The movement procedure of attribute labels in pixels (floating atrubuty).

Ottyag - A Tale of Pentium Pentiumovicha Pentiumova. 20 things you can do if your favorite team lost on the road. Toilet, as a measure of human values.

Ottyag - Test "Formatsevt, check for authenticity."

Ottyag - Test "You are not dumb ass."

Ottyag - The test "Do you have a sense of humor."

Ottyag - Test "Which of your student."

Ottyag - How to PROPERLY kill Windows'95.

Ottyag - Winnie the Pooh and all-all-all - 2.

Novella - Tales Corporal Djilali (the game Laser Squad).

Novella - Escape from Space (the game Elite).

Novella - Hedgehogs mutants.

News - News from the Rybinsk spektrumistov: Infosoft, Shrsoft, Surgeon, Chasm, Protecvision, Groboclone, Volume 4, Experience, Mr. Vano, Ant, Demon, Miguel, Veka, RDM, Auryn.

News - News from the Yaroslavl spektrmistov: Marchy, Kav Software, Nicolas Viper, Dr Shura, Harkonnen, MacKeymn, DJ Reason.

Advertising - advertising and announcements.


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

Similar articles:
AY Music Hit - Top 5 AY-tunes.
Steelworkers Spectrum - the story of today's routine of Western firms, once producing games for the Spectrum.
Interview - An Interview with Joker'om (Mafia).

В этот день...   3 December