weblog d’un abbe


Time to say goodbye…

Filed under: Yippee!! — Tags: — abbe @ 2232
Good bye :-)


Hacking a codegen

Filed under: Experiences, Fun, Hacking, Yippee!! — Tags: , , , , , , — abbe @ 0456

So, finally I’ve hacked a basic AMD64 code generator, after so many tries. This code generator is hacked in Common Lisp, and is currently generating a code for a very simple toy like language. I’ve not written any grammar specification for it. It is a LISP like language. This piece of code generator is dedicated to one of my cool friend Edwin Jose, and is thus named as louzer. Following is an example of the language for which louzer generates code.

	 (let principal rate time amount x)
	 (= principal 1000)
	 (= rate 10)
	 (= time 100)
	 (= x 100)
	 (= amount
		(/ (* principal (* rate time))
	 (print "Amount (%d) - %d is %d.\\n"  amount x (- amount x))
	 (print "Hello World, louzer\\n"))

The language code is also embedded along with the source code in the LISP file. Following is how I’m using it with GNU clisp implementation:

% clisp louzer.lisp |tee test.S
.section .text
.extern printf
.type main,@function
.globl main
 pushq %rbp
 movq %rsp, %rbp
 subq $40, %rsp
 movq $1000, %rbx
 movq %rbx, -8(%rbp)
 movq $10, %rbx
 movq %rbx, -16(%rbp)
 movq $100, %rbx
 movq %rbx, -24(%rbp)
 movq $100, %rbx
 movq %rbx, -40(%rbp)
 movq -16(%rbp), %rbx
 imul -24(%rbp), %rbx
 imul -8(%rbp), %rbx
 movq %rbx, %rax
 movq $100, %rbx
 xorq %rdx,%rdx
 idiv %rbx
 movq %rax, -32(%rbp)
 leaq __string_0,%rdi
 movq -32(%rbp), %rsi
 movq -40(%rbp), %rdx
 movq -32(%rbp), %rbx
 subq -40(%rbp), %rbx
 movq %rbx, %rcx
 xorq %rax,%rax
 call printf
 leaq __string_1,%rdi
 xorq %rax,%rax
 call printf
 xorq %rax, %rax
 movq %rbp, %rsp
 popq %rbp
.section .rodata
__string_1: .string "Hello, louzer World\n"
__string_0: .string "Amount (%d) - %d is %d.\n"
/* Generated by louzer :) */

Above is the piece of AMD64 assembly code emitted by the louzer. So, now time to assemble and link the above assembly code and generate the output of the above code.

% cc -o test test.S
% ./test
Amount (10000) - 100 is 9900.
Hello, louzer World

Voila. Oh, sorry to keep you waiting, now you can download the louzer.lisp and have fun. BtW, code is not perfect and has couple of limitations, which I’ve not fixed due to lack of time, as I’ve an exam day after tomorrow. So, I’ll be able to work on it only after 20081219. Happy hacking codegens…;)

NOTE (for Grammar Nazis): Forgive me for any grammatical mistakes you encounter above, and ofcourse point out the mistake :).

P.S. Forgot to mention, you’ll need an AMD64 architecture CPU, toolchain and POSIX OS to test out above stuff.


Red Hat releases SELinux Users Guide

Filed under: Yippee!! — Tags: , , , — abbe @ 1847

So, Red Hat released a SELinux User Guide which looks great :), and in the authoring team there is a friend . Looks like I should get back to
Fedora or should I SELinux-ify existing Gentoo GNU/Linux and ArchLinux installations.



Filed under: Fun, Hacking, Yippee!! — Tags: , , , , — abbe @ 1035

/me has pasted "blog.el -- the blog client for posting to wordpress blogs" at http://paste.lisp.org/display/69993
/me has pasted "metaweblog.el -- an emacs lisp library to access metaweblog capable blogs" at http://paste.lisp.org/display/69994

Happy blogging…;)


Happy mDNSing (Avahi) over IPv6 on FreeBSD

Filed under: Yippee!! — Tags: , , , , , , — abbe @ 0151

Thanks to bz, the issue is now fixed.


bitlbee 1.2.3 and OTR support

Filed under: Fun, Hacking, Yippee!! — Tags: , , , , , , , , — abbe @ 2357

Just finished integrating OTR support code from bitlbee-otr into bitlbee-1.2.3, and is available as bitlbee-otr-1.2.3.tar.bz2 (md5sum: ff355f4e2a5d664f474fb2b4551e763d). I will also post this to the original maintainer of bitlbee-otr branch, and ofcourse it’ll be available in FreeBSD too, in the bitlbee-otr PR 126208, which I submitted few days ago. Anyways, happy instant messaging OTR…:)


Emacs OS capable of rendering PDFs

Filed under: Yippee!! — Tags: , , , — abbe @ 1201

Emacs OS capable of rendering PDFs


HE.NET IPv6 Certified

Filed under: Yippee!! — Tags: , , — abbe @ 1025

Certificate Image


Google Cache now served from an IPv6 host

Filed under: Yippee!! — Tags: , — abbe @ 0435

Google Cache from IPv6
Google‘s next step in IPv6 implementation.


GNOME Online Desktop on FreeBSD

Filed under: Yippee!! — Tags: , , , — abbe @ 2241

I have ported GNOME Online Desktop to FreeBSD. which is now available in ports tree at net/online-desktop. Enjoy…;)

Older Posts »

Create a free website or blog at WordPress.com.