English Amiga Board


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

 
 
Thread Tools
Old 18 March 2022, 17:13   #1
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
680x0 opcode encoding - odd branches?

Is this summary correct and complete http://goldencrystal.free.fr/M68kOpcodes-v2.3.pdf ?

In the debate around the Vampire and suggestions for extending the instruction set I have been wondering about the branch instructions: Do all 680x0 variants trap when branching/jumping to an odd address?
Does branching to an odd address serve any other purpose than generating a trap?

Would it be an idea to have a supervisor-mode controlled setting that re-purposes odd branches for added opcodes? There are 127 of them for each 2-byte branch opcode from the top of my head (15*128 ?).

Last edited by NorthWay; 18 March 2022 at 17:32. Reason: 128 not 127
NorthWay is offline  
Old 18 March 2022, 17:52   #2
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by NorthWay View Post
Is this summary correct and complete http://goldencrystal.free.fr/M68kOpcodes-v2.3.pdf ?
I wouldn't say it's complete as it's 68000 only.


Quote:
Originally Posted by NorthWay View Post
In the debate around the Vampire and suggestions for extending the instruction set I have been wondering about the branch instructions: Do all 680x0 variants trap when branching/jumping to an odd address?
Yes they all trap. But conditional branches trap only when the branch condition is true.


Quote:
Originally Posted by NorthWay View Post
Does branching to an odd address serve any other purpose than generating a trap?
No, unless you want to go to byte encoding.
This, however, was the initial plan from Moto : allow branching to odd address if some day some successor of the family does this - but this obviously never happened.


Quote:
Originally Posted by NorthWay View Post
Would it be an idea to have a supervisor-mode controlled setting that re-purposes odd branches for added opcodes? There are 127 of them for each 2-byte branch opcode from the top of my head (15*128 ?).
IIRC there has been a discussion long ago on the natami forum about this.
While in theory possible, value $FF (= 32-bit 020+ branch) comes in the way.
meynaf is offline  
Old 18 March 2022, 18:00   #3
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,918
Quote:
Originally Posted by meynaf View Post
Yes they all trap.
I believe you are right but I wonder about the 68008. Does it really behave exactly like a 68000 with cycle penalties for the halved memory bus? I think it is likely but I don't know.
grond is offline  
Old 18 March 2022, 18:01   #4
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
Quote:
Originally Posted by meynaf View Post
While in theory possible, value $FF (= 32-bit 020+ branch) comes in the way.
Ok, but there is an ocean of pre-fixes or direct use 16-bit opcodes to pick from then that could be enabled by something like SetPatch / 680x0.library / per-task Exec call.

What was the verdict on the NatAmi forum on its feasibility?
NorthWay is offline  
Old 18 March 2022, 18:16   #5
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by grond View Post
I believe you are right but I wonder about the 68008. Does it really behave exactly like a 68000 with cycle penalties for the halved memory bus? I think it is likely but I don't know.
Even 68020, which can access misaligned data, will trap for branching to odd address - so it looks logic and consistent that 68008 also does.



Quote:
Originally Posted by NorthWay View Post
Ok, but there is an ocean of pre-fixes or direct use 16-bit opcodes to pick from then that could be enabled by something like SetPatch / 680x0.library / per-task Exec call.
If it needs to be enabled then we'll end up with cpu "modes" that will be a mess when disassembling code. I don't like this.
If we accept having several incompatible encodings, it's be IMO better to build a completely new one.


Quote:
Originally Posted by NorthWay View Post
What was the verdict on the NatAmi forum on its feasibility?
Not usable (for the purpose of extending the range of short branches, which was the idea then).
meynaf 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
GCR encoding roondar Coders. Asm / Hardware 70 25 September 2018 17:58
Converting 6502 to 680x0 (calling all 6502/680x0 experts) oRBIT Coders. General 12 14 January 2015 19:18
Why extra branches? (Which compiler?) crabman Coders. Asm / Hardware 31 01 May 2014 08:24
Encoding and writing an MFM track phx Coders. Asm / Hardware 15 30 October 2013 10:33
New opcode for 68000 family clenched request.UAE Wishlist 15 14 April 2009 15:02

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 07:14.

Top

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