in the name of zero

December 24, 2005

lust for enlightenment

[thoughts]
at irc.dal.net #linux today,

<Scruffypoo> it’s a well-established fact that women are evil and are not to be trusted. do we really have to keep rehashing that?
<Interex> thats true
<p3nguin> Did I tell you about the peanut butter cookies Kate made for me?
<Scruffypoo> if you want a dead horse to beat, we can always argue about text editors.
<Interex> no, thats gross though

girls. perhaps they’re evil. but we love them anyway.

[linux assembly 101]
ok, so i gotta admit. “hello world” doesn’t cut it anymore. this time, i delved deeper into doing some basic bit manipulations and functions. the code below uppercase-ifies a string.

; uppercase.asm
	
section .data
	string:	db "stephanie",10
	strlen:	equ $-string
	
section .text
	global	_start
	
_start:
	mov ecx, string
	call _write
	
	mov edi, string
	mov ecx, strlen-1	; loop counter
	
_upperfy:
	mov al, [edi]	; first letter
	cmp al, 97	; capitalize small
	
	jb skip		; letters only
	cmp al, 122
	ja skip
	sub al, 32	; capitalize letter
	mov [edi], al	; store back
skip:
	inc edi		; move to next letter
	loop _upperfy	; capitalize every letter
	
	mov ecx, string ; capitalized form
	call _write
	call _quit
	
_write:
	push byte 4
	push byte 1
	push byte strlen
	
	pop edx
	pop ebx
	pop eax
	int 80h
	ret	
	
_quit:
	mov eax, 1
	mov ebx, 0
	int 80h

and the output?

amerei@heaven ~/git/null/public/asm $ nasm -f elf uppercase.asm
amerei@heaven ~/git/null/public/asm $ ld -s -o uppercase uppercase.o
amerei@heaven ~/git/null/public/asm $ ./uppercase
stephanie
STEPHANIE

[life and love]
recently, when i get bored or frustrated, i’d look for my pet dog, hug him so tight and play with him like how girls play with their teddy bears. (usually involves lots and lots of hugging)

last year i gave steph a cute, blue, hello kitty pillow for christmas. probably not the most suitable gift for the holidays. i wonder if she hugs it everynight? i wonder if she liked it? i never asked.

[haiku]

as it snows up north.
december rain pours.
with it, cold breeze.

update: a blessed happy birthday miss ann christ eve!

Comments »

The URI to TrackBack this entry is: http://gnurbs.blogsome.com/2005/12/24/lust-for-enlightenment/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Get free blog up and running in minutes with Blogsome | Theme designs available here