View Single Post
Old 24 January 2019, 16:32   #1
Fireball
Registered User
 
Join Date: Jan 2019
Location: Werne
Posts: 8
Question My "Hello World" Text will not be printed to cli

Hello amiga coders,

I'm a beginner in 64k assembler and I hope someone can help me to solve my problem.

I would like to print a simple text like "hello world" to the cli.
But my program crash if I run it.

I think I have problems to get an output handle cause the value in d0 is zero after jsr Output(a6).

During debugging my machine freeze at jsr Write(a6) and I have to reboot my machine.

I have no idea what I did wrong. :-(

Thank you in advance
Fireball

Code:
; Asm - One
SysBase         = 4     
LVOOpenLibrary  = -552 
LVCloseLibrary  = -414  

LVOOutput       = -60   
LVOWrite        = -48   


main:
    ; open lib
    lea dosname,a1 
    moveq  #0,d0      
    move.l SysBase,a6  
    jsr LVOOpenLibrary(a6)  
    tst.l d0       
    beq fini           
    move.l d0, DOSBase 
    
    ; Get output handle
    move.l DOSBase, a6  
    jsr LVOOutput(a6)   
    move.l d0,d4          ; <-- I think here is my problem cause d0 is zero

    ; print text
    move.l d4,d1        
    move.l #string, d2 
    moveq #20, d3       
    move.l DOSBase, a6 
    jsr LVOWrite(a6)      ; <--- The Program stops here in debugger

    ; close lib
    move.l DOSBase, a1 
    move.l SysBase, a6 
    jsr LVCloseLibrary(a6)         

fini: 
    rts

; Data
DOSBase dc.l 0
dosname dc.b "dos.library",0
string dc.l "Hello Amiga Coders!",10
Fireball is offline  
 
Page generated in 0.05264 seconds with 11 queries