Data wrangler, software engineer, systems programmer, cyclist. Unix (mostly Solaris) for aeons. I talk C, Python, SQL, Performance, Java, Kafka and Makefiles.
Location
Brisbane, Australia
Education
BA (Mathematics, Modern History), University of Queensland
For completeness one should mention that this example is x86 assembler (not even amd64!), and for extra credit how about ARMv7, SPARC and POWER versions too? :p
;Don't forget Assembly Language:
section .text
global _start
_start:
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 0x80
mov eax, 1
int 0x80
section .data
msg db 'Hello, world!',0xa
len equ $ - msg
For completeness one should mention that this example is x86 assembler (not even amd64!), and for extra credit how about ARMv7, SPARC and POWER versions too? :p
Yes, thought it would be better to start with the basics.
global _start
section .text
_start:
mov rdi,1
mov rsi,hello_world
mov rdx,hello_world_size
mov rax,1
syscall
mov rdi,0
mov rax,60
syscall
hello_world: db "Hello, world!",10
hello_world_size EQU $ - hello_world
How about one for Windows 64?
extrn ExitProcess: PROC
extrn MessageBoxA: PROC
.data
caption db 'Windows 64-bit hello!', 0
message db 'Hello, world!', 0
.code
Start PROC
sub rsp,28h
mov rcx, 0
lea rdx, message
lea r8, caption
mov r9d, 0
call MessageBoxA
mov ecx, eax
call ExitProcess
Start ENDP
End