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
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- Announcing the TIB 2024 Advent Calendar (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- RISCOSbits releases a new laptop solution (News:)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
- RISC OS London Show Report 2024 (News:1)
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
Acorn Arcade forums: 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 ]
 

Acorn Arcade forums: Programming: 32bit SWI handler