Skip to content

Instantly share code, notes, and snippets.

@ksherlock
ksherlock / gist:7a229be96280abcc20c5
Created June 17, 2014 22:21
MPW SetMileStone macro
include 'M16.GSBug'
MACRO
&lab ~SetMileStone &p1
&lab
pea @str>>16
pea @str
_SetMileStone
bra @exit
@ksherlock
ksherlock / p.equ
Created June 29, 2014 18:46
MPW IIgs rep/sep bits
; with p
; rep #m|x|c
; endwith
p record 0
;nvmxdizc
n equ $80
v equ $40
require 'json'
kw = %w{
_Bool _Complex _Noreturn _Imaginary
auto asm break case char
continue const comp default do
double else enum extern extended
float for goto if int
inline long pascal
register restrict return
require 'json'
kw = %w{
_Bool _Complex _Noreturn _Imaginary
auto asm break case char
continue const comp default do
double else enum extern extended
float for goto if int
inline long pascal
register restrict return
#include <iostream>
#include <string>
void none(void) {
std::cout << "I'm none..." << std::endl;
}
void red(void) {
std::cout << "I'm red!" << std::endl;
@ksherlock
ksherlock / node_modules.md
Last active March 14, 2016 17:33
A better node_modules layout

All packages (top-level and dependencies) go in the __bikeshed__/ directory where they are versioned.

node_modules/__bikeshed__/[email protected]/
node_modules/__bikeshed__/[email protected]/
node_modules/__bikeshed__/[email protected]/
node_modules/__bikeshed__/[email protected]/

When you install a package, it also creates a top-level entry which redirects to a specific version in the __bikeshed__/ directory. This could be done with softlinks or auto-generated files. (require(x) will load for x.js).

Harpoon assembler now supports macros.
macro name [arguments...] {
...
}
arguments are in the form `&identifier`. The final argument may include an ellipsis to capture variadic arguments.
(`&identifier...`). Within the macro, `&...` expands to the full argument set. Arguments are replaced as-is,
macro load &p { lda #10 * &p}
load 1 + 2 ; lda #10 * 1 + 2 not lda #10 * (1+2)
@ksherlock
ksherlock / cowsay.b
Last active April 16, 2017 18:19
Cowsay
' **********************************************************************
' ***
' *** cowsay.b Moo
' *** 2017, Kelvin W Sherlock
' ***
#define IDENT_PROG "cowsay"
#define IDENT_VERS "1.0"
#define IDENT_DATE "09apr17"
#define IDENT_NAME "Kelvin_Sherlock"
@ksherlock
ksherlock / s16debug.h
Created September 28, 2017 16:07
s16debug.h
#ifndef __s16_debug_h__
#define __s16_debug_h__
void s16_debug_puts(const char *str);
void s16_debug_printf(const char *format, ...);
void s16_debug_dump(const char *data, unsigned size);
void s16_debug_tcp(unsigned ipid);
#ifdef __TCPIP__
@ksherlock
ksherlock / s16debug.c
Created September 28, 2017 16:08
s16debug.c
#include "s16debug.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <tcpip.h>
#include <tcpipx.h>
#pragma optimize 79