File:  [Research Unix] / researchv9 / libc / sun / is68020.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:22:00 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

|
| @(#)is68020.s	1.1 (Sun) 2/3/86
| is68020():
|	returns 1 if running on 68020, 0 if running on 68000 or 68010
|	The trick is that the old processors ignore scaled indexing
|
	.globl	_is68020
_is68020:
	moveq	#1,d0
|	lea	a6@(0,d0:l:4),a1	| scale an index of 1 by a factor of 4
	.long	0x43f60c00		| this atrocity is to fool the assembler
	lea	a6@(4),a0		| should get same answer by adding 4
	cmpl	a0,a1			| if answers are same, we're on 68020
	beq	1f
	moveq	#0,d0			| otherwise 68000 or 68010
1:
	rts

unix.superglobalmegacorp.com

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