DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦125843ab2⟧ TextFile

    Length: 633 (0x279)
    Types: TextFile
    Notes: UNIX file
    Names: »dtof.s«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »libc/crt/dtof.s« 

TextFile

	.globl	fdpack

/ convert double in rq0  to  float in rr0

fdpack:
	sub	r3, r3
	rl	r2
	rlc	r1
	rlc	r0
	rrc	r3	/ save sign

	sub	r0, $[1022-126]*32	/ adjust bias
	jr	pl, 0f

	subl	rr0, rr0  / exponent underflow
	ret
0:
	cp	r0, $256*32
	jr	ult, 0f
	ld	r0, $255*128	/ exponent overflow
	or	r0, r3
	ret
0:
	rl	r2
	rlc	r1
	rlc	r0
	rl	r2
	rlc	r1
	rlc 	r0

	or	r0, r3
	ret
/ floating point package for segmented z-8001
/ timothy s. murphy  10/84
/ IEEE format
/ double:	63 62		52 51				0
/	      sign  bin exp +1024   fraction (missing hi bit)
/ float:	31 30		23 22				0
/	      sign  bin exp +128    fraction (missing hi bit)
/
	.globl	SS