assembler again

Thu, Nov 9, 2006

As we’ve just got the Listserv mailing list server and it has a C application for sending commands down a pipe, I got all nostalgic and started looking at Axis2 C to build a web service to stick in front of it. Then I thought, why stop at C? So I went right back to my old driver days and got back into assembler. So here’s a Hello World that will run on Linux. I got it from here. Now that I’ve remembered how it works I’m going to try and do a simple web service in assembler! To compile you’ll need nasm and if you get the error:

/usr/bin/install: cannot create regular file `/usr/local/nasm/bin/nasm’: No such file or directory

set the prefix to /usr/local instead.

Then do:

nasm -f elf helloworld.asm ld -s -o helloworld helloworld.o section .data hello: db ‘Hello world!’,10 helloLen: equ $-hello

section .text global _start

_start: mov eax,4 mov ebx,1 mov ecx,hello mov edx,helloLen int 80h mov eax,1 mov ebx,0 int 80h

comments powered by Disqus