Some sort of a language'ish thing to be.

Last update: Jun 17, 2022

MarkSLang

MarkSLang Ⓒ 2022 Markku Sukanen. Some sort of language(ish) thing to be.

Features

Simple calculations, loops, conditional(s), etc. Simple REGisters (for now only numeric).

What's What?

  • REG refers to so-called "registers", which range from A to Z.
  • DTA refers to some raw data value, e.g. 12.075, 404, etc.
  • LOC in source code designates a "jump point" (or just a convenient tag), e.g. this_is_a_loc:
  • CMD refers to any context-valid command.
  • CMP refers to one of the many compare/compute things: <, >, , , & etc.

Code Commenting

; any line beginning with ';' is treated as a comment and thus ignored.
NOP and just the same is everything ignored after 'NOP' "command".
  ; align
    ; doesn't
       ; matter

There's also the fact that all commands ignore any and everything that follows the stuff they munch, and thus something like...

WHILE X is above zero, we'll run the following piece of code
  X - 1 happens to reduce the counter, right?
  R ← X and here the shrinking X is used as 'radius'.
  C ← 3.141 might have something to do with "PI", right?
  C * 2 ... multiplied
  C * R ... and then again, with radius this time.
  OUT C happens then to shovel the circumference into output buffer!
WEND then hops back to the WHILE X above.

... is a completely fine way to prettify / complicate your code!

Commands

OUT

"Prints" given value or REG into output buffer.

  • OUT 2
  • OUT A

SET, ←

Set a REG's value.

  • SET A 2 - set A to contain 2
  • SET B A - set B to contain whatever is in A
  • C ← 3
  • D ← E

ADD, +, SUB, -, MUL, *, DIV, /

Add, subtract, multiply, or divide given REG with something else. Result is stored in the given REG.

  • A + 4 ... ADD A 4
  • B - C ... SUB B C
  • D * 5 ... MUL D 5
  • E / F ... DIV E F

JUMP, →

Jump somewhere else in the code.

  • JUMP somewhere_else
  • somewhere_else →

IF

If something is something, then execute a CMD.

IF <reg/dta> <cmp> <reg/dta> <cmd> <loc>

  • IF A < B JUMP only_if_a_was_lt_b - jump to only_if_a_was_lt_b if Ais less than B. Note that whitespace between REG/DTA, CMP and 2nd REG/DTA is significant!

END

The End. End program.

Program naturally ends when it runs of code to execute, but END can be used to quit it at some arbitrary point in middle of a chunk of code.

NOP

No-operation. May or may not be of some use for someone... Any and everything following NOP is ignored, and thus NOP can be used for code commenting,

here_be_code:
  NOP A pointless set operation follows, for demonstration purposes...
  NOP ...or just to state that 42 is the answer to L.
  SET L 42
  END

SWAP,

Swap contents of two REG.

  • SWAP A B
  • C ↔ D
  • F <-> E

CALL, RET

Call a / return from sub-routine.

  • CALL some_sub_somewhere
  • RET

Note that if CALL stack is empty then RET will act as NOP and execution of program will "fall through". Occasionally useful, yet potentially hazardous ;-)

TRIM

Chop off all decimals from REG. This ye olde float-to-int truncation.

  • TRIM A

SUM

Sum into REG two other REG/DTA.

  • SUM C 3 4 - sum 3 and 4 into REGC
  • SUM C A B - sum A and B into REGC
  • SUM C A A - sum A twice into REGC

RESET

Reset all REG.

RESTART

Restart app from scratch. At this point in time not very useful, but who knows?

WHILE, WEND

A rather basic looping operation.

X ← 10
A ← 0
WHILE X
  ; while X>0, keep looping
  X - 1
  A + 1
  A * 1.5
WEND
OUT A
[169.9951171875]

PI, π

"PI" or π is what one might expect it to be, approx. 3.1415926...

  • PI E sets REGE to hold PI.
  • π E
  • ADD C PI adds PI to whatever REGC contains.
  • R * π multiplies REGR with PI.

ABS

Abs a REG. In other words, drop any notion of negative value.

SET X -10
ABS X
; results with X having 10 in it.

Example Code

Shovel prime numbers below 50 into output buffer:

  N ← 50
  OUT 2
  A ← 3
start:
  B ← 2
  Z ← 0
test:
  C ← B
new:
  IF C = A JUMP err
  IF C > A JUMP past1
  C + B
  JUMP new
err:
  Z ← 1
  JUMP past2
past1:
  B + 1
  IF B < A JUMP test
past2:
  IF Z = 1 JUMP past3
  OUT A
past3:
  A + 1
  IF A ≤ N JUMP start

GitHub

https://github.com/msukanen/MarkSLang
You might also like...

An Android App based on MVVM Architecture which shows random anime images from some famous subreddits

An Android App based on MVVM Architecture which shows random anime images from some famous subreddits

Android App which shows random anime wallpapers from some famous subreddits like r/animeArt, r/imaginarySliceOfLife, r/animePhoneWallpapers and animeWallpapersSfw

Mar 2, 2022

Simple application with some famous graph algorithm implemented by Jetpack Compose framework

Simple application with some famous graph algorithm implemented by Jetpack Compose framework

GraphAlgorithm This Application was implemented by Jetpack Compose framework. The dagger-hilt library was used for dependency injection and Room libra

Apr 25, 2022

Kotlin extensions for Moshi, Make every thing you want with Moshi in just one line.

Kotlin extensions for Moshi, Make every thing with square / Moshi in one line.

Nov 21, 2021

CircularStats - Custom Widget to display stats of any thing

CircularStats This is a custom widget made with Jetpack Compose for displaying s

Apr 12, 2022

Math World is an Android Application specialized in mathematics, where the application includes some sections related to arithmetic, unit conversion, scientific math laws and constants, as well as some mathematical questions that need some intelligence to reach the solution.

 Math World is an Android Application specialized in mathematics, where the application includes some sections related to arithmetic, unit conversion, scientific math laws and constants, as well as some mathematical questions that need some intelligence to reach the solution.

Math World is an Android Application specialized in mathematics, where the application includes some sections related to arithmetic, unit conversion, scientific math laws and constants, as well as some mathematical questions that need some intelligence to reach the solution.

Mar 12, 2022

A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Jun 20, 2022

Android Studio & IntelliJ Plugin for sort xml by name="xxx".

Android Studio & IntelliJ Plugin for sort xml by name=

AndroidXmlSorter Android Studio & IntelliJ Plugin for sort xml by name="xxx". Options Insert space between difference prefix ('Snake Case', 'Camel Cas

Mar 17, 2022

An example concepts of MVVM and Kotlin. Display, Filter & Sort the given restaurants from assets with Jetpack Compose and AAC

An example concepts of MVVM and Kotlin. Display, Filter & Sort the given restaurants from assets with Jetpack Compose and AAC

Restaurants - Jetpack Compose An example concepts of MVVM and Kotlin. Display, F

May 18, 2022

Sort & Filter Data RecyclerView

Sort & Filter Data RecyclerView

Sort-Filter-RecyclerView Sort & Filter Data RecyclerView Tutorial Build with Android Studio

Jun 1, 2022

Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

LoadingDrawable: Android cool animation collection 前言 CircleRotate源码解析 Fish源码解析 LoadingDrawable is some android animations implement of drawable: a li

Jun 17, 2022

Don't know what to do next? Don't worry, NEG or NotEnoughGoals will give you some help by giving you some goals to achieve to make skyblock less boring.

NotEnoughGoals Don't know what to do next? Don't worry, NEG or NotEnoughGoals will give you some help by giving you some goals to achieve to make skyb

Dec 26, 2021

some android image filters

some android image filters

android-image-filter some android image filters in some filter, I use NDK to implement to make it more efficient Setup Install Android NDK and properl

Jun 8, 2022

A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

May 10, 2022

A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

May 10, 2022

Android library to display progress like google does in some of his services.

GoogleProgressBar This library is not maintained anymore and there will be no further releases Android library to display different kind of google rel

May 27, 2022

Side menu with some categories to choose.

Side menu with some categories to choose.

Side Menu Side menu with some categories to choose. Check this project on dribbble. Check this project on Behance. God bless Ukraine! Sample Sample &

Jun 22, 2022

You don’t want your apps look and feel boring, do you? Add some bubbles!

You don’t want your apps look and feel boring, do you? Add some bubbles!

#BubbleAnimationLayout Say hello to Bubble Animation Layout for Android by Cleveroad You don’t want your apps look and feel boring, do you? Add some b

Apr 24, 2022

An android project presenting some transitions you can use between activities

ActivityTransition An android project presenting some transitions you can use between activities #Integration Add the anim folder to your Android proj

Apr 23, 2022
Don't know what to do next? Don't worry, NEG or NotEnoughGoals will give you some help by giving you some goals to achieve to make skyblock less boring.

NotEnoughGoals Don't know what to do next? Don't worry, NEG or NotEnoughGoals will give you some help by giving you some goals to achieve to make skyb

Dec 26, 2021
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Jun 15, 2022
The Rick And Morty - MVVM with a clean architecture approach using some of the best practices in Android Development.
The Rick And Morty - MVVM with a clean architecture approach using some of the best practices in Android Development.

Rick-and-Morty The Rick And Morty - App consuming a Rick and Morty API to display Characters it has been built with clean architecture principles, Rep

Jun 16, 2022
An android app that lists all planets in our solar system and brings some information about them.
An android app that lists all planets in our solar system and brings some information about them.

SolarSystem This application was developed in Android Studio and uses Kotlin as programming language. In short, it is an app that lists all the planet

Nov 3, 2021
Tackling some of the challenges in Advent of PBT 2021

AdventOfPBT Tackling some of the challenges in Advent of PBT 2021 Implementations using jqwik and Kotlin. Day 1: Subject: lastIndexOf and my solution

Dec 20, 2021
Visualizing some advent of code puzzles using Jetpack compose for web

AdventOfCodeComposeWeb Visualizing some advent of code puzzles using Jetpack com

Dec 21, 2021
Alleviating some Deepslate mining pain.

1.18 made it harder to clear large amounts of space by mining. Let us alleviate that pain a little. Usage You will instantly mine Deepslate, so long a

Apr 12, 2022
Jan 7, 2022
Quiz-App - An Android app which have some basic questions
Quiz-App - An Android app which have some basic questions

Quiz-App An Android app which have some basic questions Start page Questions pag

Apr 21, 2022
A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tumblr application , But a little prettier than him 😉
A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tumblr application , But a little prettier than him 😉

A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tum

Jan 11, 2022