ZX Review #7-8-9-10
08 ноября 1997

reader-reader - ZX Spectrum 128 - new opportunities, new challenges.

<b>reader-reader</b> - ZX Spectrum 128 - new opportunities, new challenges.
(C) VA Sirotkin


         SPECTRUM 128 -

       NEW OPPORTUNITIES

         NEW CHALLENGES


   Further development of 'SPEKTRUM'a become a model with volume
128 kilobytes. Since
CPU Z-80 is an 8-bit processor, and address
space he is not physically
may extend above the value
# FFFF (65535), the expansion of computer memory has been done 
on method of overlapping 16-kilobyte memory pages in the upper 
address of the computer. 

   User has received in his
the disposal of 8 pages of memory
that he could switch at will at any time.

   Basically the same address space of the computer is left for
Users like without visible
changes.

   The presence of 128 KB is not
meant that for the Spectrum was possible to write programs
length greater than 48 kilobytes
but if the program was divided into
sections and download them in parts of
additional pages of RAM, and
then at some point
time caused these pages
then, of course, created the illusion of a huge working area 
the computer (this way of working called the Overlay). 

   128 KB allowed to transfer many of the programs (which are 
loadable levels or multi-stage, multi-level

loading) mode: for load
once - all at once. "

   The owners of the Spectrum-128, which
everything else, became owners of a powerful editor for entering
programs written in BASIC and that
Most importantly, the computer came music processor, with
by which the audio capabilities of Spectrum has increased
several orders of magnitude.


      Memory Allocation


   So, you had a Spectrum
128. There was a distinct advantage - the presence of 
additional memory, but at the same time there was also a lot of 
problems ... A how to manage all this??


   In terms of address space - everything was so
As in the old computer. By
same address screen, the system variables and everything else.
True, now you have
Another area of ​​system variables for the mode 128, and this 
area is located at address # 5B00 (23,296) (yes, yes, yes, in a 
buffer printer. And God forbid, if

mode is 128 your game or system programs use the printer buffer 
- plucked for trouble! And so Like so many programs SPECTRUM-48 
use this area then their normal starting

to or exit from the regime of 128 K in the regime of 48 KB, or 
alter the program). 

   RAM memory your computer (so
same as the old), extending from # 4000 to # FFFF. The upper 
region of RAM - with addresses # C000 and to end - is called an 
overlay, and Here's something to this area as time and

may include any of the 8
pages of RAM (of course, only
one!)

   Immediately after turning on the computer in this area 
included page 0.


   For the rest of the space of the computer's RAM rigidly 
fixed the following pages: a # 4000 to # 7FFF - page 5,

# 8000 to # BFFF - page 2.

   From all this it follows that
You can get a situation where
working space of the computer
simultaneously at different addresses
will:

1) Page 5 - and from the address # 4000

   (Hard) and address # C000

   (Overlay)

OR!
2) page 2 - and to address # 8000

   (Hard) and address # C000

   (Overlay)

OR!
3) Page 7 - and from the address # 4000

   (Substitution) and the address # C000

   (Overlay)


   Additional features
provides page 7 (or
extra video RAM). This
Page can substitute page 5 (basic video RAM), which
provides rich food for software tricks with video output.

   It is only necessary to remember
that all the system procedures, printing, display graphics, 
etc. in Anyway working with page 5, that is with the main 
videoOZU! 

   In order to work with
additional video RAM, page 7 imprinted with the address
# C000, build (or download) on
these addresses video information, and
then include Page 7 instead of page 5, and all that was to
Address # C000, instantly manifest on the screen (with address 
# 4000). Address Allocation screen

7-th page, in this case is
as follows:

pixel screen with up to # C000 # D7FF

                (49152) (55295)

attributes (color) with up to # D800 # DAFF

                 (55296) (56063)


   All switching pages of RAM
as well as switching and mode PZU-48/PZU128 LATCH 48Kb possible 
through the system port address: 


          # 7FFD (32765)


   Accordingly, the command OUT
32765, xx can manage the configuration of your computer. Below 
are given layout of bits on that port:



                  SYSTEM PORT # 7FFD (32765)



          7 6 5 4 3 2 1 0



                      ^ ^ ^ ^ ^ ^


                                       Page number RAM

                                        from the address # C000

                   Latch

                   48 Kb - Page Video RAM

                                      0 - working (5 th)

                                      1 - More

                                               (7 th)


                                  0 - ROM 128 KB

                                  1 - ROM 48 KB


   6 and 7 bits in the Spectrum 128 is not
used. Can be applied
to expand the computer's RAM to
512 KB.

   The rules of the system 128
KB and the system port # 7FFD
(32,765).

   If you are working with the system
port from the BASIC-128, you
it must be remembered that:

 - Before switching pages

   RAM is desired command CLEAR

   32767, so as not to bring down systems
   LIMITED stack.

 - Before the Record of bytes in

   system port, it should

   duplicated in the system

   cell BANK_M address # 5B5C

   (23388)

 - Manage the changeover country
   down from BASIC can be achieved by

   byte entry in the system

   cell BANK_M (apply bytes

   port in this case is not nuzh
   tively).

 - If your needs you Perek
   lyuchilis for additional

   VIDEO RAM, when you exit

   your program the auto
   automatically activates BASICS
   NOE of video RAM.

 - When you turn on the 7 th page on the

   screen (instead of 5 th) 7-I countries
   ence can remain on screen
   wound in any other C / O
   lyucheniyah pages of RAM.

 - Entry of information in addition
   a supplementary video RAM (7 countries
   ence) is possible only if

   when she turned to address

   # C000.

 - If you call from BASIC

   procedure written in to
   dah, which works with the system
   dark port, the first to
   executing this procedure should

   be the team 'DI' - ban

   interrupts.

 - Because all the teams BASIC

   automatically switched on

   During his tenure, bit 4 system
   dark port, ie, include

   ROM 48 KB, then the work of

   BASIC to the system port

   or variable BANK_M same
   desirable to force the inclusion
   chat bit 4 (hence, the operator B
   tion for switching countries
   SIC RAM should be the sum

   number # 10 (16) with the right buy
   volume). At the end of work

   your BASIC program system
   ma itself activates the ROM-128.

 - If you run a program

   (Whether from tape or dis
   ka), who previously worked in

   Spectrum-48, refer to

   during loading is not constipated
   tilsya printer buffer, or

   system crashes.

 - If you have a program for
   painted in mashkodah after

   launch is not going to more

   go to BASIC, then all you
   sheperechislennye rules neo
   byazatelny (with the condition, if

   This program is bound
   bunt).


   BASIC-128 is almost no different from BASIC-48, except
what a powerful screen editor,
so that operators need to dial letter by letter (which is 
reducing the rate of recruitment programs, Yes, and the 
opportunity set color attributes in the line of BASIC The 
editor is absent). 

   In fact, ROM-128 permanent
refers to the ROM-48 procedures for implementation of the BASIC 
program. In the ROM-128 almost nothing interesting there: a 
program editor, procedure, servicing music processor for the 
operator to 'PLAY', so the program works with the virtual disk 
(the operators CAT!, SAVE!, LOAD!, MERGE!, ERASE!)


   Those who are asleep, and sees how to
delve into the ROM-128 - tip:
ROM-128 can not enter any debugger or disassembler. Even
to disk and tape a simple way of not zapishesh.

   Only one way out - write a simple program in codes such as
this and run it from Beysika128:
140.

          org???? ; Area run
start di; disable the interrupt

          ld a, 0 byte system port

          ld bc, # 7ffd; system port

          out (c), a; INCLUDING ROM-3128

          ld hl, 0; and now perekinem

          ld bc, # 3fff; the entire contents of ROM

          ld de, 3 #???? And in free space

          ldir

          ei; soluble interrupt

          ret; emerge
2

   Throwing the contents of ROM-128
in free space of RAM can now be there to save him
disk or tape.

   Who subscribed to or bought
Journals ZX REVIEW over the past few years,
one can learn a lot about Spectrum 128 ... So for example:

 - How to go out in the BASIC-48 from

   mode 128, not stopping

   program and maintaining the possibility
   sequence switch pages

   RAM and come back;

 - How to work with a virtual

   drive by the "channel"

   management;

 - That you can squeeze out of the system
   variables 128K and much,

   much more.


   We, first of all,
should excite the question: "How
things with the disk system? "And just as in
old computer! Only appeared a huge advantage -
have to upload files, there
lots of free space under the work program on the disk. Know
just switch pages of RAM.

   All this is true, but as soon as
your program will go on the road
download via additional
page of RAM, so immediately you can forget about his friends, 
who have not yet been able to purchase Spectrum-128 and work on 
48 kilobytes.


   Normal exit from such
situation is the method of adjustment programs in architecture
computer. If your computer
'128 Th '- it involves a routine, and loading occurs through 
additional pages of RAM (includes background music for 
muzprotsessora, etc.) If your computer is '48-th ', then all

occurs in a different way (eg
such a setting - these are well-known programs such as
"RICK DANGEROUS 2", "SNOW.STREAKER", system shell "CONVER
COMMANDER "Kowalewski and many
others).


   Software to determine the computer architecture may be 
different ways: 

 - Scan the buffer area

   printer for the presence of systemic

   variables for the first '128 ';

 - To try to 'turn' ROM-128

   and take information from it;

 - Write information to address with

   # C000, and then submitting to the system
   dark port byte switching
   pages of RAM, analyzed
   rovat - there was a transition
   conclusion.


   But if you opted for
its "only 128 kilobytes (and such programs have
enough), then at least
screen saver program is:
"128 ONLY".

   Let's talk about "Magik" files in the light of 128 KB.

   If you discard a program that does not use additional pages 
of memory, then this case, the magico-reset does not

differs from the magico-48. If
program that you fold to use additional
page of RAM, in addition to the main file @, are formed on the 
disk files with names @ 0, @ 1, @ 2, @ 3, @ 4, @ 5, @ 6, @ 7 by 
number page. Not everyone, of course, but

only those pages that were involved in the program
(Ie, those which had been kakayato information at the time of 
discharge). 

   These files always have the length
# 4000 (16384) and a starting address
# C000 (49152). Also reset the file named '@ 8' - is
file that contains a page
additional video RAM.

   The main file with the name '@' -
a workspace with computer
addresses # 4000 to # FFFF (as in
normal magico-file).

   Run magico-assembly with a simple command "GO TO" has not 
come out. To start you will be you must first download

files to the appropriate page, and then the command "GO TO"
run the main file.

   Suppose that after clicking Magika you have the disk formed 
following files: 


       @ - Main file

       @ 1 - 1-st page

       @ 7 - 7-I stranitsa


   Then running in BASIC MAGIKsborki may have the following
form:

10 CLEAR 32767
20 POKE 23388,7 +16

       (Including the page 7 and the main ROM)
30 RANDOMIZE USR 15619: REM: LOAD "@ 7" CODE

       (Download page 7)
20 POKE 23388,1 +16

       (Including a page 1 and the main ROM)
30 RANDOMIZE USR 15619: REM: LOAD "@ a" CODE

       (Download page 1)
20 POKE 23388,16

       (Including page 0 and the main ROM)
30 RANDOMIZE USR 15619: REM: GOTO "@" CODE

       (Download and run the main file)


   All files magico-assembly can
rename and give them other
names, not forgetting, of course, what file belongs to which 
page of RAM. And, naturally, do not forget that a program 
running in the second interruption, should be in the name of 
the main Magico-file first character '$'!



   Finally, we present a table of all system variables
"128 th" computer.


        System variables Sinclair ZX Spectrum 128


    HEX DEC len / name APPOINTMENT


    5B00 23296 1920 SWAP paging routine

    5B14 23316 9 AYOUNGER paging routine

    5B1D 23325 1918 ONERR paging routine

    5B2F 23343 5 PIN Sub input RS232

    5B54 23 348 22 Sub-output POUT tags

                                                     RS232

                                Can be used to circumvent

                                 filter package management

    1914 5B4A 23370 POUT2 Sub output symbol

                                                     RS232

    5B58 23384 2 TARGET Address routines in ROM-1

    5B5A 23386 2 RETADR return address in the ROM-0

    5B5C 23388 BANKM a copy of the last byte

                                 O bank

    5B5D 23,389 a RAMRST Team RST 8

    5B5E 23390 RAMERR an error number ROM-1

    5B5F 23391 2 BAUD RS232: between bits in

                                       T-sostoyanii/26

    5B61 23393 2 SEREL Flag return 2-th character

                                 and data

    5B63 23,395 1 COL Current column from 1 to

                                 width

    5B64 23396 1 WIDTH column width of paper

    5B65 23397 TVPARS a number of parameters in a row

                                 expected RS232

    5B66 23398 1 FLAGS3 Various flags

    5B67 23399 1910 NSTR1 Filename

    5B71 23409 1 HD00 file type code

    5B72 23410 2 HD0B block length

    5B74 23412 2 HD0D Start Block

    5B76 23414 2 HD0F length of the program

    5B78 23416 2 HD11 line number

    5B7A 23418 1 SC00 second set - type code

                                                  File

    5B7B 23419 2 SC08 second set - the length of the block

    5B7D 23421 2 SC0D second set - the beginning of the block

    5B7F 23423 2 SC0F second set - the length of

                                                program

    5B81 23425 2 OLDSP old SP, when used
                                  is T TACK

    5B83 23427 2 SFNEXT pointer to the first blank

                                 login directory

    5B85 23429 3 SPSPACE number of bytes left

                                                 (17 bits)

    5B88 23432 1 ROW01 Flags tablet and the image

                                 series 1

    5B89 23433 1 ROW23 the rows 2 and 3 of the keyboard
                                 Tours

    5B8A 23,434 a ROW45 Series 4 and 5 of the keyboard

    5B8B 23435 2 SYNRET return address for ONERR

    5B8D 23437 5 LASTV last value napecha
                                tannoe calculator

    5B92 23442 2 RNLINE currently memorized line

    5B94 23444 2 RNFIRST line number for the beginning

                                 RENUMBER

    5B96 23446 2 RNSTEP value increment

                                 RENUMBER

    5B98 23448 8 STRIP1 Map bit of band 1

    5BA0 23456 8 STRIP2 Map bit of band 2

    5BFF 23,551 XX TSTASK temporary stack grows

                                 down from here



           *







Other articles:

TR-DOS for beginners - The end.

Computer novella - Prince of Persia.

Computer novella - Laser team (the game Laser Squad).

Crossing Dragon - Game Rapscallion.

Crossing Dragon - Playing The Runes of Zendos.

Crossing Dragon - Playing The Saga.

Crossing Dragon - Game Witch's Cauldron.

Crossing Dragon - Create Adventyuru. Review of the editors.

Crossing Dragon - Create a dictionary to Adventyurnoy game.

Program, which we choose - The possible consequences of using undocumented commands.

Program, which we choose - About noticed irregularities in some programs and suggestions for future versions.

Program, which we choose - A proposal to all the authors of software, printers, memory dump. Programmers protect discs from being copied.

Program, which we choose - A few suggestions to improve the assembly.

Program, which we choose - Suggestions for refining ZX Word v2.5.

Program, which we choose - The "Spectrum emulator" v1.2.

Program, which we choose - What could want in a perfect assembly.

Retro - 40 best procedures: Copying data in memory.

Retro - 40 best procedures: Exchange token.

Retro - 40 best procedures: Determination addresses BASIC string.

Retro - 40 best procedures: Determination of the length of BASIC programs.

Retro - 40 best procedures: Determination of the amount of free memory.

Retro - 40 best procedures for: Search and replace strings.

Retro - 40 best procedure: Find the string.

Retro - 40 best procedures: Search for the string.

Retro - 40 best procedures: the list of variables.

Retro - 40 best procedures: an increase and up the screen.

Retro - 40 best treatments: Removal of REM-strings.

Retro - 40 best procedures: Remove the block of the program.

Expert Tips - Game Fredloader.

Expert Tips - Game Robin of Sherwood: The Touchstones of Rhianon.

Expert Tips - Game Scorpions: Die Machines.

Expert Tips - Game Terropods.

page iS-DOS - Description of system restarts IS DOS.

Forum - An algorithm for recognizing characters.

Forum - Time undocumented command processor Z80.

Forum - The concept of a high-color screen resolution.

Forum - A few Pokes to a game. Program Hacman96.

Forum - As for the new DOS and BIOS settings for the Spectrum.

Forum - Multicolor program on any computer model. Using the 2 nd screen Multicolor'a. Demonstration of the text. Electronic journals.

Forum - Project ZX Config.

Forum - Improve Art Studio. Ideas on file compression.

Forum - ZX Spectrum emulator for IBM. About the hexadecimal system. Program ZX-Stars. Oddities in the Elita

Forum - The effects on the curb and Multicolor.

reader-reader - ZX Spectrum 128 - new opportunities, new challenges.

reader-reader - With 'Light'. Spectrum and expert system.

reader-reader - The printer driver for the Scorpion.

reader-reader - Print numbers in different number systems.

reader-reader - Programming arcade game with scrolling screen.

reader-reader - The procedure for printing labels assembler XAS to monitor debugger STS 4.3.

Studies - attribute scrolling text. "Gasilka" screen. A simplified version of the procedure, "Curtain". Procedure is enriched with pictures. Procedure display images on the points.

Studies - Graphic effect "color bars".

Studies - Driver screen printing 64 characters per line.

Studies - Set of protective boot.

Studies - Address to the drive mode IM 2. Working with non-standard disc format.

Studies - Print the character, magnified by 8 times. The program "pouring" screen. The procedure for screen-saver on the points. Clear screen in Terminator'e. Search strings in memory. System character set conversion.

Studies - Program - cataloger of disks.

Studies - Program the output values of the amplitude channel music. coprocessor on the curb.

Studies - Program the output image.

Studies - The program plugs sprite.

Studies - Cleanup of the specified window screen.

Studies - The program sort the array in ascending order. The procedure for filling the screen specified attribute. Procedure display pictures. The effect of moving towards the stars. "Shower", coming from the upper left corner of the screen. The procedure of "shedding" pictures on the pixel lines. The program of "pulling" the picture at an angle of 45 degrees. Three procedures "Scroll".

Studies - The printing of numbers.

Studies - The procedure for drawing a character with attributes.

Studies - The procedure for display pictures. Fade-OUT effect (picture goes beyond the edge of the screen). Visual effect "Fountain." Fade-OUT effect, mimicking the TV off. Procedure "Ignition" pictures. The program continuously drawing a picture.

Studies - The procedure for drawing a line.

Studies - The procedure for making optimal symbol table.

Studies - scrolling lines of text in the specified window. Attribute scroller. Diagonal scrolling.

Studies - sprite scroller. Procedure display screen.

Studies - Short procedure indicating the amplitude channel music. coprocessor. Way to subtract a constant from a register pair HL.

Studies - The formula for calculating the day of the week.


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

Similar articles:
Demo scene - an overview of the demos with raww.orgy 2007.

В этот день...   2 May