Here's a link to Hello world for 68k Amiga:
http://www.helloworldexample.net/cisc-amiga-workbench-20-motorola-68000-hello-world-example.html
And here's the fixed version of the same example:
include lvo/exec_lib.i
include lvo/dos_lib.i
; open DOS library
movea.l 4.w,a6
lea dosname(pc),a1
moveq #36,d0
jsr _LVOOpenLibrary(a6)
tst.l d0
beq.b .nodos
movea.l d0,a6
; actual print string
lea hellostr(pc),a0
move.l a0,d1
jsr _LVOPutStr(a6)
; close DOS library
movea.l a6,a1
movea.l 4.w,a6
jsr _LVOCloseLibrary(a6)
moveq #0,d0
rts
.nodos:
moveq #20,d0
rts
dosname dc.b 'dos.library',0
hellostr dc.b 'Hello, world!',0
Changes:
- Properly test for OpenLibrary failure. No longer crashes when run on KS 1.3.
- Set return code properly.