LinkoVitch Posted May 13, 2012 Share Posted May 13, 2012 Hi guys (and gals) Thought it may be worth posting this link here, as I just wrote a bit of a note on a RISC (maybe MAC??) bug that keeps getting me, thought I would share a link here to the Jag section of my blog where I do on occasion actually write stuff, usually regards progress with stuff and things.. So anyone interested in a sort of dev blog type thing: http://www.linkovitch.me.uk/blog/?cat=3 There are a few posts about the early days of the sound engine, a few penny dropping moments, documented for all history 3 Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted May 13, 2012 Share Posted May 13, 2012 Interesting bug. I'm not sure how powerful the macro system is in the assembler but is it possible to put the jump instruction in a macro and then check the alignment of the target address in the macro? If its not aligned correctly then put out a warning. The other solution would be to put an alignment check in the final pass of the assembler source itself. Quote Link to comment Share on other sites More sharing options...
JagChris Posted May 14, 2012 Share Posted May 14, 2012 Hi guys (and gals) Thought it may be worth posting this link here, as I just wrote a bit of a note on a RISC (maybe MAC??) bug that keeps getting me, thought I would share a link here to the Jag section of my blog where I do on occasion actually write stuff, usually regards progress with stuff and things.. So anyone interested in a sort of dev blog type thing: http://www.linkovitc....uk/blog/?cat=3 There are a few posts about the early days of the sound engine, a few penny dropping moments, documented for all history Have you tried it with SMAC? I remember SubQmod found some bugs in MadMac he actually fixed in SMAC. Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted May 14, 2012 Author Share Posted May 14, 2012 Interesting bug. I'm not sure how powerful the macro system is in the assembler but is it possible to put the jump instruction in a macro and then check the alignment of the target address in the macro? If its not aligned correctly then put out a warning. The other solution would be to put an alignment check in the final pass of the assembler source itself. I have had a look at the source of the assembler and the linker and there is no way I am hacking into that mess. I am more likely to write my own assembler and linker (heh) from scratch, shouldn't be that hard. Alas you know what my todo list is like (still growing too :/ ) so until it annoys me enough and I have a hankering for some more C action... Have tried using the alignment operators in the assembler, but seems that these can be bugged too! ah well :/ Have you tried it with SMAC? I remember SubQmod found some bugs in MadMac he actually fixed in SMAC. Yeah, that suffers with the same issues. Quote Link to comment Share on other sites More sharing options...
+DrTypo Posted May 14, 2012 Share Posted May 14, 2012 (edited) That's weird, I'm not getting this kind of behviour when programming the GPU. The jumps are reliable. However I'm only running programs from local GPU RAM. When GPU (or DSP for that matter) is running a program from main RAM, jump instructions must follow a few alignment rules. The rules differs between jump and jr instructions. It also changes whether you're jumping within the same page (2Kb) or not. It's almost impossible to follow theses rules manually. Every code you add may change the alignment and may push the destination of the jump outside the page. SMAC helps you with mjump and mjr pseudo-instructions. I've not written a GPU program running from main RAM so I don't know how reliable SMAC is when it comes to follow the alignemnt rules. Edited May 14, 2012 by DrTypo Quote Link to comment Share on other sites More sharing options...
+DrTypo Posted May 14, 2012 Share Posted May 14, 2012 Here are the rules: http://www.atariage.com/forums/topic/165109-main-code-rules-as-requested-by-others/ Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted May 14, 2012 Author Share Posted May 14, 2012 That's weird, I'm not getting this kind of behviour when programming the GPU. The jumps are reliable. However I'm only running programs from local GPU RAM. Ah sorry, I should have been clearer.. This is in local RAM! I'd expect the wackyness if I was running it in main, but this is in local! It's not just me that has had this happen either, I have had it occur a few times whilst working on the SE. It was just a bit of a note as much for myself as anyone else as I usually find something like this and then forget it! Quote Link to comment Share on other sites More sharing options...
Atari_Owl Posted May 14, 2012 Share Posted May 14, 2012 (edited) I have had this situation arise occassionally.. when the insertion of a 16bit instruction has seemingly messed things up and insertion of a nop to re-align things seems to have fixed it.. despite the presence of .long, .phrase, .dphrase or .qphrase alignements Only very rarely though on the side note of running in main.. yes, manually tracking is a nightmare, i've not really tried it in SMAC as much as i should have as i'd already written a lot of code and the idea of re-writing it is not attractive Edited May 14, 2012 by Atari_Owl 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.
Note: Your post will require moderator approval before it will be visible.