Skip to content

Instantly share code, notes, and snippets.

switch (instruction & 0xf000) {
case 0x0000: { //nop movw muls mulsu fmul fmuls fmulsu cpc sbc add
switch (instruction & 0x0c00) {
case 0x0000: {
switch (instruction & 0xff00) {
case 0x0000: { //nop
}
case 0x0100: { //movw
@Lerc
Lerc / RegTest.hx
Last active August 29, 2015 14:10
A Haxe Macro example. Allows class properties to be added that map to an array entry. I made this for a project using JavaScript typed arrays for speed.
import js.html.Uint8Array;
@:build( RegisterMacro.memoryMappedRegister("r0",123) )
class RegTest
{
var ram : Uint8Array;
public function new() {
ram = new Uint8Array(65536);
}
@Lerc
Lerc / jmpabuse.c
Created March 24, 2012 20:19
A simple string unscrabler using a turing machine inside a single expression.
#include <stdio.h>
#include <setjmp.h>
int J(jmp_buf x, int y) {
longjmp(x,y);
return 0;
}
int main(int argc, char **argv)
{
@Lerc
Lerc / clutter_style_properties.md
Last active November 11, 2015 21:22
Clutter Style Properties

on st-theme-node

  • box-shadow
  • -st-background-image-shadow (does not support inset)
  • text-shadow (does not support inset)
  • color
  • warning-color
  • error-color
  • success-color
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
void sig_handler(int sig) {exit(0);};
int main () {
signal(SIGTERM,sig_handler);
pid_t pid_v;
OPERATOR op,a,b,dst
EXTENDS_TEST a,b,dst
IS_BUILTIN value,_,dst
SET dst,index,value
GET src,index,value
SET_NAMED dst, indexName:int, value
GET_NAMED src, indexName:int, dst
SET_MEMBER indexName:int, src
GET_MEMBER indexName:int, dst
ASSIGN dst,src
Operands are variant unless specified.
OPERATOR op,a,b,dst
EXTENDS_TEST a,b,dst
IS_BUILTIN value,_,dst
SET dst,index,value
GET src,index,value
SET_NAMED dst, indexName:int, value
GET_NAMED src, indexName:int, dst
@Lerc
Lerc / Main.kasm
Last active December 3, 2019 22:50
Kwak-8 base program
.include "defs"
.include "kwak8"
.include "utility"
.include "scratch"
.use Mode0Code
.org 0
jmp init
@Lerc
Lerc / Main.kasm
Last active November 19, 2020 22:58
Input Example
.include "defs"
.include "kwak8"
.include "utility"
.org 0
jmp init
.org $10
@Lerc
Lerc / index.html
Last active November 25, 2020 06:36 — forked from kahole/index.html
*scratch*.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>*scratch*</title>
<style>
body {
font-family: Hack, Menlo, Monaco, 'Droid Sans Mono', 'Courier New', monospace;
white-space: pre;