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

⟦2e9f7d9b9⟧ TextFile

    Length: 585 (0x249)
    Types: TextFile
    Notes: UNIX file
    Names: »strcat.s«

Derivation

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

TextFile

/ Segmented Z8001 Coherent string library
/ Concatenate one string to another (s2 to s1)
/ strcat(s1, s2)
/ char *s1, *s2;

	.globl strcat_
	.globl SS

strcat_:
	ldm	r2, SS|4(r15), $4	/ rr2 = s1, rr4 = s2

	subl	rr0, rr0		/ r0 = count, r1 = NULL
	cpirb	rl1, (rr4), r0, eq	/ Scan string (s2) for NULL
	neg	r0			/ r0 = string length of s2

	sub	r5, r5			/ r5 = count
	cpirb	rl1, (rr2), r5, eq	/ Scan string (s1) for NULL
	dec	r3			/ backup to point at '\0' byte

	ld	r5, SS|10(r15)		/ rr4 = s2 (restore offset)
	ldirb	(rr2), (rr4), r0	/ Copy string

	ldl	rr0, SS|4(r15)		/ rr0 = s1
	ret