home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
utils
/
asmutl
/
buffers.lbr
/
DTEN.MZC
/
DTEN.MAC
Wrap
Text File
|
1987-01-14
|
512b
|
21 lines
;
; divide unsigned integer (hl) by 10
; remainder appears in (a) with flags set
; a,f,h,l
.dten:: push b; save bc
lxi b,0f00ah; c=divisor=10; b=iter.cnt=-16
xra a; clear
dten1: dad h
ral; shift off into (a)
cmp c; test
jc dten2; no bit
sub c; bit=1
inx h
dten2: inr b; done?
jm dten1; no
ora a; set flags for rdr., clear carry
pop b; restore
ret
end
rz