How to Make a ColourTrans Transfer Function
Andy S (2979) 504 posts |
OK, I’m really lost here. I wrote a ColourTrans Transfer Function for the brush tool in Paint and it was working nicely. The trouble is I turned my ARM code into an array of hex values, hard-coded in the C source (It might sound odd but I was just copying one of the test programs in the RISC OS sources), and understandably I’ve been asked to move it out into an assembler file. Now I’m totally out of my depth because the limit of my ARM assembler knowledge doesn’t go much beyond using it from BASIC or poking around in Absolute binaries. I’ve been reading the DDE Assembler manual and following the examples. I first tried putting my code file in Paint’s “s” subdirectory but was horrified to discover a command in the Makefile that wipes the contents of that! I’ve now put it in the ‘asm’ subdirectory. Anyway, the basic problem at the moment is that the build just hangs forever (many minutes) with the following output:
The !Depend file seems to have been created correctly, but no o.BrushTransFunc file exists. Here’s the contents of my assembler file:
I probably don’t need the DATA area. I added it in desperation. Even if I strip out almost all the code and comments, ObjASM still hangs. I’m not sure what to look at next. The HelloW example in the DDE assembles fine when I drag it to ObjASM. |
Andy S (2979) 504 posts |
I’ve tried building HelloW from the same directory as my own assembler file and HelloW works fine, but if I drag my file containing just the following to ObjASM it still hangs:
If I edit HelloW to take out all the SWI instructions and replace them with “MOV pc, r14”, that makes ObjASM hang as well. What could I be doing wrong? |
Andy S (2979) 504 posts |
It’s looking like it might simply be the lack of a newline after “END”. How frustrating! It would be so nice if ObjASM could look for that and at least generate a meaningful error message. |
Rick Murray (539) 13401 posts |
What the hell? That’s your problem right there. It’s okay to wipe o.* because that’s the object files used to build the project. But s and c ought to be left alone. Try putting the EXPORT before the definition? Edit: ah, I see you found the newline thing. I thought ObjAsm did whinge about that? |
Andy S (2979) 504 posts |
Well Paint builds again now, but this time as soon as I select the Brush tool I get an Abort on Instruction fetch. I wonder if that has anything to do with the fact that I’m including my ARM code in the C using a function pointer now instead of the hex array. Do I need to be APCS compliant for my ColourTrans transfer function? |
Andy S (2979) 504 posts |
What the hell? That’s your problem right there. Seriously. It’s a very good job I’d written minimal new code in that file and had the transfer function itself safely backed up elsewhere otherwise it would have had me fuming. 8-/ |
Julie Stamp (8365) 462 posts |
:-( |
Andy S (2979) 504 posts |
Thank you! That certainly wouldn’t help. I have a feeling it’s not the only thing I got wrong, though. |
Steve Pampling (1551) 7931 posts |
Even I know that one.
I think that depends on the verbosity, if so it’s dumb as showstoppers should always be reported. |
Colin Ferris (399) 1748 posts |
I wonder if the GCC Assembler does better – catch things like ALIGN in the left of the page. ObjAsm reports an error if you do it twice :-( GCC Assembler works quite well with largish files – MBytes. |
Andy S (2979) 504 posts |
It seems to be working now. Thanks everyone for your help. |