nhaudio Posted December 17, 2006 Author Report Share Posted December 17, 2006 as predicted no luck with jal, but at least I learned how to install from the terminal :)then I tried the script with the mios main.asm (not the sid), no luck either, that means the script does not work with osx as it is now.any suggestions? Quote Link to comment Share on other sites More sharing options...
audiocommander Posted December 18, 2006 Report Share Posted December 18, 2006 maybe I can add some more informations:the problematic asm keywords are: [tt]BIFSET, BIFCLR, IFSET, IFCLR, IFNEQ, IFLEQ, IFGEQ[/tt]these should be replaced by:[tt]btfsc, btfss, btfsc, btfss, spfeq, cpfsgt, cpfslt[/tt]But I must admit, that I can't read those regular expressions:[tt]s/\<IFSET\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/btfsc \1, \2\n\t\3/g[/tt]an example of a GPASM invalid line is:[tt]IFSET PIR1, TMR1IF, rgoto IRQ_Timer1[/tt]I don't know what the syntax would be if this line is expressed with "[tt]btfsc[/tt]"It won't compile even if I replace IFSET by btfsc manually...And finally, I think the problematic line is the first one of the replace-macros.sed:[tt]1i;hey emacs, this is -*- asm -*-[/tt]I can't see what the "[tt]1i;[/tt]" should do?maybe an ASM-hacker knows what to do????cheers,Michael Quote Link to comment Share on other sites More sharing options...
mess Posted December 30, 2006 Report Share Posted December 30, 2006 an example of a GPASM invalid line is:IFSET PIR1, TMR1IF, rgoto IRQ_Timer1I don't know what the syntax would be if this line is expressed with "btfsc"It won't compile even if I replace IFSET by btfsc manually...if you want to replaceIFSET PIR1, TMR1IF, rgoto IRQ_Timer1the code should bebtfsc PIR1, TMPAIFrgoto IRQ_Timer1note that you have to use btfsc with IFSETand btfss wit IFCLRyou can look into macro.inc for similar conversions for the other instructionsI just did what the macro should do ;Dhope this helps (and that I'm not telling you stuff you already knew :)) Quote Link to comment Share on other sites More sharing options...
audiocommander Posted January 1, 2007 Report Share Posted January 1, 2007 you can look into macro.inc for similar conversions for the other instructionsI see!Thanks a lot for pointing me to that, mess!Now I got the root of all evil, the problem is the instruction passing as parameter:[tt]BIFSET MACRO reg, bit, reg_a, instr btfsc reg, bit, reg_a instr ENDM[/tt]the macros have to be rewritten like this:[tt]BIFSET MACRO reg, bit, reg_a btfsc reg, bit, reg_a ENDM[/tt]and a typical call to this macro would now be:[tt]IFNEQ BYTE_NUMBER, ACCESS, rgoto MainLoop_WaitSequence;; should becomeIFNEQ BYTE_NUMBER, ACCESSrgoto MainLoop_WaitSequence[/tt]Now there's only one thing that I don't understand: what advantage does one get by passing the instruction ??? it does not reduce typing or anything. The only thing it does is to prevent compilation with GPASM. I tested it and compiled successfully with the bootloader source.The generated .hex file is the same as the ready-compiled one. No differences :DCheers,Michael Quote Link to comment Share on other sites More sharing options...
mess Posted January 2, 2007 Report Share Posted January 2, 2007 I guess the only advantage is readability... Quote Link to comment Share on other sites More sharing options...
TK. Posted January 2, 2007 Report Share Posted January 2, 2007 IFSET and IFCLR were the first macros I ever wrote in PIC assembly (anno 1998), because I always mixed the btfss/btfsc instructions, and I wanted to have the branch in a single line.I'm not sure if it is worth the effort to change my own coding style (as it has to be done for all projects - it's really hard work), but in general I think that it can be easily solved with a small perl script which search/replaces the macros, instead of a bash script which uses sed.Advantage: every MIOS user has to install perl anyhow, no need for additional tools.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
audiocommander Posted January 3, 2007 Report Share Posted January 3, 2007 Hey, as the name of this topic is not really matching, I allowed myself to open a new topic: http://www.midibox.org/forum/index.php?topic=8275.0I posted the download link to a first version of a perl script there. It works with the bootloader!@nhaudio:you are welcome to try the script, although it's just a rough first test... because the script is actually overwriting files, please backup the original sources before applying the script... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.