*****************************************************************************
*
*    ExecBase Vector Testers          By Trevor Mensah ( July '91 For ACC )
* -----------------------------    ------------------------------------------
*
* This source is -NOT- a utility at present but the described routines can
* easily be incorparated into one. This source is just to show you the type
* of checks you can do from the Execbase vectors.
*
* You could easily put in CLI textprint routines and it would quite a useful
* CLI based utility.
*
* The checks (described) are for:
*
*                          « -NTSC- Boot-up bug !! »
*                        « Type of PROCESSOR registed »
*                  « Amount of MEMORY registed in the AMIGA »
*             « The Type of AGNUS chip installed in the machine »
*            « If Any -VIRUSES- are resident in memory vectors!! »
*
*****************************************************************************

;------ Equ's to ExecBase Memory Vectors

_Custom			equ	$DFF000
ExecBase		equ	4

APTR_Systkupper		equ	54
APTR_MaxExtMem		equ	78

HALF_MEG		equ	$080000
ONE_MEG			equ	$C80000
TWO_MEG			equ	$D80000
NO_EXTMEM		equ	0

UWORD_AtIntFlags	equ	296

UBYTE_VblankFrequency	equ	530
PAL_MODE		equ	50




	move.l		(ExecBase).w,a6		; Get Execbase


;------ Check for NTSC bootup bug !
;
; To find out if the NTSC boot up error (Caused by the bug in Kickstart ROM)
; has occured we simply check the "Vblank Frequency". This is the most direct
; and easy way to do it.

	cmpi.b		#PAL_MODE,UBYTE_VblankFrequency(a6)
	bne		NTSC_Mode		; Boot up bug occured !!
	beq		PAL			; No Problems,booted in PAL



;------ Check amount of Memory Currently Installed.
;
; I have only accounted for 3 types of memory configuration. If when executed
; it doesn't equal any of the 3 then it must be another memory config, (e.g.
; 3/4/5/6/7/8 Megs ). To just check if fast memory is installed you could 
; check one of the other execbase memory indicators. i.e 

; this would give the desired effect of testing if mem is on or installed.

;	cmpi.l		#NO_EXTMEM,APTR_MaxExtMem
;	beq 		MemoryExpansion_Off	; Mem off/not installed
;	bne		MemoryExpansion_On	; Mem on/& thus installed
;


	cmpi.l		#HALF_MEG,APTR_Systkupper(a6)
	beq		HalfMeg			; 512k memory installed

	cmpi.l		#ONE_MEG,APTR_Systkupper(a6)
	beq		OneMeg			; 1024k memory installed

	cmpi.l		#TWO_MEG,APTR_Systkupper(a6)
	beq		TwoMegs			; 2048k memory installed



;------ Check which Processor Currently installed.

; This check just show what type of Processor is installed the the computer
; If it is not a 68040,68030,68020,68010 then it must be a normal standard
; 68000 chip processor.

	moveq.l		#0,d0
	move.w		UWORD_AtIntFlags(a6),d0
	btst		#3,d0
	bne		A_68040Processor	; A 68040 Detected !!!!

	btst		#2,d0
	bne		A_68030Processor	; A 68030 Detected !!!

	btst		#1,d0
	bne		A_68020Processor	; A 68020 Detected !!

	btst		#0,d0
	bne		A_68010Processor	; A 68010 Detected !


	beq		A_68000Processor	; Standard 68000 Detected



;------ Check which Agnus Chip Currently installed.

	lea		(_Custom).l,a5
	move.w		4(a5),d0
	and.w		#$2000,d0
	beq		FatterAgnus		; Fatter Agnus (ECS) Detected
	bne		NormalAgnus		; Fat Agnus (No ECS) Detected




