83Plus:BCALLs:804B

From WikiTI
Revision as of 21:31, 29 March 2005 by FloppusMaximus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Synopsis

Official Name: Divide16By16

Other Name: DivHLbyDE

BCALL Address: 804B

Divides register HL by register DE and stores the result in DE and the remainder in HL.

Inputs

  • HL = numerator
  • DE = denominator

Outputs

  • DE = HL / DE
  • HL = HL % DE

Destroys

  • A, IX, HL, DE
  • Contents of memory addresses 8251h - 8253h

Comments

Simple enough to implement yourself if speed is important.

Example

 ld     hl,A1Dh
 ld     de,103h
 B_CALL DivHLbyDE  ;should return DE=9 HL=102h