gz0000 Posted May 27 Share Posted May 27 On 5/20/2023 at 2:53 AM, danwinslow said: Ah. Ok, thanks. The guy asking about it seemed to have some expectation of it working that way, so I kind of thought it was supposed to. Maybe it's kind of a language hole, and only works in variants that MadPascal is not implementing. Yes, I assumed that local variables are initialized every time you call a function, but it seems local variables in (Mad) Pascal act more like static local variables in C language. I like Mad Pascal. It makes me more productive. 5 Quote Link to comment Share on other sites More sharing options...
tebe Posted August 16 Author Share Posted August 16 v1.6.8 https://github.com/tebe6502/Mad-Pascal https://github.com/tebe6502/Mad-Pascal/blob/master/samples/tests/tests-record/recordtest.pas recordtest.zip 1 3 Quote Link to comment Share on other sites More sharing options...
Atlan_Roland Posted August 17 Share Posted August 17 (edited) Hi Tebe, thank you very much for the compiler update! Woke me up to restart some A8 coding after summer break Recompiling my project with 1.6.8 gave me an error with "mod", which did not happen under 1.6.6. It looks like a 'mod 16' (or 2,4,8,..) produces a 'jsr #$00' . line 1288: textline[13]:=chr(33+w1 mod 16); --> RTLIB: $22AB..$29D3 jsr #$00 BRIT.a65 (12562) ERROR: Illegal addressing mode (CPU 6502) The corresponding code in .a65 @ line 12562: ; optimize OK (BRIT.PAS), line = 1288 lda GLOBALS.W1 and #$0F jsr #$00 lda #$21 add @BYTE.MOD.RESULT sta adr.TEXTLINE+$0D for context: [..] 'u' : begin // Use sextant textline:='Use-sextant'~; write_text; if night < 50 then begin xms_textline(103); // Only xms_textline(105); // at night! end else begin xms_textline(101); // Position: Y"y' X"x' w1:=byte(my*16)+ay_m; w2:=byte(mx*16)+ax_m; textline[11]:=chr(33+w1 div 16); textline[13]:=chr(33+w1 mod 16); //rogi@2023.08.17: new compiler error?? textline[16]:=chr(33+w2 div 16); //textline[18]:=chr(33+w2 mod 16); rogi@2023.08.17: new compiler error?? end; end; [..] Edited August 17 by Atlan_Roland Quote Link to comment Share on other sites More sharing options...
tebe Posted August 17 Author Share Posted August 17 3 hours ago, Atlan_Roland said: jsr #$00 BRIT.a65 (12562) ERROR: Illegal addressing mode (CPU 6502) fixed 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted August 19 Author Share Posted August 19 (edited) Mad Pascal 1.6.8 https://github.com/tebe6502/Mad-Pascal/releases/tag/v1.6.7-1.6.8 Edited August 19 by tebe 5 Quote Link to comment Share on other sites More sharing options...
Gury Posted August 20 Share Posted August 20 What a release! Thank you for the new version, making it the most powerful Atari 8-bit cross-platform development tool besides MADS. Other tools are also great, of course, but this is true masterpiece. 1 Quote Link to comment Share on other sites More sharing options...
tebe Posted August 21 Author Share Posted August 21 MP newest version, new features https://github.com/tebe6502/Mad-Pascal/tree/master - improved memory allocation for arrays [0..0], 'ABSOLUTE $0000' is enforced initially, 1 byte of memory is saved - added possibility to declare arrays without specifying their size, e.g.: tab: array of byte = [1,3,4,3,1]; tb: array of char = 'abcdefghij'; - new compiler directive {$bin2csv filename} allows you to initialize arrays e.g.: tb: array of byte = [ {$bin2csv filename} ]; https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/bin2csv 3 Quote Link to comment Share on other sites More sharing options...
Atlan_Roland Posted August 23 Share Posted August 23 Hi Tebe, in MP 1.6.8+, the usage of a pstring variable as parameter to unzx0() does not work anymore. (compiles, but the unzx0ed datastream seems to get written unpredictably into memory, at least not in the specified target adress). The same workes fine with MP1.6.6 though. Has there been any change in usage of pstring that i'm missing? Attached the .a65 outputs of MP 1.6.6 and MP 1.6.8 of given code below. If you should need more data tell me. Thank you for all your efforts with mp! 👍 program test_mp_1_6_8; uses crt,zx0; const IMPORT = $5000; var i : byte; fname : pstring; begin fname:='D:RESOURCE.ZX0'; unzx0(fname, pointer(IMPORT)); // was fine MP 1.6.6, but not anymore in MP 1.6.8 ? //unzx0('D:RESOURCE.ZX0', pointer(IMPORT)); // to verify, works fine if the filestring is given directly. gotoxy(1,1); for i:=0 to 39 do write(chr(peek(IMPORT+i))); repeat until false; end. testcode_mp_1.6.6.a65 testcode_mp_1.6.9.a65 Quote Link to comment Share on other sites More sharing options...
tebe Posted August 23 Author Share Posted August 23 2 hours ago, Atlan_Roland said: fname : pstring; fname: string[16]; 1 Quote Link to comment Share on other sites More sharing options...
JAC! Posted August 26 Share Posted August 26 On 8/21/2023 at 11:37 PM, tebe said: - improved memory allocation for arrays [0..0], 'ABSOLUTE $0000' is enforced initially, 1 byte of memory is saved - added possibility to declare arrays without specifying their size, e.g.: tab: array of byte = [1,3,4,3,1]; tb: array of char = 'abcdefghij'; - new compiler directive {$bin2csv filename} allows you to initialize arrays e.g.: tb: array of byte = [ {$bin2csv filename} ]; https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/bin2csv I'm a bit confused about the name "$bin2csv". I'd expect CSV means "Comma Separated Values", so read a "1,2,3" text file. But this looks like a "bin2bytearray," e.g. INS in MADS. ?! Quote Link to comment Share on other sites More sharing options...
tebe Posted August 26 Author Share Posted August 26 https://github.com/t-edson/P65Pas Tokenizer sees this as "Comma Separated Values." Quote Link to comment Share on other sites More sharing options...
tebe Posted August 27 Author Share Posted August 27 (edited) MP logo https://github.com/tebe6502/Mad-Pascal/tree/master/logo G2F version with improved graphics that fit on 1 character set Edited August 27 by tebe 2 1 Quote Link to comment Share on other sites More sharing options...
JAC! Posted August 27 Share Posted August 27 On 8/26/2023 at 11:15 PM, tebe said: https://github.com/t-edson/P65Pas Tokenizer sees this as "Comma Separated Values." I see, this this is actually a compile-time expression that resolves into source; not a binary include directive. 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.