DataMuseum.dk

Presents historical artifacts from the history of:

Jet Computer Jet80

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

See our Wiki for more about Jet Computer Jet80

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦d0a684706⟧ TextFile

    Length: 1024 (0x400)
    Types: TextFile
    Names: »ROTATE.SRC«

Derivation

└─⟦c9df7130d⟧ Bits:30005915 Pascal MT+ Release 5.2 (Jet-80)
    └─ ⟦this⟧ »ROTATE.SRC« 

TextFile

; rotate the floating point mantissa one bit
;
	NAME ROTATE
	ENTRY ROTATRIGHT,ROTATLEFT,ROTRIGHT,ROTLEFT
	INCLUDE FPINIT.SRC
;
rotatright:			;rotate a number right one bit
	dad	d		;calculate addr of number
	ora	a		;clear carry
rotright:			;rotate w/o clearing carry
	push	b		;save bc regs
	mvi	b,fracln	;process whole mantissa
rotr:	mov	a,m		;get next byte
	rar			;...rotate...
	mov	m,a		;and replace it
	dcx	h		;bump pointer
	djnz	rotr		;check count
	pop	b		;restore bc
	ret			;done!

rotatleft:			;rotate a number left one bit
	dad	d		;calculate addr of fpacc
	ora	a		;clear carry
rotleft:			;rotate w/o clearing carry
	rar			;save carry
	push	b		;save bc
	lxi	b,lsb-msb-1	;least significant byte-1
	dad	b
	ral			;restore carry
	mvi	b,fracln	;do whole mantissa
rotl:	inx	h		;bump pointer
	mov	a,m		;get next byte
	ral			;...rotate...
	mov	m,a		;and replace it
	djnz	rotl		;check counter
	pop	b		;restore bc
	ret
;
«eof»