English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 29 June 2021, 22:50   #101
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 327
Uhm the plugins doesn't have to be reentrant but the highlighter hook has to as it will be called from several texteditor.gadgets. The current state is given as part of the highlighter msg. The plugin must not store anything else regarding current state. Also the highlighter is executed in the input task so no dos calls either.
boemann is offline  
Old 30 June 2021, 12:26   #102
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by phx View Post
...


I agree this is generally a good idea for reentrant programs. Maybe even for normal ones. But it usually forces you to write compiler-specific code when doing OS-calls, which depend on a static library base.

some compilers like sc always refer to global variables for *bases.


Using macros, like gcc does, local variables can be used for *bases too. Maybe one can build something simliar for sc to replace the pragma libcall stuff...
bebbo is offline  
Old 30 June 2021, 12:33   #103
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 327
Quote:
Originally Posted by bebbo View Post
some compilers like sc always refer to global variables for *bases.


Using macros, like gcc does, local variables can be used for *bases too. Maybe one can build something simliar for sc to replace the pragma libcall stuff...
SAS/C can refer to local bases too while still using the pragma stuff
boemann is offline  
Old 19 July 2021, 22:31   #104
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 327
So do you guys prefer stack or registers arguments ?

Also Guy: how is it going. Any progress?
boemann is offline  
Old 19 July 2021, 22:59   #105
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by boemann View Post
Also Guy: how is it going. Any progress?
I haven't done any more work on this, I'm afraid, but if I do I'll be sure to post about it here. I've kinda gotten used to cross-assembling in the meantime, tbh..
guy lateur is offline  
Old 20 July 2021, 12:18   #106
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by boemann View Post
So do you guys prefer stack or registers arguments ?
The question is in which situation? For your own, private projects: yes, you can do that, as long as it gives you an advantage (depends on the number of registers allocated for it). For public code I would refrain from it, because it is not a standard m68k ABI and may be implemented differently in C compilers, if at all.

I know SAS/C can do it, but I'm not sure which ABI it follows there. Does it use only scratch registers for arguments? I also remember that function names become
@name
instead of
_name
, when it takes register arguments.

For vbccm68k we have the option -fastcall (and also the
__regargs
attribute for individual functions), which uses d0/d1/a0/a1 for register arguments (a0/a1 for pointers only) and pushes the rest onto the stack. Not sure how compatible that would be. I guess you can always run into situations which are different.
phx is offline  
Old 21 July 2021, 11:04   #107
boemann
Camilla, AmigaOS Dev.
 
Join Date: Mar 2020
Location: Frederiksberg
Posts: 327
Thanks - I meant for the plugins, and if i were to require passing by registers i would obviously specify which regs using __reg and the like
boemann is offline  
Old 21 July 2021, 14:23   #108
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Ah, ok. Thats' fine!
phx 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
AmigaOS 3.2 TextEdit - black text on black background? Warty support.Apps 7 08 June 2021 17:30
gedit asm syntax highlighting plugin? grond Coders. Asm / Hardware 0 19 May 2020 13:06
VBCC assembler linking syntax? NovaCoder Coders. General 2 20 May 2011 03:04
CLI Syntax Greaser New to Emulation or Amiga scene 1 08 October 2006 10:14
SynTax Disks (old) andreas request.Old Rare Games 1 19 July 2003 04:02

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 19:24.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07775 seconds with 16 queries