Some sort of a language'ish thing to be.

Overview

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
You might also like...
Weatherapp: a simple weather forecast app, which uses some APIs to fetch 5 day / 3 hour forecast data from the OpenWeatherMap 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

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

CMPLR-Native - A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding 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

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

A Simple Privacy Browser - Some ScreenShots(Actual App Even Looks Better 😃 ):
A Simple Privacy Browser - Some ScreenShots(Actual App Even Looks Better 😃 ):

Lets_Browse A Simple Privacy Browser. Some ScreenShots(Actual App Even Looks Better 😃 ): Features 👇 : Bookmark Webpage Save Webpage as Pdf(Once Page

Sharkur is a fork of Purpur which adds more configuration and also some optimalization.

Sharkur Sharkur is a fork of Purpur which adds more configuration and also some optimization. API Javadoc Dependency Information Maven repository

some android libraries to speed up development.
some android libraries to speed up development.

emo - speed up android development This repository contains series of libraries for android developers: ui-core: Contain some basic components such as

Owner
Markku Sukanen
A nerd and a coder.
Markku Sukanen
An App based on MVVM architecture to track & store a user's runs using Google Maps, with options to view & sort the runs as per the user's choice along the with option to run the app in background.

An App based on MVVM architecture to track & store a user's runs using Google Maps, with options to view & sort the runs as per the user's choice along the with option to run the app in background.

Harshit Maheshwari 1 Jun 9, 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

UpFault 0 Dec 26, 2021
Application that allows to search some products and display them in a list, also allows to add some product to the shopping cart and remove it

Application that allows to search some products and display them in a list, also allows to add some product to the shopping cart and remove it

Victor 3 Aug 18, 2022
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

Mike Penz 1.8k Nov 10, 2022
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

Akhilesh Patil 61 Jan 7, 2023
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

Dayon Oliveira 0 Nov 3, 2021
A news application through which you can learn and browse all the news that interests you by choosing the country and type of news with the ability to browse and add some news to your favorites

MY-NEWS-Android A news application through which you can learn and browse all the news that interests you by choosing the country and type of news wit

Mahmoud ELramady 0 Nov 11, 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

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

AdventOfCodeComposeWeb Visualizing some advent of code puzzles using Jetpack com

Ozioma 0 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

CloudOn9 3 Apr 12, 2022