hi Alex,

re: Mac OS X assembler, a quick check shows the followg:
(I have also include the output of 'man as' as an attachment)

BTW I'm running OS X 10.6.2, Developer Tools (XCode) 3.2
The working build of picolisp 32bit was from the testing version, the
stable version still gave problem as off Dec 9, '09.

$ man as: shows the following....

DESCRIPTION
       The  as  command  translates  assembly code in the named files to
       object code.  If no files are specified,  as  reads  from  stdin.
       All undefined symbols in the assembly are treated as global.  The
       output of the assembly is left in the file a.out by default.

       The program /usr/bin/as is actually a driver that executes assem-
       blers  for specific target architectures.  If no target architec-
       ture is specified, it defaults to the architecture of the host it
       is running on.

OPTIONS
       -o name
              Name the output file name instead of a.out.

       -arch arch_type
              Specifies  the  target  architecture,  arch_type,  of  the
              assembler to be executed.  The target assemblers for  each
              architecture  are  in /usr/libexec/gcc/darwin/arch_type/as
              or /usr/local/libexec/gcc/darwin/arch_type/as.   There  is
              only  one  assembler  for  an architecture family.  If the
              specified target architecture is a machine-specific imple-
              mentation,  the  assembler for that architecture family is
              executed (e.g., /usr/libexec/gcc/darwin/ppc/as  for  -arch
              ppc604e).  See arch(3) for the currently known arch_types.

   --snip--

.and $ ls /usr/libexec/gcc/darwin/   shows:
i386/   ppc/    ppc64/  x86_64/

..$ /usr/libexec/gcc/darwin/x86_64/as -v
Apple Inc version cctools-750~70, GNU assembler version 1.38

--$ arch    just executing arch on the terminal...
i386


notes:

1. In Mac OS X, the Developer Tools are not installed by default,

it comes on the CD that comes with the Mac and the user has to perform
the install manually. This may give the impression that the tools are
not there.

2. In Apple's Developer Docs they admit its not updated...

<http://developer.apple.com/mac/library/documentation/DeveloperTools/Reference/Assembler/000-Introduction/introduction.html#//apple_ref/doc/uid/TP30000851-CH211-DontLinkElementID_9>

..and in the addressing mode chapter, it doesn't mention 64 bit
registers for i386.

but the assembler has an 'arch' flag, and there is a 'x86-64' version
of the assemble in  /usr/libexec/gcc/darwin/x86_64/as, whatever that
means.

..so perhaps all that's needed is to set the 'arch' flag?

3. >'...The Makefile in the "src64/" directory is already prepared for "Darwin"

Yes its there but running 'make' gives this error:
    make: *** No rule to make target `sys/darwin.code.l', needed by
`x86-64.darwin.base.s'.  Stop.


PS
I apologize for being really ignorant about all this, a misspent
youth, too much with high level languages I guess.... ;-)



On Fri, Dec 11, 2009 at 12:54 AM, Alexander Burger <a...@software-lab.de> wrote:
> Hi Boh Yap,
>
>> I can also confirm it builds and passes test OK on Snow Leopard Mac OSX.
>
> Great! Thanks.
>
>
>> backgrnd... should I wait for the 64 bit version? And if so how much
>> longer?
>
> While the 64-bit version itself is finished, and quite good tested on
> Linx meanwhile, building it on Snow Leopard is not clear yet.
>
> As I understand it, the GNU assembler 'as' - where the 64-bit version
> depends on - is either not installed on Snow Leopard, or not even
> available. From what I've heard there is only a 32-bit assembler. Or is
> it just a default mode, and 64-bits can be easily switched on?
>
> It would be great if you could investigate the matter. The Makefile in
> the "src64/" directory is already prepared for "Darwin" but I think this
> does not fit (especially suspicious is the MACOSX_DEPLOYMENT_TARGET=10.4
> entry).
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
>



-- 
#-------
regds,

Boh Heong, Yap
AS(1)                                                                    AS(1)



NNAAMMEE
       as - Mac OS X Mach-O GNU-based assemblers

SSYYNNOOPPSSIISS
       aass [ _o_p_t_i_o_n _._._.  ] [ _f_i_l_e _._._.  ]

DDEESSCCRRIIPPTTIIOONN
       The  _a_s  command  translates assembly code in the named files to 
object
       code.  If no files are specified, _a_s reads from ssttddiinn.   
All  undefined
       symbols  in  the  assembly  are  treated  as global.  The output of the
       assembly is left in the file aa..oouutt by default.

       The program //uussrr//bbiinn//aass is actually a driver that  
executes  assemblers
       for specific target architectures.  If no target architecture is speci-
       fied, it defaults to the architecture of the host it is running on.

OOPPTTIIOONNSS
       --oo _n_a_m_e
              Name the output file _n_a_m_e instead of aa..oouutt.

       --aarrcchh _a_r_c_h___t_y_p_e
              Specifies the target architecture, _a_r_c_h___t_y_p_e, 
of  the  assembler
              to be executed.  The target assemblers for each architecture are
              in            
//uussrr//lliibbeexxeecc//ggcccc//ddaarrwwiinn//_a_r_c_h___t_y_p_e//aass
            or
              
//uussrr//llooccaall//lliibbeexxeecc//ggcccc//ddaarrwwiinn//_a_r_c_h___t_y_p_e//aass_.
   There  is only one
              assembler for an architecture family.  If the  specified  target
              architecture is a machine-specific implementation, the assembler
              for   that    architecture    family    is    executed    (e.g.,
              
//uussrr//lliibbeexxeecc//ggcccc//ddaarrwwiinn//ppppcc//aass
  for --aarrcchh ppppcc660044ee).  See _a_r_c_h(3)
              for the currently known _a_r_c_h___t_y_p_es.

       --aarrcchh__mmuullttiippllee
              Precede any displayed messages with a line stating  the  program
              name  (aass) and the architecture (from the --aarrcchh 
_a_r_c_h___t_y_p_e flag),
              to distinguish which architecture the error messages  refer  to.
              When  the _c_c(1) driver program is run with multiple 
--aarrcchh flags,
              it invokes _a_s with the 
--aarrcchh__mmuullttiippllee option.

       --ffoorrccee__ccppuussuubbttyyppee__AALLLL
              By default, the assembler will produce the CPU subtype  ALL  for
              the  object file it is assembling if it finds no implementation-
              specific instructions.  Also  by  default,  the  assembler  will
              allow  implementation-specific instructions and will combine the
              CPU subtype for those specific implementations.   The  combining
              of  specific  implementations is architecture-dependent; if some
              combination of instructions is not allowed, an error  is  gener-
              ated.    With   the  optional  
--ffoorrccee__ccppuussuubbttyyppee__AALLLL  flag,  all
              instructions are allowed and the object file's CPU subtype  will
              be  the  ALL subtype.  If the target architecture specified is a
              machine-specific  implementation  (e.g.,  --aarrcchh  
ppppcc660033,   --aarrcchh
              ii448866),  the  assembler will flag as errors instructions 
that are
              not supported on that  architecture,  and  it  will  produce  an
              object  file  with the CPU subtype for that specific implementa-
              tion (even if no implementation-specific instructions are used).
              The  
--ffoorrccee__ccppuussuubbttyyppee__AALLLL  flag  is the 
default for all x86 and
              x86_64 architectures.

       --ddyynnaammiicc
              Enables dynamic linking features.  This is the default.

       --ssttaattiicc
              Causes the assembler to treat  as  an  error  any  features  for
              dynamic linking.  Also causes the .text directive to not include
              the pure_instructions section attribute.

       ----     Use ssttddiinn for the assembly source input.

       --nn     Instructs the assembler not to assume  that  the  assembly  
file
              starts  with  a ..tteexxtt directive.  Use this option when 
an output
              file is not to contain a (__TEXT,__text) section or this section
              is not to be first one in the output file.

       --ff     Fast;  no  need  for  the assembler preprocessor (``app'').  
The
              assembler preprocessor can also be turned off  by  starting  the
              assembly  file  with  "#NO_APP\n".   This is intended for use by
              compilers which produce assembly code in a strict "clean" format
              that  specifies  exactly where whitespace can go.  The assembler
              preprocessor needs to be  run  on  hand-written  assembly  files
              and/or  files  that have been preprocessed by the C preprocessor
              ccpppp..  This is typically needed when assembler files  are  
assem-
              bled  through  the use of the _c_c(1) command, which 
automatically
              runs the C preprocessor on assembly source files.  The assembler
              preprocessor strips out excess spaces, turns single-quoted char-
              acters into a decimal constants, and turns # <number> <filename>
              <level>  into  .line <number>;.file <filename>  pairs.  When the
              assembler preprocessor has been turned off by a  "#NO_APP\n"  at
              the start of a file, it can be turned back on and off again with
              pairs of "#APP\n" and "#NO_APP\n" at the  beginnings  of  lines.
              This  is  used  by the compiler to wrap assembly statements pro-
              duced from aassmm(()) statements.

       --gg     Produce debugging information for the symbolic  debugger  
_g_d_b(1)
              so  that  the assembly source can be debugged symbolically.  The
              debugger depends on correct use of the C preprocessor's #include
              directive  or  the  assembler's .include directive:  Any include
              file that produces instructions in the  (__TEXT,__text)  section
              must be included while a .text directive is in effect.  In other
              words, there must be a .text directive before the  include,  and
              the  .text  directive  must still be in effect at the end of the
              include file.  Otherwise, the debugger will get confused when in
              that assembly file.

       --vv     Display  the version of the assembler (both the Mac OS X 
version
              and the GNU version it is based on).

       --VV     Print the path and the command line of the assembler the  
assem-
              bler driver is using.

       --II_d_i_r  Add  the  directory _d_i_r to the list of 
directories to search for
              files included with the .include directive.  The  default  place
              to search is the current directory.

       --WW     Suppress warnings.

       --LL     Save  non-global  defined  labels  beginning  with an 'L'; 
these
              labels are normally discarded to save  space  in  the  resultant
              symbol table.  The compiler generates such temporary labels.

AAsssseemmbblleerr ooppttiioonnss ffoorr tthhee 
PPoowweerrPPCC pprroocceessssoorrss
       
--ssttaattiicc__bbrraanncchh__pprreeddiiccttiioonn__YY__bbiitt
              Treat  a  single trailing '+' or '-' after a conditional PowerPC
              branch instruction as a static branch prediction that  sets  the
              Y-bit  in the opcode.  Pairs of trailing "++" or "--" always set
              the AT-bits. This is the default for Mac OS X.

       
--ssttaattiicc__bbrraanncchh__pprreeddiiccttiioonn__AATT__bbiittss
              Treat a single trailing '+' or '-' after a  conditional  PowerPC
              branch  instruction  as a static branch prediction that sets the
              AT-bits in the opcode. Pairs of trailing "++" or "--" always set
              the  AT-bits  but  with  this option a warning is issued if this
              syntax is used.  With this flag the assembler behaves  like  the
              IBM tools.

       --nnoo__ppppcc660011
              Treat any PowerPC 601 instructions as an error.

FFIILLEESS
       a.out     output file

SSEEEE AALLSSOO
       The  Mac  OS  X  Assembler Reference in the Xcode documentation viewer:
       Perform a title search for "assembler" in Apple > Developer Tools  Ref-
       erence Library.
       The assembler source in the cctools module of the Darwin sources.
       cc(1), ld(1), nm(1), otool(1), arch(3), Mach-O(5)



Apple, Inc.                     April 24, 2007                           AS(1)

Reply via email to