bread80, to random
@bread80@mstdn.social avatar

I've renamed the EXTERN directive to CALL. That feels a lot more logical given it's function (to call assembly code such as ROM routines).

It also makes it straightforward to implement an RST directive to call assembly via a Z80 RST instruction.

(In the screenshot I've cleaned up the comments in the output to make it easier to read.)

#Quiche #compiler #Z80 #Delphi

bread80, to random
@bread80@mstdn.social avatar

update: Write and writeln marks the end of the the refactoring of operations and primitives which has taken up the last few months.

I've also refactored a few other parts to better future proof them.

There a still a few rough edges to smooth off in the expression parser (implicit types) and code generator (parameter loading and validation).

But this means I can now return to interesting stuff :) as well as moving towards some kind of initial (pre-beta) release.

Output if the test program running on an Amstrad CPC emulator.

mivg, to koba German

Weil's so schön und lecker war, heute gleich noch mal (leicht veränderte Rezeptur).
Außerdem haben wir ja gestern das meiste an die Meute verfüttert. 🙂


@koba

Diesmal ist der Parmesan obendrauf, nicht drin.

Friedante, to vegan German
@Friedante@troet.cafe avatar

Guten Abend Zusammen,

heute bei uns eine mit Spinat und Bärlauch und dazu glasierter . 🤤

Wir sind dann mal im Fresskoma. 😁

bread80, to random
@bread80@mstdn.social avatar

I apologise for not posting this earlier.

#Quiche #compiler is now alive! (At least Conway's variant of alive). The initial version was slow - about four seconds per generation. It was multiplying coordinates for each cell read and write.

The second variant uses offsets into each liner buffer, and only redraws changed cells. It's now running at three to four generations per second.

#Pascal #Z80 #Amstrad

The next generation of the glider.

bread80, to random
@bread80@mstdn.social avatar

This week I added the Peek() and Poke() intrinsics to the . That means I can now write my first non-trivial program.

I spend this morning fixing a few bugs in the parser and code generator and it's successfully generating the assembler file.

The assembler is choking on a couple of issues with identifiers, and the output code has a couple of bugs to do with parameter parsing and result processing.

Very close to working <g>

A section of the output assembler code.

bread80, to random
@bread80@mstdn.social avatar

I'm looking to optimise the primitive selection routine in . Currently it searches the table of available primitives multiple times until it finds a match, each time 'expanding' the types of the parameters. It's slow and it's messy.

My new plan is to calculate a 'fitness' value for each primitive using the type(s) of the input parameters. It's taken me three days just to work out how to create a spreadsheet to calculate and verify the values.

bread80, to random
@bread80@mstdn.social avatar

All of the operators are now passed over to the new data tables and primitive search. I'm moving onto intrinsics. These are small routines with function-like that often generate inline code, such as peek, inp and sizeof.

Many of these have quirks such as accepting multiple types, or a typedef. The quirk of Abs is unsigned values: in doesn't affect them. I could raise an error but it's nicer to fake the data to not generate any code.

An extract from the primitives spreadsheet. The row for Integer type is normal. The next two rows are for Byte and Word input types. The 'Proc' column contains 'empty' which signals the code generator to not generate any code.

Athenenoctua, to random French
@Athenenoctua@mastodon.gougere.fr avatar

A midi, au bacon avec un ❤️ de noire 😋

bread80, to random
@bread80@mstdn.social avatar

I just merged my Z80 emulator into the compiler project. It can now run the compiled code without having to shell out to a separate program.

I'm wishing I did this ages ago. It wasn't nearly as hard as I thought it would be. At the moment it doesn't make any 'real' difference but it will make it possible to breakpoint, single step and modify in situ.

bread80, to random
@bread80@mstdn.social avatar

Before Christmas I decided the needed two big refactorings. The first is nearly done: the data tables for operands and primitives.

The OG version had grown confusing due to some poor initial decisions. It also put too much intelligence into the parser regarding the available types for each operator.

The new version allows the parser to scan the table to confirm if an operator can handle the operator types. It can also 'expand' types to find a match...

bread80, to random
@bread80@mstdn.social avatar

I've been itching to make some more progress on the . I'm working to finally get function calls up and running.

I now have the function dispatch code for stack based calls, and the parameters are being added to the variables list for the function so the function body can use them.

But I can't actually test any of this until I tackle the horrors of the stack frame set up and tear down code. Wish me luck.

The generated code for the function body. Parameters are loaded using IX+ offsets. Local variables from IX- offsets.

ottaross, to random
@ottaross@mastodon.social avatar

A bit of a cooking afternoon today. I bought some marzipan for Xmas baking use last year, but never got around to using it

The package says "use within a year of purchase," so the clock has been ticking. Being the end of apple season, I've decided to builtld an apple & marzipan . That's baking now.

Hope it's successful, I've still got half that marzipan. Might try some choco-marzi cookies someday soon too.

ottaross,
@ottaross@mastodon.social avatar

The oven was hot already for @skatem's efforts. She made this delectable-looking for supper tonight. Should be tasty!

bread80, to random
@bread80@mstdn.social avatar

Adding a config file to the so I can store settings between sessions. Very handy now I'm getting towards being able to write useful code.

I figure at some point the settings will be at the project level, allowing different settings per project. And a command line compiler would be able to accept a config filename as a parameter.

bread80, to random
@bread80@mstdn.social avatar

Looks good to me <g>.

The procedure declarations are importing operating system routines. For the calls in the body the compiler is marshalling data into the required registers.

Once I have includes working you'll be able to use library files for the imports.

And you can call pretty much any assembler code using this.

And the source code: [Corrupts AF, BC, DE, HL] procedure SCR_SET_MODE(Mode: A); extern $bc0e; [Corrupts AF, BC, DE, HL] procedure GRA_MOVE_ABSOLUTE(UserXCoordinate: DE;UserYCoordinate: HL); extern $bbc0; procedure GRA_SET_PEN(Ink: A); extern $bbde; [Corrupts AF, BC, DE, HL] procedure GRA_LINE_ABSOLUTE(UserXCoordinate: DE;UserYCoordinate: HL); extern $bbf6; var x: Pointer begin SCR_SET_MODE(0) for x:=0 to 64 do begin GRA_SET_PEN(x) GRA_MOVE_ABSOLUTE(x

ablueboxfullofbooks, to 13thFloor
bread80, to random
@bread80@mstdn.social avatar

I'm working towards dispatching function calls in the

I'm starting with a register based calling convention. It saves me from dealing with stack frames, and will allow calls assembly routines - especially OS routines.

But it means loading lots of values into registers, then saving return values. My IL code data structure needs some updates for this scenario.

(Whereas stack frames should just need data pushing on the stack).

deepbluemetal, to random
bread80, to random
@bread80@mstdn.social avatar

I have accidentally invented meta programming :)

Some compiler routines such as sizeof() need to be able to handle a type name as a parameter, for example sizeof(Integer).

I've added a type called TypeDef to handle this. When the parser hits an identifier which is a type name but not a typecast it returns a value of type TypeDef.

schizanon, to breakfast
@schizanon@mas.to avatar

is a .

It's got eggs and in it; it's basically a .

@cooking

bread80, to random
@bread80@mstdn.social avatar

Almost all the code generation is table driven. Inc and Dec are one of the exceptions that require code. In this case it's a loop to generate the INC or DEC instructions.

Only thing left to do is to generate add or subtract if the offset is too large. For now I'm stabbing at doing this for offset greater than four. Optimising here is much more complex than it might seem. For example you can INC any register whereas ADD requires A.

bread80,
@bread80@mstdn.social avatar

The Odd operator is beautifully easy after Inc and Dec. I've highlighted to two instructions for the Odd itself and the CPL for NOT. Ignore the references to temp0 which will get optimised away at some point.

Note how the allocator is smart enough to only load the low byte of the 16-bit variable.

I think I'll also add a version that targets a branch. It'll be a lot shorter if optimised.

bread80, to random
@bread80@mstdn.social avatar

I'm working my way through 'intrinsics' in the . These are operations that look like functions or procedures to the programmer but are generated inline code. Examples are Write, Inc, Peek, Poke, Inp, Out, Sizeof and High.

Support for these includes adding an 'Enumerable' type set for the parameters and some flags. Inc and Dec can only accept a variable reference as the first parameter and a constant as the optional second parameter.

bread80, to random
@bread80@mstdn.social avatar

I'm adding typecasts to the . This is the next step toward full function support. In typecast syntax is the same as a function.

b := integer(a);

This gives me the hooks I need to call functions within expressions and handle the return value. But typecasts generate inline code so I don't have to do stack frames yet.

deepbluemetal, to random

Spinach Caramelized Onion and Feta - Recipe Girl https://www.recipegirl.com/spinach-caramelized-onion-and-feta-quiche/

Arankincy, to food

Had (another) go at baking a Quiche.

And since it's the start of asparagus season in germany I went for a Tomato-Asparagus Quiche :blobcat_mlem:

Served with fresh arugula :ablobcatbongo:

Unbaked quiche with green asparagus and cocktail tomato filling.
Baked quiche with green asparagus and cocktail tomato filling.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines