Page 2 of 2

Paul's Various Languages for the X16

Posted: Fri Nov 27, 2020 11:58 pm
by desertfish

Here's the result of my Prog8 port of the balls.bas program as found in the commanderx16 x16-demo git repository.

Original basic source: https://github.com/commanderx16/x16-demo/blob/master/basic/balls.bas

Prog8 version: https://github.com/irmen/prog8/blob/master/examples/balls.p8

 It draws 1000 frames and then prints the time taken in jiffies (1/60 sec), which turns out to be about 90 frames/sec.  Was pretty fun to port the program and see it whizz by on the screen.  It's a lot slower on the C-64 but still fun to watch on that machine too.




Paul's Various Languages for the X16

Posted: Sat Nov 28, 2020 10:58 am
by paulscottrobson

Nice. It's done almost entirely in bytes which probably amounts for most of the difference, everything in AMORAL is words. I did experiment with various ideas, including bytes only languages (there are some) and autoswitching on demand, but it was just too messy ? The only one that worked was an 8 bit FORTH on FRED (the Cosmac Elf prototype sort of) and that machine had only 1k of RAM.


Paul's Various Languages for the X16

Posted: Mon Jan 10, 2022 3:47 pm
by paulscottrobson


On 11/10/2020 at 5:35 PM, rje said:




https://github.com/paulscottrobson/lean   "The 3rd, and hopefully final, version of a terse like language for the 65C02"



 



Lean appears to be a bizarre utility for handling 16 bit integers in local compilation.  Or something.  Quote:



Lean is basically a macroassembler that *only* does macros.

So every action you need is defined as a macro (and some structure, and procedures are provided). So you define your own assembler instructions and register and lean converts it into the target CPU. Lean as implemented chooses something close to the 6502 (e.g. treating XA as a faux 16 bit register) for efficiency. Much of it is 1:1 so y++ maps to iny for example.

 


Paul's Various Languages for the X16

Posted: Mon Jan 10, 2022 7:50 pm
by TomXP411


On 1/10/2022 at 7:47 AM, paulscottrobson said:




Lean is basically a macroassembler that *only* does macros.



So every action you need is defined as a macro (and some structure, and procedures are provided). So you define your own assembler instructions and register and lean converts it into the target CPU. Lean as implemented chooses something close to the 6502 (e.g. treating XA as a faux 16 bit register) for efficiency. Much of it is 1:1 so y++ maps to iny for example.



I like the idea of a meta-assembler. I've been knocking around a similar idea myself, but just can't find the time for the thousand things I'm trying to learn and do all at the same time.