ARMdetect - ARM processor detector

by George Saliaris


With a multitude of ARM processors available now and in the future (ARM2, ARM250, ARM3, ARM610, ARM700, ARM710, ARM800 etc) it is often desirable to know the particular version of the processor on which a program is running. This is useful for tuning speed-critical code (eg redrawing routines, games, low-level handlers) according to the features of the target processor (cached/non-cached, write buffer existence) because different techniques are employed depending on the processor (for instance, short or unrolled loops).

ARMdetect contains a short Assembler routine that will identify the processor and return a decimal number indicating its version. Both of these programs can be added to your own programs. Below are described some possible results and their meaning:

100	ARM 1	(never used in production machines)
200	ARM 2	(eg A310, A3000, A410/1)
250	ARM 250	(eg A3010, A3020, A4000)
300	ARM 3	(eg A5000, A540, A4)
610	ARM 610	(eg RiscPC)
700	ARM 700	(eg RiscPC)
710	ARM 710	(eg RiscPC)
800	ARM 800	(future machines)

The assembler procedure is called 'ARMtype' and has the following features:

 it supports all old and future ARM processors
 it is APCS compliant (ie can be called from C language)
 it can be called from either USR or SVC processor modes and returns with processor mode unchanged (ie can be used in both applications and relocatable modules)
 the result is cached for maximum efficiency, and so the next time the code is called, the stored result is fetched from memory and returned

You may find it useful to add the respective AOF file in your linkable code library for re-use in future programs.

A trivial C program is also included which just calls the 'ARMtype' procedure and displays the result. Please note that in order to recompile the sources you will need the following packages:

	Desktop C		(from Acorn Computers Ltd)
	BasicAOF 1.20	(from Oregan Developments)

Feel free to contact the author for bugs, comments, suggestions etc:

Mail:	George Saliaris
	Veriti 7
	Chios  821 00
	GREECE

Fax:	+30 271 41355

Email:	gsal@posidon.servicenet.ariadne-t.gr


 Copyright RISC User 1995
