ZX Club #05
29 октября 1997

ZX-Potpourri - The procedure "OPTION SELECTOR". On the procedure of "Stars" as used in the newspaper.

<b>ZX-Potpourri</b> - The procedure
                TABLE OF CONTENTS

article counter down

Opening Remarks .................... 000
Option Selector ........................ 053
Stars-2 ............................... 312



   Opening the section "ZX Potpourri", like
to remind readers about the concept of the newspaper, the very 
title of which expresses the idea association.



   If Barnaul lovers Spectrum
No club, embodied in a specific room with a postal and legal 
addresses, this does not mean that they have absolutely no way 
to communicate. To share with all their problems, thoughts, 
work can be, for example, through electronic newspaper 
"ZX-club"! Published material may generate a library

response, and this is - the opinion of colleagues, feedback. 
Also: the newspaper is not refuses to publish the private ads 
are submitted in electronic form can be far more spectacular 
than in the printed version (and where - for free). 


   Since the determinant is the club's plan organization, it 
would be illogical do not look for opportunities to enhance 
communication in general and club activities - in particular. 
About two months ago I wrote in Ulan-Ude Stas Rubtsov (95 / 2, 
p.5) and Yaroslavl, Alexei Kozhevnikov (96/7-8,

p.64), but the response has not yet been received.
True, and newspapers (in today's form of it)
while there was not even in the plan, and about
Club thought dimly. In the middle
September a letter was sent to pos.Murmashi Murmansk region. 
(95 / 2, p.20). If comes the answer - our information space 
will become a little wider ... 


   And of course, "ZX Potpourri, by definition, involves the 
publication of materials "From all operas", but - combined 
leitmotif. 



             OPTION SELECTOR


   The reason for writing this article was the same motif, 
expanded during "Opening speech". As the author

procedure, OS, Anton Sidorenko, is
member, the address to which the message was sent, then I 
wanted to show the work of Choice Options in this section. 
However - to no avail. In the process of forming partition 
always something rejected, propose another, but it turned out - 
The third. Commonplace. 


   And yet, showing a minimal honesty, I looked at numbers for 
the ZX-Review '95 - '96 Years and found that this theme - the 
organization of the menu - wrongly paid little attention. Of 
course, for experienced coders organize unpretentious "menu" is 
not difficult. Yes, experienced and do not engage in such 
"trifles"; pull-down, arrow, mouse - is quite another

case. And where are the poor "teapot" go?
And continue: Press <1> <2> <3>? ..


   Thus, the lists:

1. OS Sidorenko. - 95 / 2, pp.16-19.


   Shows the assembly code, the hex dump of the code block and 
detailed Comments Inforkom. After spending some

efforts and using material from
ZX FORUM 1 +2, p.115, this procedure
will benefit from even the most novice user, learn BASIC.
And predolev all arising in the course of
of obstacles (and published material, it is sufficient), 
"teapot" without knowing, will become a user.


2. OS A. Eponchintsev. - 96/7-8, p.72-73.


   To use this procedure
need to start with, learn to work with some assembler.

3. Vladimir Savchenko. Multi-window interface.

   The procedure of "Select". - 96/7-8, p.88-91.


   With the above in the article procedures, you can organize 
in Multi from BASIC menu. But this requires have skills in 
meaningful work with assembly code. 


   In addition to Article VI Savchenko novice programmers can 
rekomendovat program "Windows" (C) Uglekov KV '92g.


   The program is distributed in Inforkom
system diskette with the code CD6.


   What is the conclusion? If we exclude the procedure 
Sidorenko, the conclusion is clear: master the assembler. And 
I, for example, are known sincere adherents of the Spectrum, to 
take a principled position: inappropriate language enthusiasts 
to learn Professionals. Ready to use computer codes to BASIC 
program - still all right, but their own "travel to the 
processor" - sorry. 


   So, bearing in mind "to help amateurs
DO NOT want to overcome , we give below another
procedure for organizing a menu to fit
comparable to the procedure A. Eponchintseva. In
the rest (denoted by the parameters, methods of use, etc.). we 
tried to maintain compliance with procedure A. Sidorenko.




      Procedure, found the tram

Barnaul (C) mr.X '97

00010 ORG 40000
00020 ENT

00030 LD A, (NUMB)
00040 LD HL, (COOR)

00050 LD A, H; procedure
00060 ADD HL, HL; calculation
00070 ADD HL, HL; address
00080 ADD HL, HL; in the file
00090 LD H, 22; attributes
00100 ADD HL, HL; of origin
00110 ADD HL, HL; (C) D. Anisimov
00120 ADD A, L; city Kirov 1996
00130 LD L, A; ZX-Review 96/7-8

00140 LD (ATTR), HL
00150 LAB1 LD A, (MCLR)
00160 CALL LAB7
00170 LAB2 EI
00180 RES 5, (IY +1)
00190 LAB3 BIT 5, (IY +1)
00200 JR Z, LAB3
00210 LD A, (23560)
00220 LD HL, (ATTR)
00230 LD DE, 32
00240 LD BC, NUMB
00250 CP "9
00260 JR Z, LAB6
00270 CP "8
00280 JR Z, LAB4
00290 CP "0
00300 JR Z, LAB9
00310 JR LAB2
00320 LAB4 LD A, (BC)
00330 PUSH BC
00340 LD C, A
00350 LD A, (NLIN)
00360 CP C
00370 LD A, C
00380 POP BC
00390 JR Z, LAB2
00 400 INC A
00410 ADD HL, DE
00420 LAB5 LD (BC), A
00430 LD A, (RCLR)
00440 CALL LAB7
00450 LD (ATTR), HL
00460 JR LAB1
00470 LAB6 LD A, (BC)
00480 CP 1
00490 JR Z, LAB2
00500 DEC A
00510 SBC HL, DE
00520 JR LAB5
00530 LAB7 PUSH HL
00540 LD HL, (ATTR)
00550 PUSH AF
00560 LD A, (WLIN)
00570 LD B, A
00580 POP AF
00590 LAB8 LD (HL), A
00600 INC HL
00610 DJNZ LAB8
00620 POP HL
00630 RET
00640 LAB9 LD A, (BC)
00650 PUSH AF
00660 LD B, 10
00670 LAB10 PUSH BC
00680 LD A, (RCLR)
00690 CALL LAB7
00700 HALT
00710 LD A, (MCLR)
00720 CALL LAB7
00730 HALT
00740 POP BC
00750 DJNZ LAB10
00760 POP AF
00770 LD B, 0
00780 LD C, A
00790 RET

00800 NUMB DB # 01; option number
00810 ATTR DW # 0000 address in the file

                        ; Attributes
00820 COOR DW # 0101; row / column
00830 MCLR DB 8 * 0 +7; selection options
00840 RCLR DB 8 * 7 0, 8 * PAPER + INK
00850 WLIN DB 15, the width of the cursor
00860 NLIN DB 4; number of options


   Conflicts between a procedure, but special
problem, in our opinion, this is not. With the directive ORG 
Source program text, you can specify any start address (Start) 
of the object code. 


  As a result of the program - number of selected (selected) 
option - is stored in Start +141 (NUMB), before running the 
program, This cell must be restored

value # 01: POKE Start +141,1.



   Hex dump of the code block:


   9C40: 3A CC 9C 2A CF 9C 7C 29: B8

   9C48: 29 29 26 16 29 29 85 6F: B8

   9C50: 1922 CD 9C 3A D1 9C CD A1: 8C

   9C58: 9C FB FD CB 01 AE FD CB: CA

   9C60: 01 6E 28 FA 3A 08 5C 2A: 55

   9C68: CD 9C 20 November 2000 01 CC 9C: 07

   9C70: FE 39 28 FE 23 38 June 28: F2

   9C78: FE 30 28 35 18 DB 0A C5: 61

   9C80: 4F 3A D4 9C B9 79 C1 28: 30

   9C88: D0 3C 19 February 3A D2 9C CD: C0

   9C90: A1 9C 22 CD 9C 18 BC 0A: D2

   9C98: FE January 28 BD 3D ED 52 18: AC

   9CAO: EA E5 2A CD 9C F5 3A D3: A0

   9CA8: 9C F1 47 77 Oct. 23 FC E1: 9F

   9CB0: C9 0A F5 06 0A C5 3A D2: F5

   9CB8: 9C CD A1 9C 76 3A D1 9C: 17

   9CC0: CD A1 9C 76 C1 10 EE F1: 8C

   9CC8: June 2000 4F C9 01 00 00 01: 84

   9CD0: 1 July 1938 0F 04 00 00 00: BF


   RANDOMIZE USR 15619: REM: SAVE

   "Menu" CODE 40000,149


   Note also that by replacing the Directive
DEFB directives EQU, determine the numerical values ​​mark 
parameters, it is possible to reduce the length of the object 
code bytes to 15. In this case, the program will change 
somewhat. 

.....
00022 MCLR EQU 8 * 0 +7; line
00023 RCLR EQU 8 * 7 +0, with the numbers
00024 WLIN EQU 15, 830-860
00025 NLIN EQU 4; rule
.....
00325 CP NLIN
; Lines 330-380 exclude
, In lines 150, 430, 560, 680, 710
; Command LD A, (label)
, Is replaced by the command LD A, label


   The length of the modified program code block is 134 bytes.


   Informative part of the menu - the name of the options - you 
can draw in any graphics editor. Then, for the organization 
menu located, for example, in the upper segment of the screen 
(the first eight rows) just type:


05 CLEAR Start-1
10 RANDOMIZE USR 15619: REM: LOAD

   "Menu $" CODE 16384,2048
20 RANDOMIZE USR 15619: REM: LOAD

   "Menu" CODE Start
30 POKE Start +141,1
40 LET menu = USR Start: REM menu = 1 ... 24
50 IF menu = ... THEN ...



           The procedure for the Stars-2


   The interesting thing: the majority with whom I
've talked about Barnaul
coder, remember, without exaggeration -
legendary, Grevtseva YV (96/1-2,
p.85-90). Probably every local sinklerist considers it its duty 
to collect this procedure and enjoy the splendor of flare 
stars. So, if you within minutes (eg, following

music) did not touch any key, then
has long been understood everything. That is: "screensaver" 
acting in this issue newspapers, is based on "Stars" Grevtseva.



   Perhaps on this topic written more
Smart and short procedure. I like
study was not engaged and do not know
recent developments. I liked the approach of the author to 
write the procedures: "... all routines used by me .. already

"Lit up" in various publications
INFORKOMA. I dare to hope that this is
help sort out without interference in this
procedure even novice programmers.
All this is an example of how to
general, well-known things you can make
something new. "


   Personally, I is the direction of author
thoughts are impressed. I hope that
This newspaper will reach in any way to Mr. Grevtseva and will 
cause for further, longer distance, dating.


October 4, 1997 SWdZ




Other articles:

From the Editor - the process of creating newspapers joined the group Demention. The question of electronic journal in the Altai.

Soft group - Something about connecting the printer. Ports of computer devices ZX-SPECTRUM.

Iron - On Covox'ah, General Sound'e and Sound Drive 2.

ZX-Potpourri - The procedure "OPTION SELECTOR". On the procedure of "Stars" as used in the newspaper.

Club IM2 - Terminology and theoretical aspects of interrupts and multitasking.

Club IM2 - Competition for the best scenario type games DIZZY.

Virus - On the competition of the game "virus 2.

Enjoy - Jokes ...


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

Similar articles:
Hall of Fame - Irish Stew (demos of programs).
Entry - In Riga at the moment all is 5 modem.
Iron - Wiring a PC connectors "byte", not all contacts in a row, and only needed to Connecting the C-DOS modem.

В этот день...   23 November