flat assembler
Message board for the users of flat assembler.

Index > Programming Language Design > Ground language uses FASM

Thread Post new topic Reply to topic

Joined: 25 May 2024
Posts: 1
Location: The Netherlands
ground 25 May 2024, 22:03
"Ground" is a new Lox, C, Javascript look-a-like compiled programming language for Windows which allows x86-64 assembly language to be added anywhere in the code.
Mixing Ground- and assembly code is possible by using the generated symbolic constants for each local Ground variable.
Ground uses FASM to assemble it's output. The compiler is written in C# (net8.0).


The strength of Ground is the ability to replace a Ground statement with x86-64. So for example we have the following code in the mode7.g example:

for (int x = 0; x < g.GC_Screen_DimX; x++) {
float fSampleWidth = x / float_ScreenDIMx;
float fSampleX = fStartX + ((fEndX - fStartX) * fSampleWidth);

We can replace a statement with x86-64:

for (int x = 0; x < g.GC_Screen_DimX; x++) {
float fSampleWidth = x / float_ScreenDIMx;

//float fSampleX = fStartX + ((fEndX - fStartX) * fSampleWidth);
float fSampleX;
asm {
movq xmm2, [fStartX@main]
movq xmm1, [fEndX@main]
subsd xmm1, xmm2
movq xmm0, [fSampleWidth@main]
mulsd xmm0, xmm1
addsd xmm0, xmm2
movq [fSampleX@main], xmm0

See the github project page for some nice screengrabs of examples like a plasma smoothscroller and a 3D(actually 2.5D) example.
2024.06.09: I also added a Chipmunk physics engine example.

Ground has language constructs like Classes, Groups, Expressions, Statements, Functions, Strings, Floats. It has a reference count system, so garbage collection is automatic. This makes string concatenation easier.

At this moment, Ground is still in alpha phase, so bugs and changes are plenty. So, do not use the language if you look for a stable language. However, if you want to create your own little compiled language, take a look.

In addition, Ground can generate comments for the xdbg debugger. This enables you to view the generated FASM assembly code while you are debugging.

As a last remark, I would like to thank Thomasz for creating the FASM assembler, all the samples and online documentation. Examples like the prahorda example is really useful as an example.


Best regards from the Netherlands,
Rene Olsthoorn.
Post 25 May 2024, 22:03
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.