This is assembly language, nasm on linux, I
hope I don't make any mistakes as I'm just learning
it.
Code:
%define STDOUT 1
%define SYS_EXIT 1
%define SYS_WRITE 4
; these are directives not part of the intel instruction set
section .data
msg: db "hello", 10 ; declare byte
len: equ $-msg ; calculate number of bytes by subtracting addresses
section .text
global _start
_start:
; Call write
mov eax, SYS_WRITE
mov ebx, STDOUT
mov ecx, msg
mov edx, len
int 080h
exit:
; Call exit
mov eax, SYS_EXIT
mov ebx, 0
int 080h
This code should be easy to understand as
it's just calling c and unix system calls but
when you get to loops and such then it gets more
complicated and you need to comment. Alot of
it is really similar to c like you can use [] to dereferance
a pointer etc.
djgpp and dev-c++ both use the same compiler but different
ports of it. I didn't like dev-c++ because they
didn't code the ide in c++ and the ide crashed a few times on
me. It's still better than alot of other ide's. I'll try it
again and see if it's more stable. Borland's free
compiler doesn't come with a ide so you will have to find a text editor to write code.