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
# Usage | |
# class Foo | |
# include MethodPatterns | |
# | |
# defp :greet, check(:nil?) do |obj| | |
# p 'HA! NIL!' | |
# end | |
# | |
# defp :greet, match_any do |obj| | |
# p 'Hey, Object!' |
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
global setjmp | |
setjmp: | |
push ebx | |
mov ebx,[8 + esp] | |
mov [0 + ebx],edi ; buf->edi == 0(ebx) == EDI | |
mov [4 + ebx],esi ; buf->esi == 4(ebx) == ESI | |
mov [8 + ebx],ebp ; buf->ebp == 8(ebx) == EBP |
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
void longjmp(jmp_buf buf, int ret_val) | |
{ | |
unsigned *esp; | |
/* make sure return value is not 0 */ | |
if(ret_val == 0) | |
ret_val++; | |
/* EAX is used for return values, so store it in jmp_buf.EAX */ | |
buf->eax = ret_val; | |
/* get ESP for new stack */ |
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
all: clean floppy.img | |
clean: | |
rm -f *.o *.bin *.elf *.img | |
floppy.img: clean kernel.bin boot.bin | |
cat boot.bin kernel.bin /dev/zero | dd bs=512 count=2880 of=floppy.img | |
loader.o: loader.asm | |
nasm -f elf loader.asm -o loader.o |
NewerOlder