24 January 2019, 16:32 | #1 |
Registered User
Join Date: Jan 2019
Location: Werne
Posts: 8
|
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 |
24 January 2019, 16:43 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
|
Should string be declared as bytes instead of longs?
|
24 January 2019, 17:26 | #3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
One of the many problems with ASM-One is that it executes your program as a simple subroutine. If you started ASM-One from the Workbench then your program runs inside ASM-One's own Workbench process, and so it has no default output.
The simplest solution is to just write your program to disk and run it from the CLI. |
24 January 2019, 17:33 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Or run asmone from shell
EDIT: yeah, serioiusly, it is better to test using plain executable first. |
24 January 2019, 21:38 | #5 |
Registered User
Join Date: Jan 2019
Location: Werne
Posts: 8
|
Thank you for your response. I think then I will get a guru. :-)
|
24 January 2019, 21:57 | #6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,196
|
yes, if Output returns 0, you don't have a console. Build an exe and run it from CLI.
now: dc.l => dc.b and don't write more than data size. Asm is not easy. Good luck! |
28 January 2019, 23:53 | #7 |
Registered User
Join Date: Jan 2019
Location: Werne
Posts: 8
|
Solution
Thank you for your support. I have fixed the problem.
Code:
string dc.b "Hello Amiga Coders!",0 Next step read somthing from cli and print it to the screen. Best regards Fireball |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" | DemosongIHunter | request.Music | 45 | 23 May 2022 20:07 |
"Detokenising" source code (resetting back to plain text) | earok | Coders. Blitz Basic | 4 | 29 October 2017 22:48 |
"Another World 2" and "Flashback 2" on PSP | john4p | Retrogaming General Discussion | 34 | 26 April 2011 18:52 |
Cli program to "execute" .info files | olesio | support.Apps | 4 | 05 September 2010 19:19 |
Capitan Zbik, "new" polish text adventure game in Amos | s2325 | Retrogaming General Discussion | 1 | 04 April 2009 22:13 |
|
|