Page 1 of 1

Pebble language and compiler with expression parser

Posted: Sat Nov 12, 2022 1:56 am
by bongomeno
Pebble is a programming language, compiler, and IDE for x86 DOS.

The compiler is written is QBasic and produces Flat Assembler code. Fasm is included along with a wysiwyg IDE written in QBasic. The IDE produces and executes compilation batch files. The compiler may be ran without the IDE.

When a program is compiled, the result is a .com file. The .com files start at less than 100 bytes. Inline asm is supported to allow support for unimplemented features.

The IDE allows you to compile and run by pressing F4. Files must be loaded or saved to compile and run from the IDE. Several example programs are included with the .peb extension. The included examples come with compilation batch files, so the IDE is not required.

Nested if/endif statements are supported. Echoing text doesn't require defining the text. The language currently only supports integer variables. Expressions with parentheses are supported. Inline asm and include files are supported.

More info and download: http://lucidapogee.com/forum/viewtopic.php?t=34

Re: Pebble language and compiler with expression parser

Posted: Sun Nov 20, 2022 2:26 am
by bongomeno
Expression evaluation is now supported. Parentheses must be used to explicitly state order of operations.

Examples...

Code: Select all

[nextlevel]=[nextlevel]+10+([nextlevel]/3)
or

Code: Select all

sub exitbutton

	cursor 76,0
	echo "[X]"

	if ([mouseb]=1)&([_MOUSEX]>=76)&([_MOUSEX]<=79)&([mousey]=0) then

		kill

	endif

ret
Note that __MOUSEX should be displaying as mouse x (minus the space), but the forum is having an issue. It changes the text.

Re: Pebble language and compiler with expression parser

Posted: Sun Nov 27, 2022 1:41 pm
by bongomeno
I have made an update.
There's now support for arrays and more examples.

An example Pong game called Ball and Paddle is now included. Compile the source by running examples\ballandp.bat file. The game supports mouse and keyboard, has colors, sounds, and speed control. It all fits in .com file under 2kb when compiled. (1,673 bytes)

Image

Re: Pebble language and compiler with expression parser

Posted: Sun Dec 11, 2022 2:57 am
by bongomeno
Pebble has been updated!
The operator precedence had issues and has been "fixed."
There's also now string support, although I am still working on string examples.

Pebble language and compiler with expression parser

Posted: Sun Dec 11, 2022 6:43 am
by Anthony.R.Brown
Nice work bongomeno :)

We need more of this on this site!



A.R.B :)

Re: Pebble language and compiler with expression parser

Posted: Mon Dec 12, 2022 1:37 am
by bongomeno
I haven't been active here in years.

It's nice to be back.

Thank you.