RodrigoDornelles / 3bc-lang

Low-level language, tiny virtual machine, minimal runtime, intermediate representation, embeddable, easy for beginners. (Friendly Punched cards)
https://3bc-lang.org
GNU General Public License v3.0
232 stars 25 forks source link

improve alternative syntax #353

Open RodrigoDornelles opened 1 year ago

RodrigoDornelles commented 1 year ago

an alternative syntax for shortening code, as well as some nasm processing, may have some unique features to help code large and complex algorithmic programs.

alternative vs simple
image

some ideas

MODE .. 0d09
GOTO .. :ENTRY_POINT

MODE .. 0d06
ALOC :var 10

MODE .. 0d02
..:ENTRY_POINT
STRC .. 'h', 'e', 'l', 'l', 'o'
STRC .. 0x20
STRC .. 'w', 'o', 'r', 'l', 'd', :var.NILL
MODE NILL 0d09
GOTO NILL :ENTRY_POINT

MODE NILL 0d06
ALOC :var 10

MODE NILL 0d02
..:ENTRY_POINT
STRC NILL 'h', 'e', 'l', 'l', 'o', 0x20
STRC NILL 'w', 'o', 'r', 'l', 'd', :var.NILL