log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Drag'N'Drop Autumn edition now available (News:)
- !DualHead puts 2 screens in one (News:)
- RISC OS London Show 2017 - Notes from the talks (News:6)
- November News (News:)
- !Organizer 2.28 reviewed (News:2)
- !OBrowse reviewed (News:10)
- Aemulor (Gen:16)
- DDE reaches release 28 and above (News:)
- Elesar quicks dispels stormy clouds (News:2)
- RISC OS London Show 2017 (News:)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
Site Search
 
Article archives
The Icon Bar: Programming: 32bit SWI handler
 
  32bit SWI handler
  sirbod (17:51 13/5/2013)
  jeff-doggett (06:47 14/5/2013)
    sirbod (16:55 15/5/2013)
      jeff-doggett (06:54 16/5/2013)
        PaulV (14:19 16/5/2013)
 
Jon Abbott Message #122382, posted by sirbod at 17:51, 13/5/2013
Member
Posts: 563
Are there any examples of how to code a 32bit SWI handler for modules?

Does the RO SWI dispatcher for example handle resetting the flags? Or does the module have to store/restore CPSR and return direct to the caller?

The obvious way of doing it would be if RO called the module with SPSR and R14 set and the module exits with "MOVS PC, R14" making it both 26 and 32 bit compatible - I doubt it's that simple though!
  ^[ Log in to reply ]
 
Jeff Doggett Message #122383, posted by jeff-doggett at 06:47, 14/5/2013, in reply to message #122382
Member
Posts: 20
SWI's no longer preserve the flags.

See http://www.iyonix.com/32bit/32bitTech.shtml

Jeff
  ^[ Log in to reply ]
 
Jon Abbott Message #122386, posted by sirbod at 16:55, 15/5/2013, in reply to message #122383
Member
Posts: 563
Thanks, for 26/32bit compatibility I've gone with the following SWI exit code:

TEQ PC, PC
MOVEQ PC, R14
MOVS PC, R14
  ^[ Log in to reply ]
 
Jeff Doggett Message #122387, posted by jeff-doggett at 06:54, 16/5/2013, in reply to message #122386
Member
Posts: 20
Personally, I wouldn't bother writing new modules to be 26 bit compatible, because no-one in their right mind would write 26 bit only code to call it these days, unless of course it's emulating legacy stuff.

[Edited by jeff-doggett at 07:55, 16/5/2013]
  ^[ Log in to reply ]
 
Paul Vernon Message #122389, posted by PaulV at 14:19, 16/5/2013, in reply to message #122387
Member
Posts: 135
But when it's for a project that needs to support 26 and 32-bit hardware, it's a must do.

http://www.iconbar.co.uk/forums/viewthread.php?threadid=11919

Paul
  ^[ Log in to reply ]
 

The Icon Bar: Programming: 32bit SWI handler