mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 05:38:06 +11:00
16 lines
404 B
Plaintext
16 lines
404 B
Plaintext
( Borrowed from http://wikiti.brandonw.net/ )
|
|
( Divides AC by DE and places the quotient in AC and the
|
|
remainder in HL )
|
|
CODE /MOD EXX, ( protect BC )
|
|
DE POP, BC POP, chkPS,
|
|
A B LDrr, B 16 LDri,
|
|
HL 0 LDdi,
|
|
BEGIN,
|
|
SCF, C RL, RLA,
|
|
HL ADCHLd, DE SBCHLd,
|
|
IFC, DE ADDHLd, C DECr, THEN,
|
|
DJNZ, AGAIN,
|
|
B A LDrr,
|
|
HL PUSH, BC PUSH,
|
|
EXX, ( unprotect BC ) ;CODE
|