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
- WROCC Newsletter Volume 41:11 reviewed (News:)
- WROCC March 2024 meeting o... Hughes and Peter Richmond (News:1)
- Rougol March 2024 meeting on monday with Bernard Boase (News:)
- Drag'n'Drop 13i2 edition reviewed (News:)
- South-West Show 2024 talks (News:4)
- February 2024 News Summary (News:1)
- Next developer fireside chat (News:)
- DDE31d released (News:)
- South-West Show 2024 Report (News:)
- South-West Show 2024 in pictures (News:)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
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: 21
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: 21
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