Website of sivizius

Who am I?

Hi, I am sivizius, a dude from saxony doing unusual stuff.

I usual write some programs in flatassembly, but I currently develop a compiler for yapla, »yet another programming language. again!«, and going to write further project in my own language. But do not worry, this language and the compiler is going to be awesome. At least I hope so.

By the way...this website is written in html and css, but without javascript. I really hate javascript, because of reasons.

PS: I like you found my site. Please click around and if you want to tell me something, just send me an e-mail, write a tweet or leave a anonymous comment.

My little blog - spam is magic!

2016-12-18

Hello world! I started to write a blog. By accident. Here, a kitten:

Fig. 1: KittenKanal: »Cute Baby Kitten meows because Mama Cat is not there «. [online] https://www.youtube.com/watch?v=PB5FosTwM8s (2016-12-18).

linux64

some useful libraries for amd64 linux.

this libraries are supposed to be included as source. just include main.fasm at the top of your code, then you can use

usage and key files

yet another operating system

this is a froozen project, the idea of this is the same as behind yalave, but on os-level

cookies

yet another symbolic instruction code

download as .zip download as .tar.gz view on github

yet another symbolic instruction code is a programming language and transcompiler to flatassembly, which is written entirely in the macro-language of flatassembler, so do not worry if it is slowly (about 0.9s for the provided example). This is the nature of interpreted languages :-/

Nevertheless it is awes0me.

Getting started

First of all some terms should be defined:

A source file must start with this header:

#!sba:yasic
          

and a newline character.

Then you could write some code, e.g.:


        label
        {
          'hello world'
          {
            #print some text
            echo('hello my friend')
            jump('label')
          }
        }
        

label {} defines a new label in the output. You could refer to it e.g. with jump('label'), which creates jmp label in the output. After a label a block ({ [...] }) have to follow.

To compare the input with a regular expression, you could use 'something' {}. This compares the input with the string »something«. If this comparison is true, the block would be executed, if not, the output jumps to the end of the block. I go into detail later.

If you just want to remark or just do not want something in the output, you could use comments:

#comment from »#« to the end of the line.
        

There are also some predefined functions like echo('text') to let the output call an echo-function to print 'text' or jump('label') to jump to label. The end of a function-call is a ; or a newline character, so if you want everything on one line, you have to use ; at the end:

'hello world' { echo('hello my friend'); }
        

It is time to compile this piece of code! Yasic is written in flatassembler so you need to download it, if not already done so far. I also provided an shell-script, but you could compile your source with:

But before you compile yasic.fcfg, you need to adjust the name of your source-file in this line of yasic.fcfg:

yasic_parse 'source-file.sba'
        

There are some examples in the code-directory.

There are also some other options for the compiler in this file:

yasic.OpEcho          equ 'echo_put'
        
yasic.GetChar         equ 'files.getChar'
        
yasic.IndirectString  equ false
        
yasic.Symbol          equ 'str'
        
yasic.TheChar         equ 'my_char'
        
yasic.MagicNumbers    equ false
        
yasic.Depth           equ 0
        

Regular Expressions

Well, the regex I used in yasic are similar to PCRE, but not the same! Yasic does not support quantifiers yet, character-classes and ranges are a bit different and groups are only implemented very thin. To define a regular expression you just had to write:

'regex' {}
        

Yasic supports the wildcard . for any character and escape sequences for some special characters and even some character-classes with \:

'regex..\.\W\n' {}
        

To compare the input with a class of characters, you just put the name of the class in < and >:

'<alnum><A><B><C>' {}
        

If you just put one character into this brackets, e.g. <A>, the regular expression match a and A, if you do not put them into brackets, the regex is case-sensitive!

To define a range, you have to put the start and the end into [ and ]:

'[09][AZ|az]' {}
        

This also allows multiple ranges, seperated with |, so this regular expression match 1a, 9Z, but not a9. But note that the characters must be sorted to their ascii values! This would match A, Z, but never 0:

'[AZ|09]' {}