21 August 2011, 23:22 | #1 |
Registered User
Join Date: Nov 2010
Location: .
Posts: 351
|
Short branch converted to NOP
Hello,
I've enabled all compile warnings on DevPac and I see a couple of interesting things, for example this (meaningless) code: Code:
main: moveq #0,d0 bra.s .here .here moveq #1,d0 rts end Inserting a NOP between the BRA and the local label solves. Or remove the branch. The DevPac warning that manages this is "NULL branches to NOP - ON/OFF/WARN". But what it is exactly that is bothering the assembler? Is it just a "style" suggestion? thx |
22 August 2011, 00:10 | #2 |
Registered User
Join Date: Mar 2008
Location: Las Vegas/Nevada
Posts: 103
|
I don't think it's bothering it, more trying to do you a favor.
'Hey, you have this statement here you don't need.. I can just do nothing and it will be more efficient' You're just 'branching' to the next instruction - if you insert the nop, you have thing to jump-over, something to branch to. or the alternative: remove the statement that does nothing. (I actually get this one come up on me from time to time as I have a habit of putting in a branch and a label when I'm working on something with a comment 'blah blah' goes here - so the branch is going to be eventually needed, I've just not coded that little bit - I've taken to doing a nop followed by the 'blah blah' comment...) |
22 August 2011, 08:05 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Instruction:
bra.s label label: does not exist! It would have instruction opcode of 6000 (60 XX where XX = 8-bit jump offset) which is reserved for bra.w (two word instruction 6000 xxxx where xxxx = 16-bit offset) Also 60FF = bra.l (three word instruction 60FF xxxx xxxx where xxxx xxxxx = 32-bit offset), 68020+ only. (Some cracktro or trainer used 60FF to cause address error, on 68020+ it jumped to some random memory instead..) |
22 August 2011, 08:22 | #4 | |
Registered User
Join Date: Nov 2010
Location: .
Posts: 351
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
68060 branch prediction documentation | Nut | Coders. General | 12 | 01 December 2016 21:51 |
Anyone for CD32 isos to be converted to .ccd's ? | NewDeli | support.Games | 26 | 11 February 2016 13:45 |
Games which were converted more than once | antonvaltaz | Nostalgia & memories | 15 | 04 June 2015 12:12 |
Games that you wished were converted to the Amiga. | 7-Zark-7 | Nostalgia & memories | 166 | 30 May 2012 12:06 |
Converted amiga fonts | thinlega | Amiga scene | 11 | 20 January 2003 17:58 |
|
|