Skip to content

Instantly share code, notes, and snippets.

View crcx's full-sized avatar

Charles Childers crcx

View GitHub Profile
@crcx
crcx / Tauru.ahk
Created August 22, 2017 14:25
Tauru.ahk
; ==============================================
; AutoHotkey Script to remap a standard layout
; to Tauru for testing.
;
; Todo:
; - disable remaining additional keys beyond the
; 30 that this layout uses
; - become faster at touch typing using the
; layout
; ==============================================
http://www.keyboard-layout-editor.com/#/gists/798c1933f6b7a5bc7093d92c062f918b
@crcx
crcx / STRING-TO-NUMBER.md
Created May 25, 2017 19:57
New `s:to-number` for Retro 12

The standard string to number conversion in Retro only supports decimal values. But it's pretty easy to extend this to handle arbitrary bases.

#10 'Base var<n>

:digit (c-s)
  '0123456789ABCDEF swap s:index-of ;

:s:to-number (s-s)
@crcx
crcx / set.forth.md
Last active May 18, 2017 01:29
Sets (simple arrays) in Retro

Sets

Sets are statically sized arrays. They are represented in memory as:

count
data #1 (first)
...
data #n (last)

TODO:

:square
as{
'dumu.... i
}as ;
:test
as{
'lilica.. i
#12 d
'square r
````
'Amps var
'Volts var
'Watts var
#1 'Phase var<n>
:new (-)
#1 !Phase
#0 !Volts
#0 !Watts
@crcx
crcx / new.muri
Created April 28, 2017 19:33
s:to-number
: next
i lica....
r fetch-next
i zr......
i lisuswpu
d 48
i swlimuad
d 10
i poliju..
r next
lib_addr dd 0
; void *dlopen(const char *file, int mode);
code 'from', _from
upsh 32
call parse
embed 'zt'
upop edx
pusha
push 0
push edx
@crcx
crcx / Muri.md
Last active April 27, 2017 19:04
Muri: a simpler assembler for Nga
                      _
 _ __ ___  _   _ _ __(_)
| '_ ` _ \| | | | '__| |
| | | | | | |_| | |  | |
|_| |_| |_|\__,_|_|  |_|

Muri is a minimalistic assembler for Nga.

The standard assembler for Nga is Naje. This is an attempt at making a much smaller assembler at a cost of requiring more manual knowledge of the Nga virtual machine and its encodings.

@crcx
crcx / muri.c
Created April 27, 2017 15:13
Muri: An Alternative Assembler for Nga
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define KiB * 1024
#define MAX_NAMES 1024
#define STRING_LEN 64
int32_t target[128 KiB];