Adventurer #09
30 апреля 1999

Exchange of experience - Rapid procedure for finding the root of the number and Testing Kempston-port of SerzhSoft'a.

<b>Exchange of experience</b> - Rapid procedure for finding the root of the number and Testing Kempston-port of SerzhSoft'a.
     (C) SerzhSoft


         A couple of words about sore


               And you and your ear does not blink ...



     I write these lines in the park the wild,
so read accordingly! -) Time really is very little ... : - 
(Sessiya! - ( 


     You may have already met with me
log Kemerovo pages Deja
Vu, in the section "CODING", of course ...
For a long time I sent my article only
in this magazine and in vain! : -) For printed
they are not at the highest level: that part of the article
somewhere lost, the source, and sometimes -
contrary to the log placed sources, and
Article disappeared in an unknown direction; listings for the 
64-character format turned into a miserable 42-character, etc.

etc: - (Yes, and in the magazine itself has long
time used my library of survey keyboard and joysticks + motion
arrows without attribution ... All
is gradually flooded the bowl of my
patience, which led to what we
met on the pages of other publications ...

     Thus, in the fifth issue of Deja Vu Again
There was garbage in my articles - were
published only source programs, and
the articles themselves have gone to # @% in ... They were 
written were still in June, during the summer session,

and still did not come to light!

     So, this: a note about the sinuses, the article
attribute of the rotational and iskazhalku
article about the Olympiad problems ...


     Now let's talk about the article
Cardinal 'and in the sixth issue of ... I did not
thought that someone have "root
problems! "The most simple and fast procedure for finding the 
root of the number specified in HL:


SQR_HL

        LD BC, # 0040; <10>

        LD A, H; <4>

        OR A; <4>

        JR Z, GO_SQR; <12 / 7>

        LD A, L; <4>

        LD L, H; <4>

        LD H, B; <4>
;

        DUP 4; BEGIN 4

        SBC HL, BC; <15>

        JR NC, $ +3; <12 / 7>}

        ADD HL, BC; <11>} 12/18

        CCF; <4>

        RL B; <8>

        ADD A, A; <4>

        ADC HL, HL; <11>

        ADD A, A; <4>

        ADC HL, HL; <15>

        EDUP; END} 292 .. 316
;
GO_SQR DUP 4; BEGIN 4

        SBC HL, BC; <15>

        JR NC, $ +3; <12 / 7>}

        ADD HL, BC; <11>} 12/18

        CCF; <4>

        RL B; <8>

        ADD HL, HL; <11>

        ADD HL, HL; <11>

        EDUP; END} 244 .. 268
;

        LD L, B; <4>

        LD H, A; <4>} 294 .. 629

        RET


     If the number from which you remove the root, less than 
256 (ie, high byte is equal to 0), execution time is

from 294 to 318 strokes, otherwise - from 581 till
629 cycles. RET command is ignored
since you can put this whole piece of code directly into any
procedure ... -) Use registers
HL, BC, AF. The result of catch in the HL, and
H = 0, of course! Or see Register B -
There is also a root. : -) Battery reset.

     By the way, Cardinal - boy, that
drew attention to a typographical error in protsedurke switch 
pages ... Well, where else OUT (C), A and LD (BANK_M), A were 
mixed up ... Of course, the first port value must be maintained 
in the cell and only then displayed in the port itself! In the 
source code, then it was all right, but when I typed the text 
of the article in the ZX-WORD 's (As of now, in a wild rush!), 
Then slipped past this unfortunate inaccuracy ...


     A spinner sprites if you want you can do before the fast, 
which is turning a sprite the size of the screen is wasted no 
more than a few seconds! If you want to - I write - as ... -)


     Recently, many electronic media (newspapers, magazines ...)
used Kempston Mouse ... But some comrades forget to test 
hardware for the presence thereof, bells and whistles! As a 
result, hang, buggy, or simply "dropped"! : - (And therefore I 
present the process of verifying your computer for your mouse 
(And the joystick at the same time!). When buggy bus mouse data 
safely "cuts off", and not "is" as some ... -)


;------------------------------------------------- -----------;
; KEMPSTON PORT TESTER (K. MOUSE 'K. JOYSTICK);
; Written by Kolotov Sergey (c) SerzhSoft, 1998;
;------------------------------------------------- -----------;
 TST_KMS

         LD BC, # FADF; k.mouse port

         LD HL, # 0000; begin: mouse, joystick present

         LD D, # 09; time of testing
 LP_TKMS IN A, (C)

         INC A

         OR L

         LD L, A

         IN A, (# 1F); k.joystick port

         AND # 1F

         OR H

         LD H, A

         DEC DE

         LD A, D

         DEC A

         JR NZ, LP_TKMS

         OR L

         JR NZ, NO_MOUS

         INC B; # FB

         IN A, (C)

         CP E; A = # FF?

         LD A, D; # 01 - yes_ms

         JR NZ, ON_MOUS

         LD B, E; # FF

         IN A, (C)

         CP E; A = # FF?

         LD A, D; # 01 - yes_ms

         JR NZ, ON_MOUS
 NO_MOUS XOR A; # 00 - no_ms
 ON_MOUS LD (MOUSEFL), A; 0 - no mouse / 1 - yes mouse

         LD A, H

         OR A

         LD A, D; # 01 - yes_km

         JR Z, ON_KMPS
 NO_KMPS XOR A; # 00 - no_km
 ON_KMPS LD (KEMPSFL), A; 0-no joystick / 1-yes joystick

         RET
;------------------------------------------------- -----------;



     Example of using the mouse you can
found in the appendix - a file CURSORLB.C.
It can be compiled in any
Assembler (best in the ZX-ASM 's!)
pre-translated into a format that
assembly from the text states, in
Do this file now resides ... In
you end up with an updated and extensive library of survey 
administration and Kempston Mouse, the first time in 
upublikovannuyu ZX-REVIEW ...



     Okay, I'll call it a day ... Yes,
I almost forgot! Editor in chief of Deja Vu
cruelly "slaughtered" a new hatch section devoted to fantasy and
fantastic! : - (I was against it ... But if
readers write that it is necessary, then I
sure that the topic be reborn! Main
send their "top ten" of domestic and foreign fiction ...

     Bye!

                        With best wishes,

                                   Serzh.


     P.S. FunTop98 - rulez! I dragged!

     P.P.S. Big hello to all your friends!


        My address is:

641800, Kurgan region.,

        Mr. Shadrinsk,

        st. Karl Liebknecht, 27, Apt. 1

        Kolotova Sergei Sergeyevich


     E-mail: lonewolf@zaural.ru

             subj: to SerzhSoft.






Other articles:

From the authors - The authors of the magazine.

From the authors - Adventurer - the section of the popular magazines heritage.

Presentation - A new program for collecting tunes: UniPlayer v1.0

Presentation - a new graphical editor 3Color Studio.

Presentation - an unusual boot: Program Box version 2.0

Presentation - a new quest: Full Shit.

Presentation - a level editor for games Raven Black: Black Raven Editor v1.0

Presentation - the new editor for digital music: EARACHE v1.0

Interface - Letters from readers: Dawid Willis, Ivan Roshchin, Cav Inc. (Competition for the best name for your sound card, glitches in HRUST v1.0 and XAS v9.06 +)

Interface - How do we (CPU) were FunTop'e.

Interface - Opinion: on acquaintance with the PC.

Interface - branded cheats for the games: Midnight Resistance, Chase HQ2, Havoc, Turbo Girl, Fast Bredd, Turbo Boat.

System - An overview of new sistemok: Sprite Maker v4.0, Turbo Copier v2.0, Sample Studio, Art Works 1, Burst Eyes v1.2, Excess Sample Editor v1.4.25, Excess Deluxe Paint v1.1, Graphic Station, BA v1.0, Global Commander v1.31, Quick Commander v2.3, Stall Spriter v0.1, AGA v1.0, Ultra Sonic v0.1, Universal Sprite Studio v1.0, HRUST v1.1, STORM v1.3.

Review - Overview of gaming innovations: Leprekon, Fuck Communistov, Sherwood, GOAT, Kill PC 2, Chainick: Horror in the flat.

Review - Review of the demos: Black Raven 2 v0.000, Crime Santa Clause Deja VU, Awaken, Japan Crossword, Pussy: Love story from Titanic.

Guests - An Interview with Nicodim'om from Yaroslavl (the author of Prince of Persia and the Pirates).

Guests - An interview with a group of Rybinsk Expirience (authors kvecta Full Shit).

Guests - CPU on the life and future plans.

Promotion - A strategy game: Sword OF Bane.

Promotion - parsing the game of Rock Star: Rock Star ate my Hamster.

Exchange of experience - Rapid procedure for finding the root of the number and Testing Kempston-port of SerzhSoft'a.

Exchange of experience - The procedure for generating sine.

Exchange of experience - spinner - izvraschalka (Zoom Rotator).

Exchange of experience - SerzhSoft'a report on the regional Olympiad in Informatics in 1998.

Exchange of experience - TR-DOS: the disk included with interrupts.

Ottyag - 23 things you can do with the program hanging. Symbols - grimassy in the program notes. 20 things you can do if ochen want to drink, but you have no money. Verse of the monk.

Ottyag - Competition test: Test: What you need a computer? Test for the Communists. Test: Can I rely on you? Quiz: Who are you Spektrumist? (User or lamer).

Ottyag - Terminator 3 sleigh day (or the truth again, somewhere in there).

Iron - Sound card with direct access to: DMA Sound Card (description schemes and programming).

News - News from local groups: Volume 4, Groboclone, Surdakar, Di-Tech Labs, Auryn, Rainbow Dreams, Experience.

Advertising - advertising and announcements from spektrumistov.


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

Similar articles:
Presentation - On the game genre Adventure - Robin of Sherlock.
Tusovka - Greetings and remarks: S. Kuksin, K. Fes'kov, V. Anshukov.
Our Guest - the memoirs of Vladimir spektrumista - Astral.
News - is nearing the end of the work to create CD-ROM.
Iron - IBM PC Keyboard (Part 2).

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