Add 0815 to yacc shaving and first meme description. - brcon2024-hackathons - Bitreichcon 2024 Hackathons (HTM) git clone git://bitreich.org/brcon2024-hackathons git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/brcon2024-hackathons (DIR) Log (DIR) Files (DIR) Refs (DIR) Tags --- (DIR) commit 99a24579afb492d678361f389b7d4ed42afa3c47 (DIR) parent fe1953cc524f2263d68e4bd294c5c97364270469 (HTM) Author: Christoph Lohmann <20h@r-36.net> Date: Sat, 15 Jun 2024 13:31:25 +0200 Add 0815 to yacc shaving and first meme description. Diffstat: A meme/description.md | 6 ++++++ A yacc-shaving/0815/0815.txt | 167 +++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 0 deletions(-) --- (DIR) diff --git a/meme/description.md b/meme/description.md @@ -0,0 +1,6 @@ +# Meme Hackathon + +## txt memes to image +* Make it possible to for example loop txt images. + * Somehow transform txt to image and then reuse that. + (DIR) diff --git a/yacc-shaving/0815/0815.txt b/yacc-shaving/0815/0815.txt @@ -0,0 +1,167 @@ +¤0815 + +0815 - Language details + +0815 is based around a queue and 3 registers. It understands +hexadecimals only, so every numeric input and output are in +hexadecimals. It also ignores everything that is not one of its +instructions, for that matter: everything that is not an instruction +is a comment. + +Registers + +0815 has 3 signed integers 64 bit wide registers: X, Y, and Z. All +three are initialized with 0. X is a write only register and Z is a +read only register. Y is a helper register and cannot be accessed by +the programmer. + +Parameters + +Some of 0815 instructions need parameters. All parameters must be +surrounded by colons, e.g.:3c: +Labels are also considered parameters; therefore they also need the +surrounding colons. +If a parameter is needed but any is found the instruction will simply +be ignored, no error message will be displayed. + +Jumps + +In 0815 you find 2 kinds of jumps: if Zero( #) or if not Zero( ^). +Jumps' labels can contain any character, except the language reserved +symbols, e.g.:_loop: or:34: +If the label that the jump is pointed to is not found, the program +terminates. + +New lines + +Either ASCII 10 or 13 will be interpreted as a new line. + +Instructions + ++-----------+---------+---------------------------------------------------------------------------+ +| | |<:2: will move'2' to register X | +| move | < |(parameter is mandatory) | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |swaps register X and Y | +| swap | x | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |}:_loop: this creates a label called'_loop' | +| label |} |(parameter is mandatory) | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| input | |inputs a signed 64 bit integer and stores it into X | +| number | | |(hexadecimal base) | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| input | |inputs an ASCII char and stores it into X | +| ASCII |! | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| print | |prints a signed 64 bit integer stored in Z | +| number | % |(hexadecimal base) | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| print | |prints an ASCII char stored in Z | +| ASCII | $ | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| roll | |rolls all registers to the left: X <- Y <- Z | +| registers | ~ |after roll: X = Y, Y = Z and Z = X | +| left | | | ++-----------+---------+---------------------------------------------------------------------------+ +| roll | |rolls all registers to the right: X -> Y -> Z | +| registers | = |after roll: X = Z, Y = X and Z = Y | +| right | | | ++-----------+---------+---------------------------------------------------------------------------+ +| jump | |^:_loop: jumps to label _loop if Z is not 0 | +| if not | ^ |(parameter is mandatory) | +| zero | | | ++-----------+---------+---------------------------------------------------------------------------+ +| jump | |#:_loop: jumps to label _loop if Z is 0 | +| if | # |(parameter is mandatory) | +| zero | | | ++-----------+---------+---------------------------------------------------------------------------+ + +Queue instructions + ++-----------+---------+---------------------------------------------------------------------------+ +| | |clears the queue | +| clear |? | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |enqueue the number stored in Z | +| enqueue |> | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |dequeue a number and stores it into X | +| dequeue | { | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| roll | |rolls the queue to the left: the first value becomes the +last, the second | +| queue | @ |will be first and so on. If no parameter is found, it +will roll the queue | +| left | |once, otherwise rolls it parameter times. e.g. @:a: rolls +the queue ten | +| | |times to the left. | ++-----------+---------+---------------------------------------------------------------------------+ +| roll | |the same as'@' just that the roll will go to the right: | +| queue | & |the last will be the first, the first will be the second +and so on. | +| right | | | ++-----------+---------+---------------------------------------------------------------------------+ + +Arithmetic instructions + ++-----------+---------+---------------------------------------------------------------------------+ +| | |Z = X + Y | +| add | + | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |Z = X - Y | +| sub | - | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |Z = X * Y | +| multipl. | * | | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ +| | |Z = X / Y | +| division | / |Y = rest | +| | | | ++-----------+---------+---------------------------------------------------------------------------+ + +Interpreter + +I re-wrote my Brainfuck interpreter to run 0815 programs. This version +just runs (interprets) 0815 programs. +Probably, I'll write another version that can interpret both +languages, but for now, this will do. +There is another issue that I should mention: In this version, the +Queue will only show its first 2070 items. +0815 Interpreter + +0815 Programming examples + +• Hello World! +• Cat +• Odd or Even +• Binary representation of an integer +• Factorial sequence (0 - 14h) +• Arithmetic mean(averages) +• Fibonacci sequence (0 - a94fad42221f2702h) +• 99 bottles of beer (63h bottles of beer) +• Prime numbers +• Hailstone sequence +• Simple randomizer +• Sum of squares +• Truth machine - numeric +• Truth machine - ASCII + +Home | Esolang + +Last updated: Wednesday, 24 August 2016 - 01:00:00 +©2004 - 2024 Paulo Jorente +Impressum | xhtml | css | cc