section .data
hello: db 'Hello, World!',10 ; 'Hello, World!' plus a linefeed character
helloLen: equ $-hello ; Length of the 'Hello world!' string
section .text
global _start
_start:
mov eax,4 ; The system call for write (sys_write)
mov ebx,1 ; File descriptor 1 - standard output
mov ecx,hello ; Put the offset of hello in ecx
mov edx,helloLen ; helloLen is a constant, so we don't need to say
; mov edx,[helloLen] to get it's actual value
int 80h ; Call the kernel
mov eax,1 ; The system call for exit (sys_exit)
mov ebx,0 ; Exit with return "code" of 0 (no error)
int 80h;
CnNlY3Rpb24gLmRhdGEKCWhlbGxvOiAgICAgZGIgJ0hlbGxvLCBXb3JsZCEnLDEwICAgIDsgJ0hlbGxvLCBXb3JsZCEnIHBsdXMgYSBsaW5lZmVlZCBjaGFyYWN0ZXIKCWhlbGxvTGVuOiAgZXF1ICQtaGVsbG8gICAgICAgICAgICAgOyBMZW5ndGggb2YgdGhlICdIZWxsbyB3b3JsZCEnIHN0cmluZwoKc2VjdGlvbiAudGV4dAoJZ2xvYmFsIF9zdGFydAoKX3N0YXJ0OgoJbW92IGVheCw0ICAgICAgICAgICAgOyBUaGUgc3lzdGVtIGNhbGwgZm9yIHdyaXRlIChzeXNfd3JpdGUpCgltb3YgZWJ4LDEgICAgICAgICAgICA7IEZpbGUgZGVzY3JpcHRvciAxIC0gc3RhbmRhcmQgb3V0cHV0Cgltb3YgZWN4LGhlbGxvICAgICAgICA7IFB1dCB0aGUgb2Zmc2V0IG9mIGhlbGxvIGluIGVjeAoJbW92IGVkeCxoZWxsb0xlbiAgICAgOyBoZWxsb0xlbiBpcyBhIGNvbnN0YW50LCBzbyB3ZSBkb24ndCBuZWVkIHRvIHNheQoJICAgICAgICAgICAgICAgICAgICAgOyAgbW92IGVkeCxbaGVsbG9MZW5dIHRvIGdldCBpdCdzIGFjdHVhbCB2YWx1ZQoJaW50IDgwaCAgICAgICAgICAgICAgOyBDYWxsIHRoZSBrZXJuZWwKCW1vdiBlYXgsMSAgICAgICAgICAgIDsgVGhlIHN5c3RlbSBjYWxsIGZvciBleGl0IChzeXNfZXhpdCkKCW1vdiBlYngsMCAgICAgICAgICAgIDsgRXhpdCB3aXRoIHJldHVybiAiY29kZSIgb2YgMCAobm8gZXJyb3IpCglpbnQgODBoOw==