Welcome, Guest. Please login or register.

Author Topic: getting started in amiga assembly  (Read 9584 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: getting started in amiga assembly
« on: July 03, 2009, 11:10:52 PM »
Quote from: kamiga;514417
What's the best assembler?

DevPac
Quote
Best documented?

Commercial: DevPac
Free: PhxAss
Quote
Is CygnusEd still a nice editor for code?

IMO yes.

Quote
How to call the OS functions?

1. open the library, store the library pointer somewhere
2. move the library pointer to a6 register
3. move function arguments to input registers
4. jsr to LVO offset (jsr -xxx(a6))
5. return value is returned in d0, if any
6. at program exit close the library

Quote
I'd be pretty happy to get some very basic "hello world" type assembly source

Code: [Select]

_LVOOpenLibrary EQU -552
_LVOCloseLibrary EQU -414
_LVOOutput EQU -60
_LVOWrite EQU -48

start:
  move.l  4.w,a6
  lea     dosname(pc),a1
  moveq   #0,d0
  jsr     _LVOOpenLibrary(a6)
  tst.l   d0
  beq.s   nodos
  move.l  d0,a6
  lea     msg(pc),a0
  moveq   #-1,d3
  move.l  a0,d2
strlen:
  addq.l  #1,d3
  tst.b   (a0)+
  bne.s   strlen
  jsr     _LVOOutput(a6)
  move.l  d0,d1
  jsr     _LVOWrite(a6)
  move.l  a6,a1
  move.l  4.w,a6
  jsr     _LVOCloseLibrary(a6)
nodos:
  moveq   #0,d0
  rts
dosname:
  dc.b 'dos.library',0
msg:
  dc.b 'Hello, world!',10,0