40 likes | 177 Views
Hello World!. PC / MS-DOS. code segment para assume cs:code,ds:code org 0100h start: mov dx,offset message ;point to message mov ah,09h ; func # to printstring int 21h ;call DOS mov ax,4c00h ;exit
E N D
PC / MS-DOS code segment para assume cs:code,ds:code org 0100h start: movdx,offset message ;point to message mov ah,09h ;func# to printstring int 21h ;call DOS mov ax,4c00h ;exit int 21h Message db 'Hello World!',13,10,'$' end start
PC / Linux section .data ;data section declaration msg db 'Hello World!',0AH lenequ $-msg ;string length section .text ;code section declaration global _start ;entry point _start: movedx,len ;string length movecx,msg ;string start mov ebx,1 ;file handle: stdout mov eax,4 ;sys_write int 80h ;kernel system call mov ebx,0 ;return value mov eax,1 ;sys_exit int 80h ;kernel system call
ARM / RISC-OS .start STMFD (sp!), {R0-R12, lr} ADR R0, message SWI OS_Write0 LDMFD (sp!), {R0-R12, pc} .message EQUS "Hello, world!" EQUB 0