www.sandromaffiodo.com
/homepage /list +nerd

Contact: yt tw fb in mail git


Tags: [all] obfuscated rubik arduino vgax terminal ebook epub esp8266 espvgax game javascript php scifi ioccc piano music book youtube curl

OI Ultimate reducted RISC machine

This is an old project that i've made in the past.. when a spider has bitten me and gave me the powers of the DORK NERD.

What is OI?

oi

OI is a small interpreter of an OISC machine.

Wikipedia define an OISC like this:

"A one instruction set computer (OISC), sometimes called an ultimate reduced instruction set computer (URISC), is an abstract machine that uses only one instruction [...] an OISC is capable of being a universal computer in the same manner as traditional computers that have multiple instructions."

OI is a SUBLEQ interpreter. SUBLEQ is an instruction defined like this:

"The subleq instruction ("SUbtract and Branch if Less than or EQual to zero") subtracts the contents at address A from the contents at address B, stores the result at address B, and then, if the result is not positive, transfers control to address C (if the result is positive, execution proceeds to the next instruction in sequence)"

The primarly nerdy part of this project WAS NOT to implement an OISC machine, but was to write an OISC interpreter using only the single instruction SUBLEQ. Really absurd huh? Yeeeah, like things that nerdy do.

Check out this simple and clean SUBLEQ interpreter writen in SUBLEQ:

-2 341 3 334 334 6 341 334 9 334 39 12 334 40 15 334 43 18 -1 330 21 330 -1 24 335 335 27 330 335 30 336 336 33 347 336 36 336 335 57 0 0 42 330 0 45 337 43 48 337 39 51 337 40 54 334 334 18 346 -2 60 346 -2 63 346 -2 66 334 334 69 341 334 72 334 102 75 334 105 78 334 108 81 337 105 84 337 108 87 337 108 90 343 343 93 331 331 96 332 332 99 333 333 102 0 331 105 0 332 108 0 333 111 334 334 114 338 334 117 331 334 159 334 334 123 337 334 126 331 334 159 334 334 132 335 335 135 341 334 138 334 335 141 331 335 144 237 237 147 334 334 150 335 334 153 334 237 156 334 334 168 340 343 162 237 237 165 331 237 168 334 334 171 338 334 174 332 334 222 334 334 180 337 334 183 332 334 222 334 334 189 335 335 192 341 334 195 334 335 198 332 335 201 238 238 204 246 246 207 334 334 210 335 334 213 334 238 216 334 246 219 334 334 237 238 238 225 246 246 228 332 238 231 332 246 234 340 343 237 0 0 240 337 343 267 334 334 246 0 334 249 335 335 252 334 335 267 339 102 258 339 105 261 339 108 264 334 334 90 334 334 270 333 334 327 334 334 276 335 335 279 341 334 282 334 335 285 333 335 288 342 342 291 334 334 294 335 342 297 102 102 300 105 105 303 108 108 306 342 102 309 342 105 312 342 108 315 337 105 318 337 108 321 337 108 324 334 334 90 334 334 -1 0 0 0 0 0 0 0 -1 -2 -3 1 0 0 0 33 35 10 65535 -65535

Here you can look at the assembler sourcecode that i've used to write the SUBLEQ interpreter in SUBLEQ. The assembler language used was created by me to simplify the writing process. Here you can see the assembler compiler i've writen for that purpose. OMG, what a nerdy thing!!

Read more on OI homepage.

This SUBLEQ interpreter was submitted on the IOCCC 2015 competion but unfortunately didn't win any awards. Check out this post about my SUBLEQ obfuscated IOCCC 2015 entry.

Have fun!