Cogs and Levers A blog full of technical stuff

Out of my (un-creative) hands.

It’s no secret. I suck at style.

I don’t like it, it doesn’t like me.

Problem is, we need to work in harmony (somehow) as in order to host web-based projects, I need some sort of design to host the application within.

Enter: Twitter Bootstrap (http://twitter.github.com/bootstrap/)

The plugins, designs and documentation allow me to assemble websites without much more though.

I can go back to being an engineer!

Inlining Assembly Language with GCC

Noteworthy without this article is Lockless (http://locklessinc.com/) for the great super-technical write-ups that they do.

Inlining assembly language using the GNU toolset has always escaped me (until now). It’s not so much that I didn’t know how to do it, I just felt it much more comfortable to write my assembly in a separately linked object. This article has put my mind, stomach and C blending assembly fingers at ease.

http://locklessinc.com/articles/gcc_asm/

Hello, 64bit Assembly!

So, I’m a tragic for assembly language. I’ve finally gotten around to sharpening up my skills to attack Linux with some assembly language and why not upgrade the skills into the 64bit world at the same time.

“Hello world” follows:

section .data
	hello:      db 'Hello world!',10    ; text plus a linefeed char
	helloLen:   equ $-hello             ; length of the string

section .text
	global _start
	
_start:
	mov   rax, 4            ; system call for "write" (sys_write)
	mov   rbx, 1            ; file descriptor (stdout = 1)
	mov   rcx, hello        ; offset to write
	mov   rdx, helloLen     ; number of bytes to write
	int   0x80              ; syscall
	
	mov   rax, 1            ; system call for exit (sys_exit)
	mov   rbx, 0            ; error code (no error = 0)
	int   0x80              ; syscall

Build at the command line with nasm:

nasm -f elf64 hello.asm
ld -s -o hello hello.o

Some further reading:

Core *nix Cheatsheets

Here’s a bookmark set (3 links) that have all got me out of trouble from time to time. If times and spaces were a little different around home here, I’d probably have these printed out and pinned to the wall.

Art for Programmers

Yet another productivity killer for any non-creative programmer trying to make a game is art.

So, the next time this is a problem - I’ll be going here: http://letsmakegames.org/resources/art-assets-for-game-developers/

Just came across this icon set as well: http://adamwhitcroft.com/batch/