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
- 10 RISC OS gift ideas for Christmas (News:)
- 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)
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: Minimum !Charm
 
  Minimum !Charm
  DavidS (15:07 18/11/2013)
  DavidS (16:50 18/11/2013)
  DavidS (21:05 18/11/2013)
    DavidS (21:08 18/11/2013)
  davidb (22:40 18/11/2013)
  arawnsley (10:58 19/11/2013)
    DavidS (15:14 19/11/2013)
      DavidS (17:32 20/11/2013)
        davidb (00:07 21/11/2013)
          DavidS (02:45 21/11/2013)
            crumbly (22:55 21/11/2013)
              DavidS (02:30 22/11/2013)
                crumbly (09:29 22/11/2013)
                  crumbly (12:26 22/11/2013)
                    DavidS (15:26 22/11/2013)
                      crumbly (21:16 24/11/2013)
 
David Saunders Message #122798, posted by DavidS at 15:07, 18/11/2013
Member
Posts: 14
Just wondering if any one knows what the minimum required Header is fro Charm. I am asking as I am not using any other portion of the library and

I do not have the spare time to look at the code for arml and the program header source to figure out what is actually required.

Unfortunately Peter Nowosad does not provide a way to contact him on the !Charm site with out either Java Script or FaceBook (the later I am very strongly oposed to).

Before anyone asks, yes this is related to a portion of the 26bit stuff.
  ^[ Log in to reply ]
 
David Saunders Message #122799, posted by DavidS at 16:50, 18/11/2013, in reply to message #122798
Member
Posts: 14
While on the topic;

It would be nice to know the limits of the arma assembler, thus avoiding mixing assemblers (Primarily use the BBC BASIC V Inline Assembler, with extASM a close second).

So is there a comprehencive list of supported instructions with out having to wade through the strange source layout of arma? I have not found the deffinitions in a quick look through the source.
  ^[ Log in to reply ]
 
David Saunders Message #122801, posted by DavidS at 21:05, 18/11/2013, in reply to message #122798
Member
Posts: 14
Ok as I am running short on time trying to get an archive together for a project I am not going to worry about it for the time beings. Though I am still interested in any replies.

As a short bit of history and reasoning:

I had hacked a small program and module together to run some 26Bit only software on RISC OS 5 on the RPi when I upgraded from a RiscPC. Then I mentioned this on the ROOL forums this has lead to me attempting to clean this up for another project.

Now the original is written in Charm, and I am attempting to provide a purely Assembly version, this is where the trouble starts. It works though has some very serious issues that the Charm version does not.

While Charm produced code runs amaizingly fast there is just nothing like pure assembly, especialy if attempting to get things to run at near native speed.

Further I have not gotten the charm code cleaned up at all as I have been focusing on an assembly conversion, so now I have to refocus and quickly get my charm code cleaned up and let the others involved know that I will be posting my code in Charm instead of assembly.

I was hoping that i could include a minimal amount of Charm code as a stop gap, though it is quickly looking as though I should be focusing on pure Charm code.
  ^[ Log in to reply ]
 
David Saunders Message #122802, posted by DavidS at 21:08, 18/11/2013, in reply to message #122801
Member
Posts: 14
And to make all of this worse I have not been using Charm in almost half a year.
  ^[ Log in to reply ]
 
David Boddie Message #122803, posted by davidb at 22:40, 18/11/2013, in reply to message #122798
Member
Posts: 119
Doesn't he have an account on the ROOL forum? Maybe try through there.
  ^[ Log in to reply ]
 
Andrew Rawnsley Message #122805, posted by arawnsley at 10:58, 19/11/2013, in reply to message #122798
R-Comp chap
Posts: 465
This may sound silly, but could you not use a phone, tablet, PC or such belonging to a friend or neighbour to make initial contact with Peter, then communicate via email?

Peter is very much the fount of all knowledge when it comes to Charm.
  ^[ Log in to reply ]
 
David Saunders Message #122806, posted by DavidS at 15:14, 19/11/2013, in reply to message #122805
Member
Posts: 14
Yes it does sound a bit silly as I no longer use a smart phone, and no one I know does either.

I am thinking about attempting to contact him through the ROOL Forums. I do wish he would make his site RISC OS Compatable (eg NetSurf).

I may end up loading up FireFox and trying to go that way, when I have a few hours to waste waiting for FireFox to do its thing.
  ^[ Log in to reply ]
 
David Saunders Message #122809, posted by DavidS at 17:32, 20/11/2013, in reply to message #122806
Member
Posts: 14
Yes it does sound a bit silly as I no longer use a smart phone, and no one I know does either.

I am thinking about attempting to contact him through the ROOL Forums. I do wish he would make his site RISC OS Compatable (eg NetSurf).

I may end up loading up FireFox and trying to go that way, when I have a few hours to waste waiting for FireFox to do its thing.
Or not. FireFox seems to have proken with the ROM that I am now using (RPi 5.21 21-OCT-2013).
  ^[ Log in to reply ]
 
David Boddie Message #122815, posted by davidb at 00:07, 21/11/2013, in reply to message #122809
Member
Posts: 119
The contact page of the main Qubit site is here:

http://www.qubit.talktalk.net/index_files/Page394.htm

That should be readable on any browser - I used the links browser to check.
  ^[ Log in to reply ]
 
David Saunders Message #122816, posted by DavidS at 02:45, 21/11/2013, in reply to message #122815
Member
Posts: 14
Thank you for that. I have sent of an E-Mail, fingers crossed.
  ^[ Log in to reply ]
 
Paulus Alexandrinus Message #122831, posted by crumbly at 22:55, 21/11/2013, in reply to message #122816
Member
Posts: 4
David, Charm dates back to the 90s and was originally developed on an A310 with a 26 bit ARM3. Acorn in their wisdom updated the specification of program headers for later versions of RISC OS targeted at 32 bit address bus ARM chips so that old programs will no longer run without some header jiggery pokery first. Supposedly this is to protect RISC OS from some older applications that might crash it should they make certain assumptions about the register architecture which are no longer valid (combined PC and status register and word alignment issues). When the Charm project was resurrected into this brave new world, the linker was therefore updated to generate new format headers. Actually no other changes were necessary as Charm was not making any such assumptions in the first place.

Why not use the Charm assembler or use Charm compiler inlining if you want to write some assembler code? The Charm linker will link that with a nice 32 bit module or application header for you just fine.
  ^[ Log in to reply ]
 
David Saunders Message #122833, posted by DavidS at 02:30, 22/11/2013, in reply to message #122831
Member
Posts: 14
Thank you though this is not my trouble.

My consern is the extra stuff that charm includes by default when linking, I wish to get rid of a lot of this stuff.

For example the folowing very simple HelloWorld program that does not use the libraries at all produces a linkable Object that is 141 bytes, though after linking the !RunImage is 10652 Bytes that is more than 10KB extra.


| ***************************************************************************** |
| A truely minimal simple "Hello World!" example written in Charm, for RISC OS. |
| ***************************************************************************** |


module Test00
{
declare proc OS_Write0(ref array char);

| ************************************************************************* |
| Application entry point |
| ************************************************************************* |
export proc ~start()
{
OS_Write0("Hello World!");
}

directive "inline"
{
_OS_Write0
swi "OS_Write0"
mov r0,#&80000000
mov r15,r14
}

}

Sorry for using the quote tags though it seems that this forum does not like the code tags.
  ^[ Log in to reply ]
 
Paulus Alexandrinus Message #122834, posted by crumbly at 09:29, 22/11/2013, in reply to message #122833
Member
Posts: 4
You can edit the Charm run time library (RTL) to remove uses of the String module by excising all exported procs that use them since you don't want standard library methods anyway. You can save more space by removing the command line argument parsing which also uses the String class. I estimate this will cut the memory footprint of your application to under half (say about 4K). If that's not small enough for you, you'll need to construct it all yourself using assembler / binary (good luck!).
  ^[ Log in to reply ]
 
Paulus Alexandrinus Message #122836, posted by crumbly at 12:26, 22/11/2013, in reply to message #122834
Member
Posts: 4
By the way what's the point of the whacky mov r0,#&80000000 instruction?
  ^[ Log in to reply ]
 
David Saunders Message #122837, posted by DavidS at 15:26, 22/11/2013, in reply to message #122836
Member
Posts: 14
&80000000 is the value for a nil pointer in Charm by default.

And thank you for pointing me to where to start striping things down.
  ^[ Log in to reply ]
 
Paulus Alexandrinus Message #122853, posted by crumbly at 21:16, 24/11/2013, in reply to message #122837
Member
Posts: 4
FYI there's no need to return a result by loading up r0 from an untyped procedure so you can skip the nil and save a few bytes.
  ^[ Log in to reply ]
 

The Icon Bar: Programming: Minimum !Charm