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
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
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
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
; | |
; 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
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
[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
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
private static void foo() { | |
byte b = 10; | |
short s = 10; | |
void() f = void () s = b; | |
void(int) g = void (int a) a = b; | |
} | |
private static void bar() { | |
final int x = 10; | |
void(int) f = void (int a) a = x; |
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 void foo() { | |
int x = 10; | |
void(int) f = void (int a) a = x; | |
} | |
private static void bar() { | |
final int x = 10; | |
void(int) f = void (int a) a = x; | |
} |