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
;; ada.asm | |
segment .data | |
format db "%d + %d = %d", 10, 0 | |
segment .text | |
global main | |
extern printf | |
main: |
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
;; lovelace.asm | |
segment .data | |
prompt db "Type in your name: ", 0 | |
buffer times 42 dd 0 | |
printerformat db "Hello %s", 10, 0 | |
scannerformat db "%s", 0 | |
segment .text | |
global main |
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
;; main.asm | |
segment .data | |
promptfirstnumber db "Enter the first number: ", 0 | |
promptsecondnumber db "Enter the second number: ", 0 | |
scanfnumber db "%d", 0 | |
printsum db "%d + %d = %d", 10, 0 | |
a dd 0 | |
b dd 0 |
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
;; fact.asm | |
segment .text | |
global fact | |
fact: | |
;; Reserve no room for the locals ... | |
enter 0, 0 |
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
Delivered-To: [email protected] | |
Received: by 10.140.106.102 with SMTP id d93csp2368187qgf; | |
Tue, 24 Mar 2015 12:19:21 -0700 (PDT) | |
X-Received: by 10.180.106.68 with SMTP id gs4mr31417050wib.39.1427224760288; | |
Tue, 24 Mar 2015 12:19:20 -0700 (PDT) | |
Return-Path: <[email protected]> | |
Received: from DUB004-OMC3S26.hotmail.com (dub004-omc3s26.hotmail.com. [157.55.2.35]) | |
by mx.google.com with ESMTPS id lg5si248270wjb.181.2015.03.24.12.19.19 | |
for <[email protected]> |
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
(function () { | |
"use strict"; | |
/** | |
* Use case example: | |
* http.get("/", {foo: "bar", background: "red"}) | |
* .then(function (res) { | |
* return console.log(res); | |
* }, function (err) { | |
* return console.error(err); | |
* }); |
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
#!/usr/bin/sh | |
BATTERYLEVEL=$(acpi -b|sed -r "s/^.* ([0-9]{1,3})%, .*$/\1/g"); | |
DISCHARGING=$(acpi -b|egrep 'Discharging'); | |
if [[ $BATTERYLEVEL -lt 100 && $DISCHARGING ]]; then | |
notify-send --urgency=critical --expire-time=5000 "!, close to fucked up baby. $BATTERYLEVEL%." \ | |
"You've a bunch of minutes left to commit everything and put your <b>wonderful</b> laptop @ zzz." | |
fi; |
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
.text | |
.global _start | |
_start: | |
xorl %ebx, %ebx | |
movl $buf, %ecx | |
movl %ebx, (%ecx) | |
movl $buf_length, %edx | |
movl $buf, %ecx | |
movl $0, %ebx | |
movl $3, %eax |
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
## main.s | |
## !, assemble and link it (on x86_64) via | |
## $ as --32 --gstabs main.s -o main.o | |
## $ ld -m elf_i386 main.o -o main | |
.section .text | |
.global _start | |
__atoi: | |
### int __atoi (const char * buf, size_t buf_length) | |
### Convert a string to an integer. |
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
## $ cc -ggdb3 -m32 -Og reverse.cool.s -o reverse.cool | |
.section .text | |
.type main, @function | |
.globl main | |
main: | |
pushl %ebp | |
movl %esp,%ebp | |
subl $0x10,%esp | |
movl %esp,-0x10(%ebp) | |
movl $message,%esi |