Skip to content

Instantly share code, notes, and snippets.

@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"
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 / 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).

#include <iostream>
#include <string>
void none(void) {
std::cout << "I'm none..." << std::endl;
}
void red(void) {
std::cout << "I'm red!" << std::endl;
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
@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
@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