This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AS=riscv32-elf-as | |
CC=riscv32-elf-gcc | |
LD=riscv32-elf-ld | |
OBJCOPY=riscv32-elf-objcopy | |
LDFLAGS=-T riscv.ld | |
ASFLAGS=-march=rv32imfd | |
CFLAGS=$(ASFLAGS) -O2 | |
.SUFFIXES: .s .S .txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.globl _main | |
_main: | |
call ___djgpp_nearptr_enable | |
testl %eax, %eax | |
jz err | |
movw $0x13, %ax | |
int $0x10 | |
movl $0xa0000, %ebx | |
subl ___djgpp_base_address, %ebx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; Monads | |
(define (return x) (make-result x)) | |
(define (bind m k) | |
(make-thunk (lambda () (execute! (k (execute! m)))))) | |
(define (execute! m) | |
(cond ((result? m) (result-value m)) | |
((thunk? m) (execute-thunk! m)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define SECTOR 512 | |
#define BOOTMAGIC 0xaa55 | |
char disk[SECTOR*2880]; | |
int | |
main(int argc, const char *argv[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ../Downloads/uudecode.c 1994-04-03 06:16:37 +1200 | |
+++ uudecode.c 2018-03-04 18:23:50 +1300 | |
@@ -50,8 +50,8 @@ | |
#include <sys/param.h> | |
#include <sys/stat.h> | |
-#include <pwd.h> | |
#include <stdio.h> | |
+#include <stdlib.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@0x00 | |
ORIGIN = 0xFF8D | |
==Start== | |
LDA #1 ; start counting at 1 | |
{ | |
PHA ; save A | |
JSR Fib | |
CMP 0x0200 ; if fib(A)>fib(A-1), stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; Find-function -- Given some input/output pairs, find a general function that works with these. | |
;;;; Copyright (C) 2016 Jeandre Kruger | |
;;;; All rights reserved. | |
;;;; Redistribution and use in source and binary forms, with or without modification, | |
;;;; are permitted provided that the following conditions are met: | |
;;;; 1. Redistributions of source code must retain the above copyright notice, this | |
;;;; list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; Streams library | |
;;;; Copyright (c) 2016, Jeandre Kruger | |
;;;; All rights reserved. | |
;;;; Redistribution and use in source and binary forms, with or without modification, | |
;;;; are permitted provided that the following conditions are met: | |
;;;; 1. Redistributions of source code must retain the above copyright notice, this | |
;;;; list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Words(...templates) { | |
this.templates = templates | |
} | |
Words.prototype.generate = function() { | |
return this.templates.map(generate).join(' ') | |
} | |
function generate(template) { | |
if(template instanceof Words) | |
return template.generate() |
NewerOlder