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

⟦6f20f6129⟧ TextFile

    Length: 1152 (0x480)
    Types: TextFile
    Names: »MPBSUB.MAC«

Derivation

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

TextFile

;
;
;	Title		Multiple-Precision Binary Subtraction
;	Name:		MPBSUB
;
;
;	Purpose:	Subtract 2 arrays of binary bytes
;			Minuend = minuend - subtrahend
;
;	Entry:		Register pair HL = Base address of minuend
;			Register pair DE = Base address of minuend
;			Register B = Lenght of the arrays
;
;			  The arrays are unsigned binary numbers with a
;			  maximum lenght of 255 bytes, ARRAYÆ0Å is the
;			  leats significant byte, and ARRAYÆLENGH-1Å
;			  the most significant byte.
;
;	Exit:		Minuend := minuend - subtrahend
;
;	Registers used:	AF,B,DE,HL
;
;	Time:		46 cycles per byte plus 22 cycles overhead
;
;	Size:		Program 12 bytes
;
;
MPBSUB:
	;Clear carry, exit if array lenght is 0
	ld	a,b
	and	a		;Clear carry, test accumulator
	ret	z		;Return if lenght = zero
	ex	de,hl		; so HL points to subtrahend
loop:
	ld	a,(de)		;Get next byte of minuend
	sbc	a,(hl)		;Subtract bytes
	ld	(de),a		;Store difference
	inc	de		;Increment minuend pointer
	inc	hl		;Increment subtrahend pointer
	djnz	loop		;Continue until counter = 0
	ret

«eof»