A86: Sorry Dux. =-|


[Prev][Next][Index][Thread]

A86: Sorry Dux. =-|




I have very few ideas of my own but I can easily take
someone elses theory, routine or whatever and make it
better.  Sorry in advance Dux.  I took his Russian
Peasant algorithm and made it better...voila.

;African Swallow Algorithm_________________________
;Input: de * b                                    |
;Output: hl                                       |
;Destroys: af, b, de, hl                          |
;Size: 15 bytes                                   |
;--------------------------------------------------
ASMult:
	xor a           ;stylish way to clear a
	ld hl, $0000    ;most stylish way to clear hl...bummer
ASMultLp:
	srl b           ;check bit
	jp nc, ASkipadd ;if bit = 1 then hl + de
	add hl, de      ;add'm up
ASkipadd:
	add hl, hl      ;mult hl by 2
	jp nz, ASMultLp ;if b != 0 then keep going
	ret z           ;ret if b = 0

-- 
Tercero	 --  Email: mailto:tercero@busprod.com

"The stone the builders rejected has become the capstone;"
			--Psalms 118:22
"Everyone who falls on that stone will be broken to pieces,
but he on whom it falls will be crushed."
			--Luke 20:18


Follow-Ups: