English Amiga Board


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

 
 
Thread Tools
Old 22 January 2021, 18:54   #1
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,641
FMOVEM.L #xyz,<more than one control register> official syntax?

Does anyone know official syntax for FMOVEM.L #xyz with more than one control register? Motorola manuals don't seem to help.

This is unique instruction because it can accept more than one immediate value. (6888x and 68040 support it in hardware, 68060 does not support it without FPSP)

For example F23C 9C00 1111 1111 2222 2222 3333 3333 would move 11111111 to FPCR, 2222222222 to FPSR and 3333333333 to FPIAR.

Something like FMOVEM.L #$11111111,#$22222222,#$33333333,FPCR/FPSR/FPIAR?
Toni Wilen is offline  
Old 22 January 2021, 19:26   #2
ross
Defendit numerus

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 3,129
Since the source is a list, perhaps this is more 'standard'?:

FMOVEM.L #$11111111/#$22222222/#$33333333,FPCR/FPSR/FPIAR
ross is offline  
Old 22 January 2021, 21:04   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,641
Perhaps. It still looks strange. Does any disassembler even support this instruction correctly?
Toni Wilen is offline  
Old 22 January 2021, 21:10   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,819
As far as I understand FMOVEM.L #x,<FPcrlist> is only allowed for a single control register in the list. The reason is that FMOVEM.L with a single register has the same opcode as FMOVE.L.

There should be a
* Only if a single FPcr is selected
in the table for the
#<data>
addressing mode line. It's probably one of the many typos in the PRM. I have the first revision, where I fixed dozens of errors during the years.
phx is offline  
Old 22 January 2021, 21:11   #5
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 306
Well, that's something new for me ><. First bug in my disassembler since ~2013.
Did a quick check with asm-one/pro, barfly and phxass. Barfly is using
Code:
	fmovem.l	#$111111112222222233333333,fpcr/fpsr/fpiar
but it doesn't produce 100% correct code. fmovem is followed by ~1300 zeroes (always an odd number). A bit buggy, looks like. Bdebug prints it in this format as well.
However, it also consumes
Code:
	fmovem.l	#$1111/#$2222/#$3333,fpcr/fpsr/fpiar
but the code is entirely wrong (only uses the first longword, the rest is all zeroes).

Phxass consumes the former, but it ignores everything except bottom 32 bits, the latter fails to compile. My guess is it doesn't support it, but we have Frank here so he can clarify.

Asm-one doesn't even accept immediate as source, and while disassembling only parses and prints the first longword as 32-bit immediate. No surprise here :P.
a/b is offline  
Old 22 January 2021, 21:14   #6
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,819
Quote:
Originally Posted by Toni Wilen View Post
For example F23C 9C00 1111 1111 2222 2222 3333 3333 would move 11111111 to FPCR, 2222222222 to FPSR and 3333333333 to FPIAR.
Wait! I overlooked that. Are you serious? Did you test that with real hardware?
phx is offline  
Old 22 January 2021, 21:17   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,641
Quote:
Originally Posted by phx View Post
As far as I understand FMOVEM.L #x,<FPcrlist> is only allowed for a single control register in the list. The reason is that FMOVEM.L with a single register has the same opcode as FMOVE.L.
It is valid. 68882 executes it fine and 68060 FPSP has specific emulation for this variant (more than one control register).
Toni Wilen is offline  
Old 22 January 2021, 21:23   #8
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,819
Wow! Learned something new. When there is any assembler supporting it I would likely adpot that syntax. Otherwise I'm open for suggestions.

EDIT: I would probably suggest #$111111112222222233333333 which seems the easiest to implement.

EDIT2: Done. vasm supports this syntax now. Works with tomorrow's source snapshot.

Last edited by phx; 22 January 2021 at 22:32. Reason: syntax, vasm
phx is offline  
Old 23 January 2021, 11:27   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,641
Quote:
Originally Posted by phx View Post
EDIT: I would probably suggest #$111111112222222233333333 which seems the easiest to implement.
I personally don't like this, it gets totally unreadable when digits are more "random".

btw, there is one more side-effect: if all "register select bits" are zero: FPIAR is selected. 6888x, 68040 and 68060 have same behavior. It is not possible for FMOVEM.L # to do nothing. (like normal FMOVEM/MOVEM can)
Toni Wilen is offline  
Old 23 January 2021, 14:54   #10
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 306
fmovem.l with less than 2 regs is actually fmove.l, but your point stands (they share the same opcode $f200 %10xxx...x).
Interesting... So, documentation is wrong in two places:
- fmove.l creg: doesn't state that if no register is selected, fpiar is used
- fmovem.l creg: incorrectly states that at least one register must be selected (should be at least two, otherwise it's a "different" instruction: fmove.l)
060 FPSP gets it right, well in *stating* how it should work (it only emulates unimplemented 2+ registers), fmovm_ctrl():
* (000): FPIAR

Regarding the syntax, I don't like multiple commas ><. Slashes and/or a single number gets my vote.
a/b is offline  
Old 23 January 2021, 19:05   #11
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,819
Quote:
Originally Posted by Toni Wilen View Post
I personally don't like this, it gets totally unreadable when digits are more "random".
Right. You have to know that every control register allocates a 32-bit portion of your 64 or 96-bit immediate value. And, even worse, you have to know which portion belongs to which register! The order in which you specify the register list does not have any influence on the order inside the source operand's value. It is defined by hardware.

Maybe I would also prefer a syntax like #111/222/333, including automatic matching to the register-list's order, but doing bigger changes in the parser are not justified by such an extremely special case, which probably never occured in any code.
phx is offline  
Old 25 January 2021, 17:22   #12
Wepl
Moderator
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 759
FMOVEM.L #$11111111,#$22222222,#$33333333,FPCR/FPSR/FPIAR
Looks most natural too me.
.L implies 32-bit operators.
A slash is used for division. I wouldn't use this as separator.
If the order of FPCR/FPSR/FPIAR is given wrong the assembler should fail.
I checked ReSource and Hrtmon/Beermon, all wrong in disassembling it.
Wepl is offline  
Old 25 January 2021, 21:10   #13
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 974
Quote:
Originally Posted by Toni Wilen View Post
Does anyone know official syntax for FMOVEM.L #xyz with more than one control register?

Thanks for pointing this out. No, I do not know what the official syntax is, either. I just found that the disassembler.library (and hence COP) did not support it. For the next release, I'll adapt the syntax with the / separating the immediate values. This mirrors the syntax of movem, and the right-hand side of fmovem as well.



Also MuRedox did not patch it (not that it is used widely - I haven't seen this) - also a new version is on the way.
Thomas Richter 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
Gfx conversion tools from xyz to IFF without bells and whistles mr.spiv support.Apps 3 15 August 2020 18:32
Amiga joystick on pc for xyz time, but this time with adapter? :) Srksi support.WinUAE 3 24 May 2018 04:57
CLI Syntax Greaser New to Emulation or Amiga scene 1 08 October 2006 11:14
SynTax Disks (old) andreas request.Old Rare Games 1 19 July 2003 05:02
Syntax Error in IE. Fred the Fop project.EAB 2 04 October 2002 15:47

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 00:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.12441 seconds with 14 queries