tebe Posted December 2, 2013 Share Posted December 2, 2013 (edited) Just stumbled across this one: mva #0 Ds1[0].ReturnCodeThis puts $00 into the proper element of struct Ds1. mva #0 Ds1 [0].ReturnCode However, the second example (note space between struct name and array index) always stores $00 in the first byte of the struct. fixed MADS 1.9.8 build 5 The following code crashes. 65 92E2 A5 8E C9 B7 B0 03 + #if .byte PLAYER0X > #GAME_RIGHT_BORDER 66 92F0 A5 C8 C9 03 D0 05 #if .byte ROOM_X = #WORLD_WIDTH-1 67 92F6 C6 8E DEC PLAYER0X 68 92F8 4C 05 93 #else 69 92FB E6 C8 INC ROOM_X 70 92FD A9 01 85 A0 MVA #1 SCREEN_COMPLETE 71 9301 A9 40 LDA #GAME_LEFT_BORDER 72 9303 85 8E STA PLAYER0X 73 9305 #end 74 ;#else ; Leave this else in, even if it does nothing as the game crashes without it 75 9305 #end for me, works OK try this mads_198b44.zip Edited December 2, 2013 by tebe Quote Link to comment Share on other sites More sharing options...
snicklin Posted December 2, 2013 Share Posted December 2, 2013 for me, works OK It works for me in some parts of my code, but not in every place. Is it because I am crossing a page? I will test your new MADS now, thank you Tebe. Quote Link to comment Share on other sites More sharing options...
snicklin Posted December 2, 2013 Share Posted December 2, 2013 Fantastic, the problem has gone...! With total respect for your FANTASTIC compiler, did you update something, or is it because I've amended my code (but not that section of code)? Either way, it works! Thanks Tebe! Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted December 9, 2013 Share Posted December 9, 2013 2 questions 1) sin generator... how can I build sintables with more than 1 period? 2) XASM related... what does the "+" after the JSR do? I know the post inc/decrement (inserting inx,dex f.e.) but this? can not find in any docu what the +,- after standard commands do (and I have not checked the disassebling). Quote Link to comment Share on other sites More sharing options...
phaeron Posted December 13, 2013 Share Posted December 13, 2013 There seems to be an issue with low/high address byte relocations in .RELOC blocks. MADS supports split address relocations, but this doesn't seem to work for the following common case: .reloc .word foo: ldx #<foo ldy #>foo For this, MADS hardcodes $00 and $01 without relocations. It works if I use zero-page addressing instead of immediate, or if I replace the sequence with MWA. Quote Link to comment Share on other sites More sharing options...
tebe Posted December 30, 2013 Share Posted December 30, 2013 (edited) don't use # if you want low, high ldx <foo ldy >foo Edited December 30, 2013 by tebe Quote Link to comment Share on other sites More sharing options...
phaeron Posted December 30, 2013 Share Posted December 30, 2013 Thanks, that does seem to work... but it's non-standard syntax. How do you encode LDA zp instructions with those addresses in a .RELOC block, then? Quote Link to comment Share on other sites More sharing options...
tebe Posted December 30, 2013 Share Posted December 30, 2013 it's Quick Assembler (QA) standard for <, > default addres mode is # Quote Link to comment Share on other sites More sharing options...
+tzeb Posted January 2, 2014 Share Posted January 2, 2014 Hello tebe, First thanks for mads. It is a powerful tool and it has proved very useful for me. I have a small feature request: could you please increase the pass_max value (to 32 for example) in the next release? I have had some complex sources which required more passes than the standard 16 and that causes some very strange errors. greetings, tzeb Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 5, 2014 Author Share Posted January 5, 2014 How about some way to reference the compile date/time in the source? i.e.: .byte _SYS_DAY,_SYS_MONTH,_SYS_YEAR I had something like this in the assembler I wrote years ago and it was pretty handy. 2 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 7, 2014 Author Share Posted January 7, 2014 .endr without matching .rept n results in compiler aborting with "0,stop" error, instead of something more informative like ".ENDR without matching .REPT". Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 10, 2014 Share Posted January 10, 2014 >How about some way to reference the compile date/time in the source? i.e.: Would love that too! Good idead might be date()/time() functions similar to SIN(). 1 Quote Link to comment Share on other sites More sharing options...
snicklin Posted January 11, 2014 Share Posted January 11, 2014 And it would be nice if the date could either be in byte values or as a string. The string would need to be locali(s/z)ed though. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 11, 2014 Author Share Posted January 11, 2014 don't use # if you want low, high ldx <foo ldy >foo Really? This is very non-standard and ambiguous, surely. LDX <$680 should load the content of $80. Not that such an operation is much practical use, but still... And it would be nice if the date could either be in byte values or as a string. The string would need to be locali(s/z)ed though. Yes indeed. The reason I wanted this was simply to populate six bytes in an executable with the date and time of compilation. Quote Link to comment Share on other sites More sharing options...
snicklin Posted January 11, 2014 Share Posted January 11, 2014 (edited) Yes indeed. The reason I wanted this was simply to populate six bytes in an executable with the date and time of compilation. That would be very useful. In my case, I'd like to have a string which I can load into the screen memory so that it can be seen (though I could use the byte values, I work in automation and like things done for me). It would be a lazy build/release information system. Other ideas: compiler_version() compilation_directory() Edited January 11, 2014 by snicklin Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 11, 2014 Author Share Posted January 11, 2014 Yeah - the other values would be useful too. Bytes are useful to me solely because I use a small printf library (including sprintf) so I can format stuff how I want. Quote Link to comment Share on other sites More sharing options...
tebe Posted January 11, 2014 Share Posted January 11, 2014 How about some way to reference the compile date/time in the source? i.e.: .byte _SYS_DAY,_SYS_MONTH,_SYS_YEAR I had something like this in the assembler I wrote years ago and it was pretty handy. time+date needs SYSUTILS, mads is minimalistic, uses only SYSTEM for time and date i use BUILD http://www.madteam.atari8.info/uzytki/build.7z i use it with Pang, Mads BAT file mads.exe %1 -tpli:"d:\!atari\macro\" @echo off if exist %~n1.inf build %~n1.obx INF file, from Pang BUILD #73 3.5 153 string "BUILD" is marker in executable file, it's begining of memory space for change with BUILD #73 is code for EOL (end of line) string "3.5" is actual version "153" is build number, increases with every start of the BUILD program Quote Link to comment Share on other sites More sharing options...
tebe Posted January 11, 2014 Share Posted January 11, 2014 Hello tebe, First thanks for mads. It is a powerful tool and it has proved very useful for me. I have a small feature request: could you please increase the pass_max value (to 32 for example) in the next release? I have had some complex sources which required more passes than the standard 16 and that causes some very strange errors. greetings, tzeb change this pass_max = 16; // maksymalna mozliwa liczba przebiegow asemblacji compile with FPC // Free Pascal Compiler http://www.freepascal.org/ // Compile: fpc -Mdelphi -vh -O3 mads.pas but 32 passes is strange example, how hang mads (16 passes, 32 passes, 1000000000000000000000000000000 passes) org $2000 ift label<$2080 mwa #$4080 $80 els mva #$40 $80 eif :123 brk label WARNING: Infinite loop by label LABEL Quote Link to comment Share on other sites More sharing options...
tebe Posted January 11, 2014 Share Posted January 11, 2014 .endr without matching .rept n results in compiler aborting with "0,stop" error, instead of something more informative like ".ENDR without matching .REPT". http://mads.atari8.info mads 1.9.8 .endr fixed 1 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 11, 2014 Share Posted January 11, 2014 Hi, @tzeb regarding the 32 passes I also think restructuring the program would be a better idea, also in terms of compilation speed/time. @teba Build is nice for it's purpose but as for the Date/Time functions build does not address what I mean. I'd really like to have the data & time values and also build.exe will not help the MacOX/Linux guys. I'm not so deep into Pascal: What's the deal with SYSUTIL? Size of resulting .EXE? Quote Link to comment Share on other sites More sharing options...
tebe Posted January 11, 2014 Share Posted January 11, 2014 >How about some way to reference the compile date/time in the source? i.e.: Would love that too! Good idead might be date()/time() functions similar to SIN(). SIN is pseudo code. like ORG, OPT, IFT etc. (3 chars) for TIME/DATE pseudo code TIM or directive .TIME TIM(format) format: y-ear, m-onth, d-ay, t-ime dta tim(y) ; 2014 dta tim(m:d) ; 1:11 dta tim(y-mmm-ddd) ; 2014-001-011 or directive: .YEAR, .MONTH, .DAY, .HOUR, .MINUTE, .SECOND .echo .year,'/',.month,'/',.day dta a(.year) with PRINTF jsr printf dta c'date: %-%-%, time: %:%:%',$9b,0 dta a(.year) dta a(.month) dta a(.day) dta a(.hour) dta a(.minute) dta a(.second) which version is better ? 1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 11, 2014 Author Share Posted January 11, 2014 Method b) is absolutely what I had in mind. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 11, 2014 Share Posted January 11, 2014 Both are fine. My preference would be the TIM() function as it keeps the number of directives low and is easyier to extend if we want different output formats. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 11, 2014 Author Share Posted January 11, 2014 Let the coder format the data. Raw bytes can be styled any which way... it's much harder to do the reverse on some already formatted string. 1 Quote Link to comment Share on other sites More sharing options...
+tzeb Posted January 12, 2014 Share Posted January 12, 2014 Hello,@tebeThanks for your reaction concerning my pass_max question. I did figure out how to change it, but I must not forget to patch MADS each time a new version is being released.Perhaps you could consider increasing it in the released code? The number 32 is just an example. The maximum number of passes I have encountered is 18. (I do not know what is supposed to be a 'normal' number of passes?)@JAC!I really don't know how to restructure the program to reduce the number of passes. I use a few .REPT, lots of .LOCAL and lots and lots of @ labels. And the program source is large (>200KB, but the largest part is DTA digital data) 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.