English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 18 December 2019, 22:08   #1
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
movec on 68000

I'm converting ministartup from here: http://stingray.untergrund.net/MiniStartup.s and stumbled over this part:


Code:
.GetVBR	move.l	a5,-(a7) 	moveq	#0,d0			; default at $0 	move.l	$4.w,a6 	btst	#0,296+1(a6)		; 68010+? 	beq.b	.is68k			; nope. 	lea	.getit(pc),a5 	jsr	-30(a6)			; SuperVisor() .is68k	move.l	(a7)+,a5 	rts  .getit	movec   vbr,d0 	rte				; back to user state code

It executes the "movec" privileged instruction which is AFAIK an 68010+ instruction, right? So I get an error from vasm because I'm targetting 68000:


instruction not supported on selected architecture



And I wonder how to work around this, as I'm not sure what exactly it does.
sparhawk is offline  
Old 18 December 2019, 22:24   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,994
Change the line MOVEC VBR,d0 to this:

dc.l $4E7A0801

VBR = Vector Base Register.

On a 68000 the VBR cannot be moved, so the base address is $0. The Vector Base is the area of memory where the vectors are stored, so thats BUS ERROR etc and of course the interrupts.

On 68010+ the Vector Base can be repositioned, and all those interrupts will also be moved.
Galahad/FLT is offline  
Old 18 December 2019, 22:40   #3
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
Thanks. I enabled 68010 instruction set. I was trying to find the encoding for the instruction.
sparhawk is offline  
Old 19 December 2019, 13:28   #4
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
this should do it:

mc68020
movec vbr,d0
mc68000
DanScott is offline  
Old 19 December 2019, 13:32   #5
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
Thanks! I was looking on how to enable an architecture for only some instructions, but I haven't found this in the docs. This is much better, as I want to target 68000 and I wouldn't like to slip in other instructions by accident, as it would be possible at the moment.
sparhawk is offline  
Old 19 December 2019, 13:40   #6
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,994
Quote:
Originally Posted by sparhawk View Post
Thanks! I was looking on how to enable an architecture for only some instructions, but I haven't found this in the docs. This is much better, as I want to target 68000 and I wouldn't like to slip in other instructions by accident, as it would be possible at the moment.
That specific movec in Stingrays mini startup code wont be executed on 68000 as he does a processor check before.
Galahad/FLT is offline  
Old 19 December 2019, 14:23   #7
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
Yes, But it should be there, in case it is executed on a different machine, right? So the code wouldn't work, if the program would be started on some A1200 or so.
sparhawk is offline  
Old 19 December 2019, 15:08   #8
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
ministartup works perfectly well on all Amigas / processors / configs

On 68000, the movec part is never called, so it's just in effect some bytes in memory
DanScott is offline  
Old 19 December 2019, 15:44   #9
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
Yes, thats why I left it in. I could have removed that part, but then it wouldn't work properly on other Amigas.
sparhawk is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
68000 6888x Seiya support.WinUAE 5 05 December 2017 20:50
How to disable caches using MOVEC => CACR jotd Coders. Asm / Hardware 12 07 November 2017 20:45
68000 motorola alex68 support.Hardware 84 23 January 2017 21:30
68000 optimisation Galahad/FLT Coders. Asm / Hardware 9 20 August 2016 00:29
68000 Emulation buggs support.FS-UAE 0 29 May 2016 13:35

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07433 seconds with 15 queries