1 / 4

Cross-Platform "Hello, World!" Program in MS-DOS, Linux, and RISC OS Assembly Code

This document presents a simple "Hello, World!" program implemented in three different assembly languages: MS-DOS, Linux, and RISC OS. Each code segment demonstrates how to output the message "Hello, World!" using system calls specific to each operating system. The MS-DOS version utilizes the DOS interrupt for output, while the Linux implementation employs system calls for writing to standard output. The RISC OS version showcases the use of software interrupts to achieve the same goal. This comprehensive comparison aids in understanding assembly programming across different platforms.

zoie
Télécharger la présentation

Cross-Platform "Hello, World!" Program in MS-DOS, Linux, and RISC OS Assembly Code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hello World!

  2. 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

  3. 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

  4. 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

More Related