Get Amiga Config [680x0 ASM]

AmigaOS specific forum
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Get Amiga Config [680x0 ASM]

Post by va!n »

I found some old stuff from our group for the 680x0 amiga... Dont know if following stuff will directly work with PB amiga... maybe you have to modify... otherwise the routine should work like a dream :)

Code: Select all

*******************************************
*** Get Amiga Config    	       ***
*******************************************

; determines					output in
;		- ChipSet OCS/ECS/AGA 		d0
;	 	- Kickstart version/VideoFreq	d1
;		- CPU version (z.b. "$68000")	d2
;		- FPU version (e.g. "$68882")	d3
;		- Free ram (Chip)		d4
;		- Free ram (Fast)		d5
;		- Max ram (Chip)		d6
;		- Max ram (Fast)		d7

; kills:	d0-d7/a6

GetConfig:
	move.l	a6,-(a7)
	move.l	$4.w,a6			; get execbase
	move.l	#$20002,d1		; largest Chip
	jsr	-216(a6)		; AvailMem()
	lsr.l   #8,d0			; /1024
	lsr.l   #2,d0
	move.l	d0,d4

	move.l	#$20004,d1		; largest Fast
	jsr	-216(a6)		; AvailMem()
	lsr.l   #8,d0			; /1024
	lsr.l   #2,d0
	move.l	d0,d5
	
	move.l	62(a6),d0		; Max Chip
	lsr.l   #8,d0   		; / 1024
	lsr.l   #2,d0   
	move.l	d0,d6

	moveq   #4,d1   		; Max Fast
	bset    #19,d1	
	jsr     -216(a6)		; AvailMem()
	lsr.l   #8,d0   		; / 1024
	lsr.l   #2,d0   
	move.l	d0,d7
	
	bsr	GetGFX
	
	move.l	$4.w,a6			; get execbase
	moveq	#0,d1
	move.w	$14(a6),d1		; KS version (1.3 = version 34)
	swap	d1
	move.b	530(a6),d1		; VBlank Frequency
	
	move.l	$4.w,a6			; get execbase
	moveq	#0,d2
	move.b	$129(a6),d2
	bsr	GetFPU
	bsr.b	GetCPU
	move.l	(a7)+,a6
	rts


GetCPU	btst	#7,d2
	bne.b	.68060
	btst	#3,d2
	bne.s	.68040
	btst	#2,d2
	bne.s	.68030
	btst	#1,d2
	bne.s	.68020
	btst	#0,d2
	bne.s	.68010

.68000	move.l	#$68000,d2
	rts
.68010	move.l	#$68010,d2
	rts
.68020	move.l	#$68020,d2
	rts
.68030	move.l	#$68030,d2
	rts
.68040	move.l	#$68040,d2
	rts
.68060	move.l	#$68060,d2
	rts
	
GetFPU	moveq	#0,d3
	btst	#7,d2
	bne.b	.68060i
	btst	#6,d2
	bne.b	.68040i
	btst	#5,d2
	bne.b	.68882
	btst	#4,d2
	bne.b	.68881
	rts

.68881	move.l	#$68881,d3
	rts
.68882	move.l	#$68882,d3
	rts
.68040i	move.l	#$68040,d3
	rts
.68060i	move.l	#$68060,d3
	rts
	
GetGFX	moveq	#0,d1
	move.b  $dff07d,d1
	cmp.b   #$f8,d1
	beq.b   .AGA
	cmp.b   #$fc,d1
	beq.b   .ECS
	moveq	#0,d0
	rts

.AGA	moveq	#2,d0
	rts
.ECS	moveq	#1,d0
	rts
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
KarLKoX
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Sweet :)
It is pity that the PB AmigaOS port is no longer supported :(
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Can an admin/mod delete Dickderten0's post?
It's got a link to a site that tries to download a virus PCK/NSIS.M

EDIT: Thanks Fred :)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
joseph125
New User
New User
Posts: 1
Joined: Thu Jan 13, 2011 7:44 am

Re: Get Amiga Config [680x0 ASM]

Post by joseph125 »

Hello guys

I am getting into Amiga 6800 assembly language and I would like to know if I can code programs by my PC and use a PC programs that generate amiga executables to run with winuae o a real amiga!

any suggestion?
Post Reply