File:  [Research Unix] / researchv9 / jerq / src / lib / j / addr.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

	.text
	.def	addr;	.val	addr;	.scl	2;	.type	0144;	.endef
	.globl	addr
	.align	8
addr:
	MOVW	0(%ap),%r2		# get pointer to bitmap
	ARSH3	&5,4(%ap),%r0		# p.x >> 5
	ARSH3	&5,8(%r2),%r1		# dm->rect.origin.x >> 5
	SUBW2	%r1,%r0			# (p.x >> 5) - (dm->rect.origin.x >> 5)
	SUBH3	10(%r2),6(%ap),%r1	# p.y - dm->rect.origin.y -> r1
	MULW2	{uword}4(%r2),%r1	# above * dm->width
	ADDW2	%r1,%r0			# add word offsets for x and y
	ALSW3	&2,%r0,%r0		# mult by 4 to get offset in bytes -> r0
	ADDW2	0(%r2),%r0		# add Bitmap.base to offset -> r0
	RET	
	.def	addr;	.val	.;	.scl	-1;	.endef

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.