KrNews #05
24 июля 1998

Coder - Procedures for rapid cell division and multiplication.

<b>Coder</b> - Procedures for rapid cell division and multiplication.
   3) ZX REVIEW has been the procedure of division
badly non-optimal (I have a suspicion
that the one who sent it just copied it
from the book on what a i-8085, not
using additional commands Z-80).

   In DE - dividend, in C - divider
result in HL, the remainder in A.



       ; DIVIDE DE / C = HL


       ORG 40000

       ENT

       LD DE, 768

       LD C, 3

       CALL DIV

       RET

DIV LD B, 16

       LD HL, 0

       LD A, H
DV1 RL E

       RL D

       RLA

       SUB C

       JR NC, DV2

       ADD A, C
DV2 CCF

       RL L

       RL H

       DJNZ DV1

       RET



   4) The point from the same place, at 1.51 times
faster and at less bytes.


             Multiplicand-D

             factor - E

             result - DE


   ; MULTIPLY DxE = DE; 0 <= result <65535


      ORG 40000

      ENT

      LD DE, # FEFF

      CALL MULT

      RET

MULT XOR A

      LD B, 8
MU1 RRA

      RR E

      JR NC, MU0

      ADD A, D
MU0 DJNZ MU1

      RRA

      RR E

      LD D, A

      RET





Other articles:

INTRO - Passed "Programmer's Day".

Event - appeared out in the INTERNET.

BBS-File - log XTR-MODEM/BBS v156!

SCENERGY - Profile of the journal SCENERGY.

Playing - Tips for passing games: Escape to Harhan, Stalker.

Ferrum! - scheme modem KrVicomm v1.0.

Ferrum! - The scheme to remove the modem Vic tube.

Ferrum! - How to get a good connection with the BBS.

Coder - Quick procedure point.

Coder - The exchange of the two memory areas.

Coder - Procedures for rapid cell division and multiplication.

Authors - the authors.

INCOMING - Description of the features of the game DAEMON.

MUZAKING - Music skeleton.

KrZxNet - On KrZxNet addressing.

P-Net - Open the node and hub P-Net.

Letters - Feedback from readers of the newspaper.

Talents - The lyrics "If you want PyTsy.

Talents - Russian Radio 101.8 FM.

Talents - dough on a computer from BLAZ'a.

PS - Post Scriptum - about changes in this version of the shell.

NEW GAME - The presentation of the game MIRROR.

Advertising - Advertisements and announcements ...


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

Similar articles:
Presentation - Fantastic detective game "Star Heritage".
Mosaic - ZX-Shadow of BBS'kah. Passwords for the game "Magic Stripes".
Scene - Insanity Zer0: "Real demomeykerov the history of the Spectrum - no more than a dozen names, at a stretch be called twenty! Geymemykerov - More less ... "

В этот день...   30 April