Hello World in Assembly

This is an article on Hello World in Assembly in Assembly Language Programming (ALP) Tutorials.

Rated 5.00 By 1 users

Assembly language is one of the oldest low-level programming language for computers , micro-processors etc etc...It implements a symbolic representation of the Machine Opcodes needed to program a given CPU Architecture...Its a language based on mnemonics , labels , instructions , memory addresses and Registers... A major disadvantage of programming in assembly is that it is not at all platform independent and thus , cannot be ported to other architectures...

The Code

In this article we'll be learning about a simple Hello World Program in x86 Unix Assembly and Will be using basic syscall table to accomplish our tasks...

We'll be using write() function to write 'Hello World' to STDIN

Syntax

Code:

write(int fd, char *Buff, int NumBytes);

In a Assembly program the arguments can be passed on to the function via a simple call stack or via registers..

We'll be using registers to pass the arguments...

Points to remember

eax should contain the syscall number

ebx should point to the first

ecx should point to the second

edx should point to the third

esx should point to the fourth

edi should point to the fifth

Syscall(system call) table can be looked up in /usr/include/asm/unistd_32.h