This file contains hidden or 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 <stdbool.h> | |
#include <stdint.h> | |
struct dcpu { | |
uint16_t ram[0x10000]; | |
uint16_t reg[8]; | |
uint16_t pc; | |
uint16_t sp; | |
uint16_t o; |
This file contains hidden or 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
gcc -g -lgmp -o rho rho.c | |
gdb ./rho | |
run 10 | |
bt |
This file contains hidden or 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
// aux.c |
This file contains hidden or 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 <curses.h> | |
int main(int argc, char*argv[]) | |
{ | |
initscr(); | |
printw("curses - press any key"); | |
getch(); | |
endwin(); |
This file contains hidden or 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
// stack_trace.c | |
// | |
// gcc stack_trace.c -ldw -lunwind -g -o stack_trace | |
#define UNW_LOCAL_ONLY | |
#include <elfutils/libdwfl.h> | |
#include <libunwind.h> | |
#include <stdio.h> |
This file contains hidden or 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
num: 1 2 3 4 | |
val: 1 1 0 0 | |
limit: 5 |
This file contains hidden or 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
.file "test.cpp" | |
.globl cosine | |
.bss | |
.align 32 | |
.type cosine, @object | |
.size cosine, 67108864 | |
cosine: | |
.zero 67108864 | |
.globl sine | |
.align 32 |
This file contains hidden or 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
.file "test2.cpp" | |
.section .text._ZSt3cosf,"axG",@progbits,_ZSt3cosf,comdat | |
.weak _ZSt3cosf | |
.type _ZSt3cosf, @function | |
_ZSt3cosf: | |
.LFB22: | |
.cfi_startproc | |
pushq %rbp | |
.cfi_def_cfa_offset 16 | |
movq %rsp, %rbp |
This file contains hidden or 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
enum Type | |
{ | |
Void; | |
Primitive(name:String); | |
Pointer(to:Type); | |
Function(args:Array<NamedType>,ret:Type); | |
} | |
class NamedType |
This file contains hidden or 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 <dlfcn.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur | |
{ |