Voyager #03
19 октября 1998

Laboratory - The algorithm of division and multiplication of large numbers.

<b>Laboratory</b> - The algorithm of division and multiplication of large numbers.
                 *



     The second program (or rather two of them) implements
fast algorithms for division and multiplication of large 
numbers. On this basis, it is easy to write the p / n decimal 
numbers in the registers (the conversion line in number).


Designation:


MUL_HLBC_DE: Registers HLBC = HLBC * DE


DIV_HLBC_DE: Registers HLBC = HLBC / DE



     Entry point MUL16 and DIV16, as follows from
names, perform the multiplication and division of 16-bit
numbers. And, if multiplied by 16 bits at 16, then
result is 32 bits.

;====================================
, 16-BIT MULTIPLY
;====================================
MUL16: LD HL, 0
MUL_HLBC_DE:

        LD A, B

        LD B, 11H

        JR L4928
L4921: JR NC, L4924

        ADD HL, DE
L4924: RR H

        RR L
L4928: RRA

        RR C

        DJNZ L4921

        LD B, A

        RET
;====================================
, 16-BIT DIVIDE
;====================================
DIV16: LD HL, 0
DIV_HLBC_DE:

        LD A, B

        LD B, 10H

        RL C

        RLA
L493B: RL L

        RL H

        JR C, L494E

        SBC HL, DE

        JR NC, L4946

        ADD HL, DE
L4946: CCF
L4947: RL C

        RLA

        DJNZ L493B

        LD B, A

        RET
L494E: OR A

        SBC HL, DE

        JR L4947



                 *



     Well, like it is all for today. Yes, a little
do not forget: all these applets written somewhere in the
1983 was none other than Tim Paterson, author of MSX-DOS
and the first version of MS-DOS. Such are the things ...






Other articles:

Inform - The plans of the magazine.

Authors - The authors of the journal and editorial contacts.

Inform - Guide magazine.

Locman - On the game SubSunk.

Locman - Game Description DARK SIDE.

loafer - Complete walkthrough MIRROR.

Kaleidoscope - On the game Star Dust roads.

Kaleidoscope - On the second virtual computer art festival Art Comp-99.

Kaleidoscope - The presentation of text utilities - Text Utility V2.8i.

Skeleton - Description of the sound card DMA SOUND.

Skeleton - an undocumented feature of the processor Z80.

History - Life After Willie. Softografiya Matthew Smith.

History - On fidoshnom slang.

Laboratory - Intro POORGUY! - Inside (original text with commentaries).

Laboratory - ZX-SPECTRUM and operating systems.

Laboratory - Procedures from MicroSoft.

Laboratory - The algorithm output decimal numbers on the screen from the register of DE & HL.

Laboratory - The algorithm of division and multiplication of large numbers.

PROFI CLUB - Studying CP / M (compatibility, processors, terminals).

Humor - Ladder - advice to competent user.

Humor - Verse "OA programmers.

Mail - Letters from readers in the magazine.

Advertising - Advertisements and announcements ...

ZXTraders - Deystvyyuschie distributors software ZX Spectrum in Russia and Ukraine


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

Similar articles:
Advertising - advertising and announcements.
Presentation - Presentation of new magazines: Oberon 2, Spectrofon 21.

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