CRTC Pasta assembler

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
NekoNoNiaow
Flight Lieutenant
Posts: 272
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

CRTC Pasta assembler

Post by NekoNoNiaow »

Hello kittens!

Have your heard of the Pasta assembler (https://github.com/crtc-demos/pasta)?
I just found it while browsing the CRTC GitHub projects.

Its syntax is inspired by xa65's (which most people here are familiar with I recon) and adds a very nice automatic zero page register allocation feature.
The Readme.md file on the link above has more details but this spares the programmer from having to manually hardcode the zero page memory locations they want to use in their routine: each routine can declare the names of the pseudo zero-page registers it wants to use and they will be automatically allocated in the zero-page, even apparently taking into account potential overlap by routines which call one another. When the registers are not needed anymore upon returning from a routine, it is capable of allowing other routines to use them.

I guess this can be very handy when tuning assembly sources since keeping tracks of which zero-page addresses are available at a given point of a program can be tricky when multiple functions use them.

Edit: Oops, I initially mistakenly attributed it to BitShifters (the group which recently ported Stunt Car Racer to the BBC. ;)
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: CRTC Pasta assembler

Post by Dbug »

NekoNoNiaow wrote: Tue Apr 09, 2019 3:18 am Its syntax is inspired by xa65's (which most people here are familiar with I recon)
It is not, by far.

The only common thing is that it uses the 6502 conventions that most assemblers have agreed on regarding immediate, addresses, hexa, etc...

What is different from XA:
- .org instead of *
- .scope instead of .( and .)
- .byte instead of .byt
- .macro instead of #define

using that instead of XA would mean a massive rewrite of basically every single program you want to rebuild with it.
and adds a very nice automatic zero page register allocation feature.
That's actually not a bad idea, basically an auto allocation of memory addresses specified in a range at scope level.
Pasta is supplied as source code. Compile by typing 'make'. Prerequisites for building include:
- OCaml (I'm using 3.11.2, other versions may work too).
- ocamldsort
- Menhir
- GNU Make
That's an unusual choice of language to say the least :)
User avatar
Chema
Game master
Posts: 3014
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: CRTC Pasta assembler

Post by Chema »

Dbug wrote: Tue Apr 09, 2019 7:42 am
- .scope instead of .( and .)
The .( and .) for scoping is probably the best feature of XA! at least for me! I use it nearly all the time as a way to delimit my functions (such as braces in C), even when I am not using local labels. Being able to use "loop" in all my loops is priceless :)

That and the C preprocessor compatibility, of course (#include, #ifdef, #define,...)
User avatar
NekoNoNiaow
Flight Lieutenant
Posts: 272
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

Re: CRTC Pasta assembler

Post by NekoNoNiaow »

Dbug wrote: Tue Apr 09, 2019 7:42 am [the syntax, inspired by xa65]
It is not, by far.
I do not know XA's syntax too well but I guess that is why the author said "inspired by" rather than "identical to". ;)
Dbug wrote: Tue Apr 09, 2019 7:42 am What is different from XA:
- .org instead of *
- .scope instead of .( and .)
- .byte instead of .byt
- .macro instead of #define

using that instead of XA would mean a massive rewrite of basically every single program you want to rebuild with it.
Actually, it does also support .( and .) for scoping.
I initially thought the other three points could be remedied with aliases but their syntax must be of the form ".alias <label> <label-or-num>".
I guess a preprocessing pass would be needed to convert XA syntax into pasta's.
Dbug wrote: Tue Apr 09, 2019 7:42 am
and adds a very nice automatic zero page register allocation feature.
That's actually not a bad idea, basically an auto allocation of memory addresses specified in a range at scope level.
Yup, a very fluffy feature.
Dbug wrote: Tue Apr 09, 2019 7:42 am
Pasta is supplied as source code. Compile by typing 'make'. Prerequisites for building include:
- OCaml (I'm using 3.11.2, other versions may work too).
- ocamldsort
- Menhir
- GNU Make
That's an unusual choice of language to say the least :)
I like it! ;) When I started looking into replacing opt65 some time ago I thought of using Haskell to write my own. :D
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: CRTC Pasta assembler

Post by Dbug »

NekoNoNiaow wrote: Wed Apr 10, 2019 2:38 am I like it! ;) When I started looking into replacing opt65 some time ago I thought of using Haskell to write my own. :D
Sure, but I will not accept any non C or C++ programs in the OSDK.
Despite all its quality, Waskol's program was in Delphi, and that was annoying to integrate in the system, could not get Coverity to validate it, could not compile it myself, could not debug it.
Post Reply