Welcome, Guest. Please login or register.

Author Topic: funcdef macro in phxass?  (Read 7620 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
funcdef macro in phxass?
« on: November 26, 2003, 10:21:22 PM »
those of you who are regulars around these parts will haave noticed that i'm attempting to get adoom to compile in gcc. i've gotten all the c files to compile with only a handfull of warnings (apart from it warning-ing when i compare pointer == NULL because NULL is an int!) but now i've turned to the assembly specific files, i've got phxass as gas doesnt like them one bit. and incidentally i'm using the 3.9 libs/headers (though still devving on a 3.1 system) ... however i'm stuck now because it demands a "funcdef" macro, someone on the comp.sys.amiga.programmer newsgroup suggested the following


amiga_draw.s first few lines of code:

 lvocnt  set     LIB_USERDEF

         MACRO   FUNCDEF
 _LVO\1  EQU     lvocnt
 lvocnt  SET     lvocnt-LIB_VECTSIZE
         ENDM


 INCLUDE "exec/types.i"
 INCLUDE "exec/exec_lib.i"
...

phxass output:

Pass1

 lvocnt SET LIB_USERDEF
23 Unknown directive
 in line 18 (= line 18 of amiga_draw.s)

In line 1 of macro FUNCDEF
 _LVO\1 equ lvocnt
23 Unknown directive
 in line 214 (= line 12 of include:exec/exec_lib.i)

In line 2 of macro FUNCDEF
 lvocnt set lvocnt-LIB_VECTSIZE
23 Unknown directive
 in line 215 (= line 12 of include:exec/exec_lib.i)

In line 1 of macro FUNCDEF
 _LVO\1 equ lvocnt
23 Unknown directive
 in line 217 (= line 13 of include:exec/exec_lib.i)

In line 2 of macro FUNCDEF
 lvocnt set lvocnt-LIB_VECTSIZE
23 Unknown directive
 in line 218 (= line 13 of include:exec/exec_lib.i)


... etc.


now i know bugger all about assembly. but it seems totally utterly stupid that i'd have to write my own when the rest of the libs, headers and autodocs are bundled together. so anyone know how to make it work?

notes:
1. there is not a funcdef.i include file in the ndk
2. there's an example funcdef macro in a provided header (libraries.i) but that doesnt work either
3. i really do know nothing about asm and just want the bastards to compile/link
edit: 4: the formatting here is out but i believe that the commands are correctly tabbed apart
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #1 on: November 26, 2003, 10:32:24 PM »
riiiiight, but the function stubs in lib headers such as exec/exec_libs.i are formatted thus:

   FUNCDEF   AllocMem
   FUNCDEF   AllocAbs
   FUNCDEF   FreeMem
   FUNCDEF   AvailMem
   FUNCDEF   AllocEntry
   FUNCDEF   FreeEntry
   FUNCDEF   Insert

etc. and knowing nothing about asm i've no idea what to do.
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #2 on: November 27, 2003, 01:20:05 AM »
nope that macro kicks off with

funcoffptr   SET   -30
unknown directive


and the rest is pretty much the same as the previous outputs

KARLOS: your first mini macro doesnt put out any errors but bizzarley i'm getting random errors like

SCREENWIDTH   EQU   320
unknown directive

_init_r_draw
unknown directive


it could all be fubar

edit: it was fubar, quite a lot of the tabbing was out, once i fixed it all it got through pass1 OK. then when it got to pass2 i got a billion "undefined xdef: _anything" errors which i hope are linker errors, seen as it's got nothing to link it to yet!
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #3 on: November 27, 2003, 01:51:05 AM »
riiight, so if i do

      MACRO   FUNCDEF
_LVO\1       EQU   FUNC_CNT
FUNC_CNT    EQU   FUNC_CNT-6
FUNC_CNT    EQU   LIB_USERDEF
       ENDM

then i get a lot of "undefined symbol" errors, i think pertaining to "FUNC_CNT"


edit:

is it me not knowing anything about asm and what's supposed to be happening but surely if you do

var set var-6

then

var equ something

the first step is totally pointledd?
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #4 on: November 27, 2003, 02:08:41 AM »
it wont let me do the set macro as apparently it already exists, it must be a proper internal thing as it's no where in my sources.

her we go then:

\tMACRO\tFUNCDEF
_LVO\1\tEQU\tFUNC_CNT
FUNC_CNT\tSET\tFUNC_CNT-6
FUNC_CNT\tEQU\tLIB_USERDEF
\tENDM

this version gives only one error for each invokation "variable declared twice" (i think) for the func_cnt set func_cnt-6 line

 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #5 on: November 27, 2003, 02:22:52 AM »
i have a phxass.guide and none of it appears to be in a language i understand! why wont it just work!? :-(
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #6 on: November 27, 2003, 03:16:59 AM »
from comp.sys.amiga.programmer

>         INCLUDE "exec/types.i"
>         INCLUDE "exec/libraries.i"
>
> lvocnt  SET     LIB_USERDEF
>
>         MACRO   FUNCDEF
> _LVO\1  EQU     lvocnt
> lvocnt  SET     lvocnt-LIB_VECTSIZE
>         ENDM
>
>         INCLUDE "exec/exec_lib.i"

this one appears to work , the files all compile, now i've *just* got to figure out how hunk2gcc works!


edit: right i've think i've got hunk2gcc working (there's hunk2aout too, but it spams out a load of text and bungs out files with random names.

so i've finally got all my .o files in one place and....

it thinks about linking them and then exits with the same error a million times in a row it says something about "aoutx.h" basically.


 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #7 on: November 27, 2003, 09:54:43 PM »
right i've got the entire think to link, at least i think there are no undefined/missing symbols etc. but it wont link because i get a billion "ld: bfd assertion fail" errors? is it a buggy version of ld (gg330) or should i be using a different linker?
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #8 on: November 27, 2003, 10:37:57 PM »
nope, 295 yields the exact same error
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #9 on: November 29, 2003, 12:44:40 AM »
what? eh? it wants golded. i already deleted it, do i have to reinstall the golded thing to get the gcc things., what are the files? cant you just la up the different ones, i assume they're bins


 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #10 on: November 29, 2003, 01:13:38 AM »
i'm wandering now if it's a problem with the files hunk2aout is generating as the actual "error" that ld puts out is "unsupported reloc: -1"after all the "bfd assertion fail" reports, and the number of those looks like it might correspond to the number of relocs that hunk2aout reports.

edit: i tried a hunk2aout from 1998 and that does the same as the one i was using before (1999)

edit 2: this
http://www.freelists.org/archives/yamos-dev/11-2002/msg00016.html
is the only thing on the whole internet that i've found that mirrors my problem. yet i'm not debugging as that link suggests.
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: funcdef macro in phxass?
« Reply #11 on: November 29, 2003, 03:08:12 AM »
yeah golded shmolded. i found the offending lib file anyway so it's ok. doesnt help me out though :-(