Gury Posted October 21, 2015 Author Share Posted October 21, 2015 Thanks for the info! It comes from official Action! language documentation. I checked it out and it makes sense to me now. Ok, parameter issue is resolved, not it's up to me to make proper updates in Effectus. Quote Link to comment Share on other sites More sharing options...
fujidude Posted October 21, 2015 Share Posted October 21, 2015 Keep in mind, Action by default will try to create storage for variables local to a procedure/function at the start of where it compiles that proc/func to. In such case, the the info passed to it get stored there and not to the CPU registers and page 0. I think it's the @ symbol that instructs Action not to set up storage and instead use the registers and page 0. I would have to look that up though. Quote Link to comment Share on other sites More sharing options...
Gury Posted January 24, 2016 Author Share Posted January 24, 2016 (edited) I haven't read this thread for a while so I need to read all 9 pages ... what's the reason this is dropped in the new release "Custom ASM functions: register y removed from the parameter list" ? Hi, here is new version of Effectus (0.2.2). I have already fixed the problem with machine language routine parameters last year, but I didn't publish new version yet. Now it handles parameters correctly, at least for examples I tested. The thing which does not work correctly yet is calling extra routines inside machine language routines, which will be checked too, of course. Here is an example of new feature: ; CODE BLOCK WITH PARAMETERS EXAMPLE PROC TEST=*(BYTE CURSOR,BACK,BORDER,X,Y,UPDOWN) [$8E 710 ; BACKGROUND COLOR $8C 712 ; BORDER COLOR $8D 752 ; CURSOR VISIBILITY $A5 $A5 $8D 755 ; CHARACTERS UPSIDE DOWN? $A5 $A3 $8D 85 0 ; COLUMN FOR TEXT $A5 $A4 $8D 84 0 ; ROW FOR TEXT $60] BYTE FUNC ADD8=*(BYTE ADD3,ADD4) [ $D8 ; CLD $18 ; CLC $86 $B1 ; STX $B1 $65 $B1 ; ADC $B1 $85 $A0 ; STA $A0 $60] ; RTS CARD FUNC ADD16=*(CARD ADD1,ADD2) [ $D8 ; CLD $18 ; CLC $86 $B1 ; STX $B1 $84 $B2 ; STY $B2 $65 $B2 ; ADC $B2 $85 $A0 ; STA $A0 $A5 $B1 ; LDA $B1 $65 $A3 ; ADC $A3 $85 $A1 ; STA $A1 $60] ; RTS PROC MAIN() BYTE X1 CARD NUM PUT(125) TEST(1,20,30,8,8,4) PRINTE("LOOK, I AM UPSIDE DOWN!") PutE() PutE() X1=ADD8(100,50) Print("100 + 50 = ") PRINTBE(X1) NUM=ADD16(1100,34900) Print("1100 + 34900 = ") PRINTCE(NUM) RETURN Greblus... Linux version please. Thank you! Greetings func_asm.xex Edited January 24, 2016 by Gury Quote Link to comment Share on other sites More sharing options...
greblus Posted January 24, 2016 Share Posted January 24, 2016 Here it is (with mads included) effectus-0.2.2.tar.gz Quote Link to comment Share on other sites More sharing options...
Gury Posted January 24, 2016 Author Share Posted January 24, 2016 Thank you! Quote Link to comment Share on other sites More sharing options...
Gury Posted February 23, 2016 Author Share Posted February 23, 2016 Small update to version 0.2.3 here. Download Current version of Effectus is compiled with Free Pascal 2.6.4. You should use Mad Assembler 2.0.0 for proper cross-linking of Atari 8-bit executables. Greetings 1 Quote Link to comment Share on other sites More sharing options...
greblus Posted February 23, 2016 Share Posted February 23, 2016 Hi Gury. Here's Linux version. W. effectus-0.2.3.tar.gz Quote Link to comment Share on other sites More sharing options...
Gury Posted February 24, 2016 Author Share Posted February 24, 2016 I have overslept Thank you, greblus! It is uploaded. Quote Link to comment Share on other sites More sharing options...
+Spaced Cowboy Posted January 17, 2018 Share Posted January 17, 2018 (edited) So I'm not sure if this forum is still being updated, but as I go through the code for effectus I think I've found a couple of bugs. 1) In core.pas, starting at line 475 (Arrays and pointer detection) for j := 1 to GVarCnt2 do begin if System.Pos(GVar2[j].VarType, 'T5T6T7T8T10') > 0 then Continue; n := System.Pos(UpperCase(GVar2[j].VarName), UpperCase(TextBuf[CurLine])); if (n > 0) and VarDeclCheck(TextBuf[CurLine]) then begin Buffer := Trim(TextBuf[CurLine]); // Comments if System.Pos(';', Buffer) > 0 then begin CodeBuf.Add('; ' + ExtractEx(Buffer, ';', 2, [])); Buffer := ExtractEx(Buffer, ';', 1, []); n := System.Pos(UpperCase(VarTypes[j]) + ' ', UpperCase(Buffer)); if (n < 1) then Continue; end; You can see that 'j' is iterating over the 'GVarCnt2' array, but then is used to reference VarTypes[j] on the third-to-last line. This looks like a cut/paste issue because the section immediately above (Scalar type variables) does iterate 'j' over VarTypes[] and has the same block of code. Perhaps the test for n ought instead to look like: n := System.Pos(UpperCase(GVar2[j].VarType) + ' ', UpperCase(Buffer)); 2) In common.pas, starting at line 191, we have: if (System.Pos('PROC ', UpperCase(TextBuf[CR_LF])) > 0) then begin Buffer := ExtractEx(TextBuf[CR_LF], 'PROC ', 2, []); if System.Pos('=', TextBuf[CR_LF]) > 0 then Buffer := ExtractEx(Buffer, '=', 1, []) else if System.Pos('=*', TextBuf[CR_LF]) > 0 then Buffer := ExtractEx(Buffer, '=*', 1, []) else begin Buffer := ExtractEx(Buffer, '(', 1, []); end; ProcBuf.Add('PROC' + Buffer); end {else begin} It seems to me that the search for '=' on the third line will mean that the search for '=*' (on the fifth line) will never be called, because any occurence of '=*' would have been detected by the search for just '='. Perhaps the order these are tested for ought to be inverted ? I'll also CC: to Gury's email address (I couldn't find anything on the effectus home page, but there's one on http://gury.atari8.info/my_projects.php) Edited January 17, 2018 by Spaced Cowboy 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted January 18, 2018 Author Share Posted January 18, 2018 Thanks, Spaced Cowboy, for pointing out an issue. I will look at it and make some other small updates, but anyway I plan to refactor and recode the whole project from scratch at some point. That's probably a small spoiler now But I encourage you and everyone else to make tests and report bugs if you find them. Greetings 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted February 16, 2019 Author Share Posted February 16, 2019 (edited) Here is experimental version of Effectus with integrated MADS - Mad-Assembler v2.0.8 code, so no extra MADS executable is needed for program to run. I included MADS source code as unit for Effectus and implemented a procedure to call it. I will include sources in next release bundle version. This version is also a minor bug-fix release with my and Spaced Cowboy's fixes. It may be that some example programs in original releases will not work, but all will be fixed later. I hope Tebe will not mind I did this effmads.zip Edited February 16, 2019 by Gury 2 Quote Link to comment Share on other sites More sharing options...
Alfred Posted February 16, 2019 Share Posted February 16, 2019 (edited) Keep in mind, Action by default will try to create storage for variables local to a procedure/function at the start of where it compiles that proc/func to. In such case, the the info passed to it get stored there and not to the CPU registers and page 0. I think it's the @ symbol that instructs Action not to set up storage and instead use the registers and page 0. I would have to look that up though. Not quite right. A/X/Y are always used to hold the first three bytes of parameter data. The rest are stored by the caller at $A3-$AF. Upon entry to the PROC/FUNC the internal procedure SARGS is called to copy the data from where the caller stored it to the local variables of the PROC/FUNC. Using the =* form for a procedure suppresses the call to SARGS and eliminates the initial JMP to the following instruction. Code from the cartridge: ; handle procedure setup here pla bmi seg120 ; system proc ; ; IF IT'S NOT A 'SYSTEM' PROC THEN WE NEED TO GENERATE ; THE CODE TO COPY THE PASSED ARGS FROM ARGS TO THE ; BYTES JUST DECLARED. ; ; get beginning of arguments and ; save actual procedure address lda #1 ; GO GET START ADDRESS jsr cprop ; OF THE PROC sta arg0 stx arg1 jsr gcdoff ; GET CURRENT QCODE jsr stprop ; AND STORE IN SYMTAB ; get space for proc variable lda #$4c ; JMP jsr push1 jsr gcdoff ; fill in address adc #2 ; SKIP THE 2 JMP BYTES bcc seg090 inx seg090 jsr push2 ; AND STORE IN QCODE ; qcode to transfer arguments to ; local frame seg100 lda arbyts ; HOW MANY beq seg140 ; no arguments cmp #3 bcs seg130 cmp #2 lda #$8d ; STA addr16 ldx arg0 ldy arg1 bcc seg110 lda #$8e ; STX addr16 inx bne seg110 iny seg110 jsr push3 ; STORE THE CODE dec arbyts jmp seg100 seg120 jmp seg170 ; SKIP TO SYSTEM PROC seg130 ldx #10 ; GENERATE THE JSR TO 'SARGS' jsr jsrtbl lda arg0 ; STORE THE BYTES ldx arg1 ; INLINE AFTER THE ldy arbyts ; 'JSR SARGS' CALL dey jsr push3 Edited February 16, 2019 by Alfred 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.