Difference between revisions of "83Plus:BCALLs:8048"
From WikiTI
m |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:83Plus:BCALLs:By Name:Math| | + | [[Category:83Plus:BCALLs:By Name:Math:Integer|Div16By8]] [[Category:83Plus:BCALLs:By Name:Math|Div16By8]] [[Category:83Plus:BCALLs:By Name|Div16By8]] [[Category:83Plus:BCALLs:By Address|8048 - Div16By8]] |
− | [[Category:83Plus:BCALLs:By Name| | + | |
− | [[Category:83Plus:BCALLs:By Address|8048 - | + | |
== Synopsis == | == Synopsis == | ||
− | '''Official Name:''' DivHLbyE | + | '''Official Name:''' Div16By8 |
+ | |||
+ | '''Other Name:''' DivHLbyE | ||
'''BCALL Address:''' 8048 | '''BCALL Address:''' 8048 | ||
− | Divides register HL by register E and stores the result in DE. | + | Divides register HL by register E and stores the result in DE and the remainder in HL. |
=== Inputs === | === Inputs === | ||
* HL = numerator | * HL = numerator | ||
− | * | + | * E = denominator |
<!-- We need to figure out how we're doing flags and link that up --> | <!-- We need to figure out how we're doing flags and link that up --> | ||
=== Outputs === | === Outputs === | ||
− | * DE = HL / | + | * DE = HL / E |
+ | * HL = HL % E | ||
=== Destroys === | === Destroys === | ||
− | * | + | * A, IX, HL, DE |
* Contents of memory addresses 8251h - 8253h | * Contents of memory addresses 8251h - 8253h | ||
Line 27: | Line 28: | ||
ld hl,103h | ld hl,103h | ||
ld e,3 | ld e,3 | ||
− | B_CALL DivHLbyE ;should return 56h | + | B_CALL DivHLbyE ;should return DE=56h and HL=1 |
Latest revision as of 20:30, 29 March 2005
Synopsis
Official Name: Div16By8
Other Name: DivHLbyE
BCALL Address: 8048
Divides register HL by register E and stores the result in DE and the remainder in HL.
Inputs
- HL = numerator
- E = denominator
Outputs
- DE = HL / E
- HL = HL % E
Destroys
- A, IX, HL, DE
- Contents of memory addresses 8251h - 8253h
Comments
Simple enough to implement yourself if speed is important.
Example
ld hl,103h ld e,3 B_CALL DivHLbyE ;should return DE=56h and HL=1