Jump to content
Gury

Effectus - Action! cross-compiler using Mad-Assembler (MADS)

Recommended Posts

Here is new version of Effectus (0.3).

 

Mad-Assembler (MADS) is now integrated into Effectus program, the version used is 2.0.8. There are some other changes, including program parameters changes.

Planned is further code revision to maintain even better Action! compatibility. It would seem like there were no significant changes, but this is a start.

 

Unfortunatelly, currently pointers are of no use, but this will be fixed. Also, programs are compiled and assembled in the root directory of Effectus program. This will also be fixed later.

 

The program is compiled with Free Pascal 3.0.4.

 

The command in the console to compile the code:

fpc -Mdelphi -vh -O3 effectus.pas
Edited by Gury
  • Like 12

Share this post


Link to post
Share on other sites

Effectus (0.4 Beta R1). Download is below the post.
 

This is new version of Effectus, done from scratch. It is very different from previous versions, because I took new approach to generate code. It is kind of a new branch of Effectus. Currently only Windows platform is supported, but other platforms will be supported later.

 

The most important thing taken as consideration was properly handling of Action! statements (declarations, commands, assignments...) and multi-line support. There are some cases in which this still doesn't work, but it will be fixed. Next most important change is the way code is generated. I took Mad Pascal as basis for generating source code listings, which are further compiled to binary code with Mad Assembler (Mads). Many thanks to Tomasz Biela (Tebe), author of these great tools. He made this all possible!

 

The steps are as follows:
- Action! code is parsed and appropriate Mad Pascal source code listing is generated
- Mad Pascal compiles this code to *.a65 file prepared for compilation by Mad Assembler
- Mad Assembler compiles *.a65 file to final binary code (*.obx)

 

examples directory includes working examples, which can be basis of your further experimentation.

Effectus is currently kind of Lite version what it is doing now :)

 

effectus01.png.ab676ec96f458224846ab93537753829.png effectus02.png.824794ace15099251e150750f482b14e.png effectus03.png.f61b214dc3934dca39ac95622953cc06.png 


Currently supported are:
 

// Data type structures

BYTE, CHAR, INT, CARD

 

// Complex data type structures

BYTE ARRAY, CARD ARRAY, POINTER
SBYTE ARRAY as temporary solution for BYTE ARRAY string definitions

 

- Variable memory address assignments are supported

 

Examples:
BYTE CH=764, COL=710, BYTE GRACTL=$D01D 

 

// PROCedures

PRINT, PRINTE, PRINTB, PRINTBE, PRINTI, PRINTIE, PRINTC, PRINTCE, PRINTF
PUT, PUTE
GRAPHICS, PLOT, DRAWTO, POSITION, SETCOLOR
POKE, ZERO, SETBLOCK, MOVEBLOCK,
SOUND, SNDRST
STRB, STRC, STRI, SCOPY, SCOPYS, INPUTS

 

- Custom procedures are supported (but currently with no parameters)

 

- Memory address calls through PROCedures are supported (OS calls can be accomplished)

 

Examples:
; Scroll screen
PROC SCROLL=$F7F7()
; Cassette-beep sound
PROC BEEPWAIT=$FDFC(BYTE times)

 

// FUNCtions

PEEK, PEEKC, RAND, VALB, VALC, VALI, STICK, STRIG, GETD, INPUTB, INPUTC, INPUTI

 

// Conditions/branches

IF/THEN/ELSE, FOR, WHILE, UNTIL branches supported
(there may be some issues in some cases)

 

// Inline machine language

It's supported directly in the body of code listing

Examples:
[$A9$21$8D$02C6$0$60] 

[
 $A9$90
 $3E$02C6 $0 $60
]


// Effectus directory structure

 

- root directory: effectus.exe, mads.exe, mp.exe, LICENSE-mads-mp, readme.txt, test.bat
- examples: Action!/Effectus examples
- base: Mad Assembler library directory
- lib: Mad Pascal library directory

 

Command prompt execution:
effectus <filename> <parameters>

 

Currently only -i flag is added (program information about variables and custom PROCedures)

Filename to be compiled can be on any selected path, but resulting code is generated in
root Effectus directory


// What is missing?

A lot! But things will be added in later releases.

Not supported:
  - PROCedure parameters
  - custom FUNCtions
  - file operations and device operations (Except GetD which accepts dummy parameter, which can be
    used as a routine to wait for a key press, f.e.: key=GETD(7))
  - graphics:
    - Fill procedure
    - printing text to graphics screen (f.e.: PRINTD(6, "hi, there"))
  - TYPE definition
  - INCLUDE files
  - DEFINE definition
  - Declaring array variables pointing to memory address (f.e.: BYTE ARRAY arrD=28000)
  - PrintF showing % sign
  - No proper error handling is done yet, so it happens that no errors show on the screen even if
    something went wrong
  - Log files are not created
  - ...


// Weird stuff
 

- SASSIGN is currently defined as SCOPYS procedure
- BYTE ARRAY definition for using as string holder must be declared as SBYTE ARRAY
- Declaring variables allows freedom, but some considerations must be taken. For example,
  you are not allowed to do things like this:  
  BYTE n1,
       n2

  Proper syntax is  BYTE n1, n2 

  or

  BYTE n1

  BYTE n2

       
  or declaring display list like this:
  byte array ndl=
    [112 112 112 66 64 156 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 86 216 159 65 32 156]    
  Proper syntax is  
  byte array ndl=[112 112 112 66 64 156 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 86 216 159 65 32 156]
  
  All this will be fixed at some point!


 

effectus04.png

effectus04DemoR1.zip

  • Like 10

Share this post


Link to post
Share on other sites

New version 0.4 Demo R2

 

- DEFINE declaration (constant substitutions for any statements)

- Limited file and device manipulation
  - printing to text modes by using PrintD and PrintDE is allowed

 

- Conditions and branches

  - IF/THEN/ELSE, FOR, WHILE, UNTIL branches
  - infinite loop DO OD
  - EXIT statement to force exit from the branch

 

- Graphics Fill procedure (has to be tested, it behaves differently from Action!)

 

- Command prompt:

  Two options are available:

     -i   program information about variables and custom PROCedures
     -o: object code extension

 

Now object code with xex extension is generated automatically.

 

Bug fixes:

  - IF THEN condition accepts ARRAY element variable (f.e. if FLAGS(I)=1 then))
  - IF THEN condition accepts special atascii assignment (f.e. IF FLAGS(I)='T THEN)
- Fixed determining increments and decrements by one

- Better handling of space delimiter in variable declarations, statements, assignments, PROCedure/FUNCtion calls...

 

Now it is possible to declare variables this way:

BYTE PMBASE=$D407,
     SDMCTL=$22F,
     GRACTL=$D01D,
     PCOLR0=$2C0,
     RAMTOP=$6A

 

Below are some examples showing new and old features. Also, program listing Sieve from the article Review Action in ANALOG Computing #16 compiled with Effectus.

 

eff_hi_atariage.png.d8324119f1eff546f21df7bcf1cf6344.png

 

 

effectus04DemoR2.zip pmgdemo.xex fs.xex sieve.xex butterfly_w1k.xex triangle.xex gr9.xex hi_atariage.xex

  • Like 4

Share this post


Link to post
Share on other sites

New version 0.4 Demo R3

 

- Custom FUNCtions

- TYPE declaration

- Bitwise operation support: AND (&), OR (%), XOR (!), LSH (left shift), RSH (right shift)

- MOD (modulus) arithmetics operation

- SCompare function for comparing two strings

- While branch accepts ARRAY element variables
- ELSEIF condition
 

Description, rules and bugs are described in readme.txt file in the package.

 

Attached are some examples:

- TYPE declaration demo

- Ship (graphics demo) by pedgarcia (link)

- Butterfly demo (original program from here)

 

effectus04DemoR3.zip type.xex ship.xex butterfly.xex

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

New version 0.4 Demo R4
 

Release highlights:

 

- PROCedure and FUNCtion parameters can be mixture of any scalar data type (BYTE, CARD, INT, CHAR)
- BYTE/CARD ARRAY declaration as direct memory assignment (f.e. CARD ARRAY arr=$8000)
- Added missing routines: Paddle, PTrig, Locate, SAssign
- PrintF output:
  - percent sign (%) support
  - Dollar sign ($) added to the hexadecimal value
- Mad Pascal source code listing output:
  - Graph unit added just when graphics procedures are used (including global variable color for setting new color)
  - unused StrUtils unit removed
- Shell command prompt:

  - log file is created at compile time
  - information about compile success (including error message in case error occurs in generated Mad Pascal listing caused by Effectus)
  - new option (-c) added to clear sum log file

  - option (-i): some data and layout changes
- TYPE declaration rules improved
- Better handling of equal character (=) in comments

- IF condition:
  - check for bitwise operators in variable comparison
  - check for DEFINE constants

- New examples

 

Effectus with description and download resides on temporary site here.

 

 

printf.xex arrmem.xex arrmemc.xex procs.xex func.xex

Edited by Gury
  • Like 4

Share this post


Link to post
Share on other sites

Thank you! I am open for any suggestions and questions about the project.

 

  • Like 1

Share this post


Link to post
Share on other sites

@Gury 

I am currently participating in @tdc Action! workshops and I'm going to use this programming language in the future.

Effectus would be a big step for me in programming on the A8, and freeing myself from Action's limitations.

If you share the source or compilation for Linux, I will gladly report bugs or suggest changes.

Share this post


Link to post
Share on other sites

That's great to hear. I plan to release sources, but before that I will add some more features and fix some bugs. The goal is to make it more stable than previous versions and make new features, plus maintain code more quickly. Using Mad Pascal makes it all possible, not doing all routines from scratch (in assembler).

 

  • Like 1

Share this post


Link to post
Share on other sites

Nice to see text editor syntax highliting for Action!

 

New version before going from Beta stage is here: 0.4 Beta R5

 

- Machine language support in custom PROCedures and FUNCtions
  (currently, function returns a 0 as result - to be fixed)
- Better support for regular expressions:
  - mixing of operators (f.e. hundreds = ((jifs MOD 60)*100)/60)
  - indication of BYTE ARRAY or CARD array variables (f.e. sum = n + arr(1))
- InputSD, InputMD procedures support
- EOF (end of line) variable support in IF, WHILE and UNTIL branch conditions
- Bug fixes:
  - correct assignment of read value from GetD function to a variable
  - PrintDE, PrintBDE, PrintCDE, PrintIDE: correct handling on new line ($9b) character

- New examples

 

Action!/Effectus source code listing can reside on any path and resulting code is now also generated there.

 

Source code will be released with next version!

 

Example of machine language in PROCedure:

 

proc_asm.png.51c811e631f134c09582d69abc38ce15.png

 

CHAR KEY

PROC PokeTest=*(BYTE d)[$8D $02C6 $60]

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]
 
PROC Main()
CARD n1, n2, n3

Put(125)
PrintF("%EPress any key to see some effect!%E")
KEY=GETD(7)

TEST(1,20,30,8,8,4)
PRINTF("LOOK, I AM UPSIDE DOWN!%E")

PrintE("Press any key again!")
KEY=GETD(7)
PokeTest(144)
KEY=GETD(7)

RETURN

 

  • Like 2

Share this post


Link to post
Share on other sites

Thanks!

It will be the basis of what will be enhanced later. Don't expect anything special from the source, it will grow with your help by experimenting with Action! listings to find issues, which will be eventually resolved. Anyway, source code will help to be ported to Linux and probably Mac platform. There are and will be cases where more work will have to be put in to resolve the special cases from Action! syntax.

 

  • Like 2

Share this post


Link to post
Share on other sites

@Gury - great project! It would be great when macOS toolchain is ready - then I will be able to prepare SublimeText plugin to integrate it in build process.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, Gury for your great work! Many people here, in Poland, are cheering for your project because the programming workshops in Action! is just conducted by TDC. This is a person who has been creating Action! games continuously for over 30 years. At the moment, every day for 3 hours about 25 people take part in the workshops. This is a total of 33 hours of learning, and a week ahead us! 

You can take advantage of this interest in Action! because now people can report Action! issues to you freshly, as well as submit ideas for additional features in the Effectus. The discussion continues in this thread:
http://atarionline.pl/forum/comments.php?DiscussionID=5345&page=7#Item_18

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

Great news! New motivation to finish my game project written in Action!, including Assembler and a little Turbobasic.

In fact, most was done by JAC!

But unfortunately he is sooo busy with a quadrillion other projects, I should take action(!) myself now.

 

Thank you very much for this cool project!

Edited by Tigerduck
  • Like 1

Share this post


Link to post
Share on other sites

Finally from work... Thanks all.

 

7 hours ago, Kaz atarionline.pl said:

Thanks, Gury for your great work! Many people here, in Poland, are cheering for your project because the programming workshops in Action! is just conducted by TDC. This is a person who has been creating Action! games continuously for over 30 years. At the moment, every day for 3 hours about 25 people take part in the workshops. This is a total of 33 hours of learning, and a week ahead us! 

You can take advantage of this interest in Action! because now people can report Action! issues to you freshly, as well as submit ideas for additional features in the Effectus. The discussion continues in this thread:
http://atarionline.pl/forum/comments.php?DiscussionID=5345&page=7#Item_18

Hi Kaz, great to see discussion topic, I will visit it. That will make testing faster and all suggestions are welcome.

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

New version 0.4

 

- Support for TYPE records (example attached)

- Source code released

 

The program resides on the following link.

 

Currently, win32 platform is supported. Other platforms will be supported with your help. Actually, Windows 64-bit version can be prepared by me.

 

So, Greblus, Zbyti, work for you...

MacOS version should be prepared by Mariusz Buk.

 

Some info for future development...

- DEFINE support will be enhanced by using 2-pass parsing method. This should include also INCLUDE statements.

- Answers bring another 100 questions and problems... I already have ideas to fix current program

 

Enjoy!

 

recs.eff recs.xex effectus04-x86-win32.zip

Edited by Gury
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...