Examples of Programs For Various Operating Systems
This is a Hello world program for the DOS operating system.
section .text org 0x100 mov ah, 0x9 mov dx, hello int 0x21 mov ax, 0x4c00 int 0x21 section .data hello: db 'Hello, world!', 13, 10, '$'An example of a similar program for Microsoft Windows:
global _start extern _MessageBoxA@16 extern _ExitProcess@4 section code use32 class=code _start: push dword 0 ; UINT uType = MB_OK push dword title ; LPCSTR lpCaption push dword banner ; LPCSTR lpText push dword 0 ; HWND hWnd = NULL call _MessageBoxA@16 push dword 0 ; UINT uExitCode call _ExitProcess@4 section data use32 class=data banner: db 'Hello, world!', 0 title: db 'Hello', 0An equivalent program for Linux:
section .data msg: db "Hello, world!", 10 .len: equ $ - msg section .text global _start _start: mov eax, 4 ; write mov ebx, 1 ; stdout mov ecx, msg mov edx, msg.len int 0x80 mov eax, 1 ; exit mov ebx, 0 int 0x80Read more about this topic: Netwide Assembler
Famous quotes containing the words examples of, examples, programs, operating and/or systems:
“Histories are more full of examples of the fidelity of dogs than of friends.”
—Alexander Pope (16881744)
“It is hardly to be believed how spiritual reflections when mixed with a little physics can hold peoples attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.”
—G.C. (Georg Christoph)
“We attempt to remember our collective American childhood, the way it was, but what we often remember is a combination of real past, pieces reshaped by bitterness and love, and, of course, the video pastthe portrayals of family life on such television programs as Leave it to Beaver and Father Knows Best and all the rest.”
—Richard Louv (20th century)
“Many people operate under the assumption that since parenting is a natural adult function, we should instinctively know how to do itand do it well. The truth is, effective parenting requires study and practice like any other skilled profession. Who would even consider turning an untrained surgeon loose in an operating room? Yet we operate on our children every day.”
—Louise Hart (20th century)
“I am beginning to suspect all elaborate and special systems of education. They seem to me to be built up on the supposition that every child is a kind of idiot who must be taught to think.”
—Anne Sullivan (18661936)