Jump to content

Hello world/Newbie: Difference between revisions

Added 8080 assembly Hello, World! for CP/M
(K)
(Added 8080 assembly Hello, World! for CP/M)
Line 47:
 
<code>./hello_world</code> on Linux.
 
 
=={{header|8080 Assembly}}==
{{Works with CPM-80}}
<pre>
download simh with CPM disk from: http://cpmarchives.classiccmp.org/cpm/mirrors/www.schorn.ch/cpm/intro.php
write hello.asm with any text editor. !!!MAKE SURE ALL ASM FILES HAVE A TRAILING NEWLINE!!!
open cp/m in simh by CD'ing to director, running altairz80.exe, then 'do cpm2'
load hello.asm into image by running command 'r hello.asm'
assemble by running command 'asm hello'
load by running command 'load hello'
run by executing command 'hello'
</pre>
<syntaxhighlight lang="8080 assembly">
; Hello World!
; Prints Hello, World! to stdout
BDOS equ 5 ; BDOS call entry
PRINT equ 9 ; BDOS string stdout subroutine
 
org 100h ; (mostly) All CP/M programs start at 100h
 
start lxi d,message ; load message pointer to DE register pair
mvi c,PRINT ; set up BDOS call to do string print
call BDOS ; call BDOS routine
ret ; pop back out into CP/M
 
message db 'Hello, World!','$' ; message string, all CP/M strings have an EOL of '$'
 
 
</syntaxhighlight>
 
 
=={{header|AArch64 Assembly}}==
1

edit

Cookies help us deliver our services. By using our services, you agree to our use of cookies.