site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hi, Specifically: # This dummy example code does not assemble: .intel_syntax noprefix L1: test eax,eax jnz L1 ret ..... %as test1.s %test1.s:6:suffix or operands invalid for `jnz' % as test2.s % otool -Vt test2.o test2.o: (__TEXT,__text) section 00000000 testl %eax,%eax 00000002 jne 0x00000000 00000004 ret #include <stdio.h> int main(int ac, char *av) { if (ac == 2) goto there; printf("Here\n"); there: printf("There\n"); } Then hack the output .s it to change: leal LC0-"L00000000001$pb"(%ebx), %eax movl %eax, (%esp) call L_puts$stub L2: to: leal LC0-"L00000000001$pb"(%ebx), %eax movl %eax, (%esp) call L_puts$stub testl %eax, %eax jnz L5 L2: And then do cc -arch i386 -o foo foo.s; works fine for me. -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Sep 14, 2008, at 9:04 AM, LuigiG wrote: What is the correct syntax for conditional jumps (j<cc>) in GNU as when using intel syntax? # This code (same but temp. switch to AT&T syntax) assembles correctly: .intel_syntax noprefix L1: test eax,eax .att_syntax jnz L1 .intel_syntax noprefix ret I'm using: Apple Inc version cctools-698.1~1, GNU assembler version 1.38 What's up?? You are either not specifying -arch i386 and are compiling on a PPC, or you failed to include the .text directive, or you are failing to use cc rather than as to build the .o file from the .s file. Try this with cc -arch i386 -S foo.c: This email sent to site_archiver@lists.apple.com