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

⟦dc6dcda92⟧ TextFile

    Length: 1408 (0x580)
    Types: TextFile
    Names: »BLKMOV.MAC«

Derivation

└─⟦01b5c9619⟧ Bits:30005906 Microsoft Multiplan v1.05 og HELP
    └─ ⟦this⟧ »BLKMOV.MAC« 

TextFile

;
;
;	Title		Block Move
;	Name:		BLKMOV
;
;
;	Purpose:	Move data from source to destination
;
;	Entry:		HL = Source address
;			DE = Destination address
;			BC = Number of bytes to move
;
;	Exit:		Data moved from source to destination
;
;	Registers used:	AF,BC,DE,HL
;
;	Time:		21 cycles per byte plus 97 cycles overhead
;			if no overlap exists, 134 cycles overhead
;			if overlap occurs
;
;	Size:		Program 27 bytes
;
;
;
BLKMOV:
	ld	a,b		;Is size of area 0 ?
	or	c
	ret	z		;Yes, return with nothing moved

	;Determine if destination area is above source area and overlaps
	;  it (overlap can be mod 64k).  Overlap occurs if
	;  starting destination address minus starting souce address
	;  (mod 64) is less than number of bytes to move
	ex	de,hl		;Calculate destination - source
	push	hl		;Save destination
	and	a		;Clear carry
	sbc	hl,de		;Then subtract area size
	and	a
	sbc	hl,bc
	pop	hl		;Restore destination
	ex	de,hl
	jr	nc,doleft	;Jump if no problem with overlap

	;Destination area is above source area and overlaps it
	;Move from highest address to avoid destroying data
	add	hl,bc		;source = source + lenght - 1
	dec	hl
	ex	de,hl		;dest = dest + lenght - 1
	add	hl,bc
	dec	hl
	ex	de,hl
	lddr			;Block move high to low
	ret

	;Ordinary move starting at lowest address
doleft:
	ldir			;Block move low to high
	ret

«eof»