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
private static String ltoa(long l, int bas) { | |
bool sign = l < 0; | |
if (sign) { | |
l = -l; | |
} | |
int digits; | |
int neg = 1; | |
for (digits = 0; l >= neg; ++digits) { | |
neg *= bas; |
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
[bits 16] | |
org 0x100 | |
main: | |
mov ah, 0x0f | |
int 0x10 ; get video mode | |
push ax ; store vid mode | |
mov ah, 0x00 | |
mov al, 0x13 |
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
strlen: | |
push bp | |
mov bp, sp | |
mov si, 0 | |
.rep: | |
mov ax, [bp + si + 4] | |
test ax, ax | |
jz .break | |
inc si | |
jmp .rep |
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
; | |
; runtime.ll | |
; | |
; The libaquastd interface for the aqua runtime services. | |
; | |
%rt._Unwind_Exception = type { [4 x i8], void (sysint, %rt._Unwind_Exception*) *, i64, i64 } | |
declare sysint @_Unwind_RaiseException(%rt._Unwind_Exception* %ex) noreturn |
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 main | |
main: | |
push bp | |
mov bp, sp | |
sub sp, 2 | |
mov word [ss:bp - 2], 0 | |
.for0.start: | |
cmp word [ss:bp - 2], 10 | |
jnl .for0.break |
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
Expression | |
ConstantExpression | |
Literal | |
IntLiteral | |
LongLiteral | |
FloatLiteral | |
DoubleLiteral | |
BooleanLiteral | |
CharLiteral | |
StringLiteral |
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
IDEA | |
2D Top-down simcity-stronghold crusader-like sandbox game | |
You have to build and maintain a town beneath the surface. | |
Materials: | |
- Wood (building, fuel) | |
- Stone (building) | |
- Gold (currency) |
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
/* | |
* Multiplies two 32-bit numbers on 8086. | |
*/ | |
long _stdcall _mul32(int highr, int lowr, int highl, int lowl) | |
{ | |
asm { | |
; a = lowl * lowr | |
mov ax, [bp + 6] ; lowl | |
mul word [bp + 10] ; lowr |
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
import Data.Map (Map) | |
import qualified Data.Map as Map | |
import Data.Maybe (Maybe) | |
import qualified Data.Maybe as Maybe | |
lattice :: Int -> Int -> Int | |
lattice x y = fst (latticeI Map.empty x y) | |
where | |
latticeI m a 1 = (a, 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
-- File parsing hub, providing an interface to the parsers and other | |
-- helper functions to be used by other parsers. | |
-- Copyright (C) 2014 Antonie Blom | |
-- | |
-- This library is free software; you can redistribute it and/or | |
-- modify it under the terms of the GNU Lesser General Public | |
-- License as published by the Free Software Foundation; either | |
-- version 2.1 of the License, or (at your option) any later version. | |
module Compiler.Parser where |