Jump to content
IGNORED

Programming Language Using 8-bit Values


Gemintronic

Recommended Posts

This is a half-baked, not fully formed idea. Thought I'd talk my way through some of it and get some feedback.

 

Basically, I want to create a programming language/meta compiler that can fit in byte sized DATA statements. Such that a "compiled" program might look like this:

 

DATA 34, 0, 35, 255, 2, 17, ..

 

The runtime would be in BASIC. Literally BASIC source template with the "program" stuffed in DATA statements appended to the end. I'd code the runtime in every BASIC I know exists for consoles such as DragonBASIC (GBA), BatariBASIC (2600), BasiEgaXorz (Genesis) so as long as they support DATA statements.

 

The syntax would be brutally simple. Meaning, only TWO bytes per line: COMMAND PARAMETER.

 

So, you could have a statement like:

GOTO LABEL_START

 

A cheat for manipulating things would be to use a command called SET to declare which variable or object to subject subsequent operations on. For instance:

 

SET PLAYERSCORE

ADD 15

 

The IDE would also be pretty simple given the COMMAND PARAMETER format. I could see actually having a console port that strictly used a joystick. The PC version could have drag-and-drop simplicity.

 

The benefit would be the same code could be output to any supported BASIC compiler.

 

The downside is the skimpy 2 byte per line restriction. Also, program features may be limited to the lowest common denominator (bB/2600) Er, also, using only numerical values between 0 and 255 may be constricting too.

 

What say yall?

Edited by theloon
Link to comment
Share on other sites

Have a read about Apple's "Sweet 16" routines.

 

It's a kind of extension to 6502 which works as a sort of interpretor but is aimed at giving 16-bit extensions to stuff like integer maths.

 

Doing it in Basic - I used to do it a little bit. For common tasks in Basic it can make them more memory efficient.

For cross-platform compatability, sure, it can help. But only so far. The end result will generally be something even slower than Basic and you might be hampered more than helped if you limit capabilities based on the lowest platform you plan to support it on.

Link to comment
Share on other sites

I knew I was reinventing the wheel. Thanks for the info guys! Er, not being sarcastic :) I'll study the Sweet 16 and p-code to see how to do such things.

 

One motivation that I forgot is that a potential feature for future versions of Batari BASIC was use of the extra storage space on Harmony/Melody boards for graphics and playfields. This is actually a pretty big constraint as what I usually need most is more room for code. If Batari decides to support this feature AND reading playfield pixels I could encode instructions as playfield pixels.

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...