English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 09 August 2022, 11:29   #1
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,577
wrong disassembly

This is the result of wrong coding, disassembling in winuae:

Code:
0003bc2c 1038 8260                move.b $8260,d0
but this is actually a ".W' addressing mode out of range. So it's in the $FFFF8260 range.

it should print

Code:
0003bc2c 1038 8260                move.b $FFFF8260,d0
Also found another annoying issue: CTRL+C when nothing is selected acts as "break" and quits winuae.
jotd is offline  
Old 10 August 2022, 18:15   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,454
I can change it to -$xxxx if negative word address (that some disassemblers use). $ffff.. is too ugly. I also want it to be very clear if address is long (8 digits) or word (4 digits).

Quote:
CTRL+C when nothing is selected acts as "break" and quits winuae.
Yes, and it is by design because I like quick way to quit winuae
But seriously, why does it matter, CTRL+C won't work as a copy (or any other command) in Windows console windows.
Toni Wilen is offline  
Old 10 August 2022, 19:28   #3
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,577
Quote:
Originally Posted by Toni Wilen View Post
I can change it to -$xxxx if negative word address (that some disassemblers use). $ffff.. is too ugly. I also want it to be very clear if address is long (8 digits) or word (4 digits).
that sounds good


Quote:

Yes, and it is by design because I like quick way to quit winuae
But seriously, why does it matter, CTRL+C won't work as a copy (or any other command) in Windows console windows.

on windows 10 console it does. windows 10 console is so much better than windows 7 in terms of selection & copy/paste.
jotd is offline  
Old 10 August 2022, 22:02   #4
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 49
Posts: 4,604
$FFFF8260 might be ugly, however it has a meaning - this is Atari ST hardware register - but a negative value would be meaningless.
The correct way to disassemble it is $ffff8260.w.
meynaf is offline  
Old 11 August 2022, 13:46   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,454
Address != addressing mode.

I don't think there is "correct" option. I don't remember seeing Motorola documenting how short absolute should get disassembled when address is negative.

quick checks:

mon and asmone: -$xxxx.w
hrtmon: (-$xxxx).w
ar3: $ffffxxxx.S

I'll make it configurable (some other disassembler options are already configurable)
Toni Wilen is offline  
Old 11 August 2022, 14:40   #6
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 49
Posts: 4,604
16-bit "negative" addresses aren't used on the Amiga so it's clear Amiga-only disassemblers didn't care that much about them.
But they are used very often on the ST. You'll see things such as $ffff8260.w as shortcut to $00ff8260 (this always works, though theoretically incorrect). If the disassembler shows the $ffff8260 version it's easy to understand, while -$7da0 is completely meaningless. Shouldn't the most readable version be preferred ?

Quick check : MonAm (Devpac) shows $ffffxxxx.w as expected.
meynaf is offline  
Old 11 August 2022, 14:54   #7
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 47
Posts: 9,340
How does this affect winuae though? It is an Amiga product, so surely the Amiga disassembley is all that matters???



Am I missing something?



Quote:
Originally Posted by meynaf View Post
16-bit "negative" addresses aren't used on the Amiga so it's clear Amiga-only disassemblers didn't care that much about them.
But they are used very often on the ST. You'll see things such as $ffff8260.w as shortcut to $00ff8260 (this always works, though theoretically incorrect). If the disassembler shows the $ffff8260 version it's easy to understand, while -$7da0 is completely meaningless. Shouldn't the most readable version be preferred ?

Quick check : MonAm (Devpac) shows $ffffxxxx.w as expected.
BippyM is online now  
Old 11 August 2022, 15:05   #8
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,577
it's just a detail as those addresses are not really useful. Is there valid memory in some config at $FFFFxxxx ?
jotd is offline  
Old 11 August 2022, 15:15   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,454
My point still remains: unless Motorola documented it, there is no official or correct format.

And so far it seems Amiga-only disassemblers use 4 digit format.

Only reason I can optionally support it is because Hatari uses UAE CPU core. It would make sense to have hardware matching disassembly format.

Quote:
Is there valid memory in some config at $FFFFxxxx ?
I don't think so. (assuming 32-bit space). CSPPC has something nearby but I think it was FFF8xxxx or something.

Quote:
on windows 10 console it does. windows 10 console is so much better than windows 7 in terms of selection & copy/paste.
I always use latest Windows version (usually pre-release even). I do know console was heavily modified but I didn't know CTRL+C has dual-function now because it has always been console break almost everywhere, not just Windows.
Toni Wilen is offline  
Old 11 August 2022, 15:45   #10
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,577
Quote:
Originally Posted by Toni Wilen View Post
I didn't know CTRL+C has dual-function now because it has always been console break almost everywhere, not just Windows.

Another example how Microsoft stole ctrl+c from unix, but still used ctrl+c to copy from clipboard (unix used mouse buttons, shift+ins...) then mixed them both together for a nice backfire...

Same goes for all the shit Microsoft invented to avoid adopting unix special characters (backslash instead of slash, CR+LF instead of LF...) then went on having to support filepaths with slashes and unix linefeeds in windows, regexes... Bill Gates - that visionnary...
jotd is offline  
Old 11 August 2022, 15:48   #11
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 49
Posts: 4,604
Quote:
Originally Posted by BippyM View Post
How does this affect winuae though? It is an Amiga product, so surely the Amiga disassembley is all that matters???

Am I missing something?
You are missing the fact occasionnal ST code remnants can be found in Amiga programs, exactly like what happened to the OP.


Quote:
Originally Posted by Toni Wilen View Post
My point still remains: unless Motorola documented it, there is no official or correct format.
Mine does too : in that case the most readable format must prevail.
meynaf is offline  
Old 11 August 2022, 15:59   #12
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 47
Posts: 9,340
Quote:
Originally Posted by meynaf View Post
You are missing the fact occasionnal ST code remnants can be found in Amiga programs, exactly like what happened to the OP..



There you go I was missing something
BippyM is online now  
Old 11 August 2022, 16:08   #13
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 49
Posts: 4,604
For those who want to know, $(ff)ff8260 on the ST is hardware video mode register.
meynaf is offline  
Old 22 August 2022, 20:06   #14
npomarede
Registered User

 
Join Date: Nov 2017
Location: Paris
Posts: 5
Quote:
Originally Posted by Toni Wilen View Post
Address != addressing mode.

I don't think there is "correct" option. I don't remember seeing Motorola documenting how short absolute should get disassembled when address is negative.

quick checks:

mon and asmone: -$xxxx.w
hrtmon: (-$xxxx).w
ar3: $ffffxxxx.S

I'll make it configurable (some other disassembler options are already configurable)
Hi
another possibility, often used in ST asm sources is to add ".w" to the address, keeping the address as it is in the opcode word :
move.w $8260.w,d0


ie : this doesn't change the address to a negative one, which as pointed by meynaf is hard to read in an ST context.


Nicolas
npomarede is offline  
Old 22 August 2022, 22:27   #15
ross
Defendit numerus

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,824
Stupid Amiga snippet that uses negative addresses, too bad it only works in machines with 24 bit addressing:
Code:
	suba.l	a0,a0
	suba.l	-20.w,a0   ; <--- :)
	move.l	a0,12.w
	jmp     -1(a0)
Do not use this code! NEVER!

You have been warned
ross is offline  
Old 22 August 2022, 22:42   #16
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,224
Only ross would show us some code and then tell us to never use it. It's almost as if he's daring us
roondar is offline  
Old 22 August 2022, 23:39   #17
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,975
Quote:
Originally Posted by jotd View Post
it's just a detail as those addresses are not really useful. Is there valid memory in some config at $FFFFxxxx ?
It may, and there are cases in which there is. If you use MuRedox, the topmost 32K of memory contain the jump-table into the FPU emulation functions. What MuRedox does is that it replaces the 4-byte FPU opcodes by subroutine jumps into the emulation functions, and these emulation functions are kept in the topmost 32K. The reason why the topmost 32K are used for that is that a JSR.W can be used to reach them, requiring as many bytes as opcode as the original FPU instruction.
Thomas Richter is offline  
Old 23 August 2022, 09:16   #18
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 49
Posts: 4,604
Quote:
Originally Posted by ross View Post
Stupid Amiga snippet that uses negative addresses, too bad it only works in machines with 24 bit addressing:
Code:
    suba.l    a0,a0
    suba.l    -20.w,a0   ; <--- :)
    move.l    a0,12.w
    jmp     -1(a0)
There we clearly see -$20.w is meaningless, where $(ff)ffffec goes in rom. And that displaying $ffec.w would be completely wrong (sorry Nico ).


Quote:
Originally Posted by ross View Post
Do not use this code! NEVER!

You have been warned
Well, the program is dead even if this code works as expected
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
bad references in Resource disassembly kamelito support.Apps 4 15 June 2022 22:39
Disassembly of Amiga bootblocks on PC jordans1979 Coders. General 8 12 October 2020 06:58
How do you do a clean base register disassembly using Resource? Codetapper Coders. General 6 20 February 2011 12:53
How to make sense of disassembly? Jonathan Drain Coders. General 1 27 October 2009 22:57
Need a little disassembly/binary edit help mr_a500 Coders. General 5 30 April 2006 21:33

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 21:58.


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