RE: A92: assembling errors


[Prev][Next][Index][Thread]

RE: A92: assembling errors




>>undefined symbols all the way through, thats why i think its a tab problem
>
>
>its to do with the libs with the xxxlib::name@xxxx i get two undefined
>errors for each one....this happen to anyone else and does anyone know how
>to fix it?
>
>>>What errors are you getting, exactly?


I think I had similar problems when I first started with Fargo II.
Firstly, can you compile a program without any errors (one that uses non or only Fargo's own libraries)? If you can, take a look at my library below (in a plain text editor or viewer); if I remember correctly, the includes, xdef:s and end:s all *have to be indented*, i.e. there has to be a space or tab before every one of them. I believe this is how A68K identifies its own keywords.

Let me know how it goes.


;************** ASM file header stuff ***************

 include "flib.h"
 xdef _library
 xdef tinxlib@0000

;******************* Constants ***********************

;************ Generate Landscape *************
;* Generates a random landscape on the field *
;* Algorithm by: Andreas Ess                 *
;* In: a5 = pointer to field memory          *
;*     d6 = field width in bytes             *
;*     d7 = field height in pixels           *
;*********************************************
tinxlib@0000:
generate_landscape:
 movem.l  a5-a6/d0-d7,-(sp)

 and.l  #$0000FFFF,d6
 and.l  #$0000FFFF,d7

 move.l  d7,d5
 lsl.w  #1,d5
 divu.w  #3,d5  ;d5 = field_height * (2/3)

 move.w  d6,d4
 mulu.w  d7,d4  ;d4 = field_width * field_height

 moveq  #7,d3   ;Start bit for x

 move.l  d7,d0
 lsr.l  #2,d0
 jsr  flib::random  ;Start y-coordinate (added by algorithm)
 move.l  d0,d1
 add.l  d5,d1
 mulu.w  d6,d1  ;Offset for start y

 move.w  d6,d2
 subq.w  #1,d2  ;Column counter

\loop tst.l  d1
 blt.s  \cont
 cmp.l  d4,d1
 bge.s  \cont  ;Check that pixel is within our field area

 bset.b  d3,0(a5,d1)  ;Plot pixel at current position
\cont moveq  #5,d0
 jsr  flib::random
 tst.b  d0
 beq.s  \up
 cmp.b  #1,d0
 beq.s  \rup
 cmp.b  #2,d0
 beq.s  \right
 cmp.b  #3,d0
 beq.s  \rdwn

\down add.w  d6,d1  ;Move down one pixelrow
 bra.s  \loop

\up sub.w  d6,d1  ;Move up one pixelrow
 bra.s  \loop

\rup sub.w  d6,d1  ;Move up one pixelrow
 bra.s  \right
\rdwn add.w  d6,d1  ;Move down one pixelrow
\right dbra  d3,\loop ;Move one bit to the right
 addq.l  #1,d1  ;Move one word to the right
 moveq  #7,d3  ;Reset bit counter
 dbra  d2,\loop ;Next column


;* Now we've got to fill in the dirt :) *
 move.l  d6,d2
 subq.l  #1,d2

\oloop lea  0(a5,d2.w),a6 ;Start adress for this column

 move.w  d7,d0
 subq.w  #1,d0  ;Pixelrow counter

 moveq  #0,d1
\iloop move.b  (a6),d3
 or.b  d3,d1
 move.b  d1,(a6)
 add.l  d6,a6  ;Down one pixelrow
 dbra  d0,\iloop

\cont2 dbra  d2,\oloop

 movem.l  (sp)+,a5-a6/d0-d7
 rts

;************** End of Fargo program ****************

_library dc.b "tinxlib",0

;*****************************************************

	end