Skip to content

Instantly share code, notes, and snippets.

PREFIX=$HOME/qemu-arm
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
.syntax unified
.thumb
.data
out:
.space 10*4
semihost_arg:
.space 4*4
.text
@scottt
scottt / hello-arm.S
Last active August 29, 2015 14:19
hello world in assembler under x86-64 and ARMv7-A Linux
.syntax unified
.thumb
#include <sys/syscall.h>
.section .text
.global _start
.thumb_func
_start:
/* write(1, "hello, world", 13) */
Failed to synchronize cache for repo 'rpmfusion-nonfree' from 'http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-22&arch=x86_64': Cannot prepare internal mirrorlist: No URLs in mirrorlist, disabling.
Last metadata expiration check performed 1:58:06 ago on Wed May 13 14:51:20 2015.
Dependencies resolved.
============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
kernel x86_64 4.0.2-300.fc22 updates-testing 64 k
kernel-core x86_64 4.0.2-300.fc22 updates-testing
@scottt
scottt / uniform-discrete-random-variables.ipynb
Last active August 29, 2015 14:23
Uniformly Distributed Discrete Random Variables: Creating X[1,7] from X[1,5]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scottt
scottt / 3n1.c
Last active August 29, 2015 14:24
until-breakpoint: A GDB command that waits for a specific breakpoint to hit
volatile int n;
int main()
{
n = 29;
while (n != 1)
if (n % 2 == 1)
n = 3*n + 1;
else
n = n/2;
@scottt
scottt / matplotlib-artist-object-api.ipynb
Last active November 25, 2015 05:48
Matplotlib Artist Object API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scottt
scottt / plt.gdb
Last active February 3, 2016 19:19
file s
set disable-randomization on
set disassemble-next-line on
# break on call 'swap@plt' in main
break *0x0804857c
break 'swap@plt'
run
si
disassemble 'swap@plt'
printf "\n\ninfo symbol 0x804a014: "