From urpradhan at gmail.com Wed Aug 8 02:53:55 2007 From: urpradhan at gmail.com (Utkal Ranjan Pradhan) Date: Wed, 8 Aug 2007 15:23:55 +0530 Subject: Help :: Stuck with YASM and VS 2005 Message-ID: <004e01c7d9a2$0b4466f0$21cd34d0$@com> Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefansel at hotmail.de Wed Aug 8 02:59:16 2007 From: stefansel at hotmail.de (Stefan Sellmer) Date: Wed, 8 Aug 2007 10:59:16 +0100 Subject: Help :: Stuck with YASM and VS 2005 Message-ID: which calling convention do you use ?? the same in both compiling steps ? best regards,Stefan To: yasm-devel at tortall.netSubject: Help :: Stuck with YASM and VS 2005Date: Wed, 8 Aug 2007 15:23:55 +0530From: urpradhan at gmail.com Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com _________________________________________________________________ Gefunden! Tolle Bilder von Kati Witt gibt es hier! http://search.msn.de/images/results.aspx?q=katarina%20witt&form=MIDGPS -------------- next part -------------- An HTML attachment was scrubbed... URL: From urpradhan at gmail.com Wed Aug 8 03:20:04 2007 From: urpradhan at gmail.com (Utkal Ranjan Pradhan) Date: Wed, 8 Aug 2007 15:50:04 +0530 Subject: Help :: Stuck with YASM and VS 2005 In-Reply-To: References: Message-ID: <000001c7d9a5$b58741c0$2095c540$@com> Thank you friend for your reply first. Yes, I use the following steps in both cases: For Win-64 Plat form: ============= 1. Yasm-win64.exe ?p gas ?f win64 *.s 2. Then using the generated *.obj file with other *.c and *.h files and creating the library (*.lib) in Vs 2005, using option /MT 3. Using my library I?m building my *.exe which gives run time error For Linux-64 Platform: ============== 1. Using GCC creating the library 2. Using the library, building the binary, which is working perfectly fine Now, I have gone through the YASM wiki page (http://www.tortall.net/projects/yasm/wiki/VisualStudio2005), where it has been mentioned that: There appears to be a linker bug in the VC++ v8 linker that prevents symbols with absolute addresses being linked in DLL builds. Plz help me. Thank You; URPradhan At Gmail Dot Com From: Stefan Sellmer [mailto:stefansel at hotmail.de] Sent: Wednesday, August 08, 2007 3:29 PM To: Utkal Ranjan Pradhan; yasm-devel at tortall.net Subject: RE: Help :: Stuck with YASM and VS 2005 which calling convention do you use ?? the same in both compiling steps ? best regards,Stefan _____ To: yasm-devel at tortall.net Subject: Help :: Stuck with YASM and VS 2005 Date: Wed, 8 Aug 2007 15:23:55 +0530 From: urpradhan at gmail.com Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com _____ WOW ? sch?ne Bilder von Eva Longoria! Hier klicken! Live Search -------------- next part -------------- An HTML attachment was scrubbed... URL: From urpradhan at gmail.com Wed Aug 8 04:32:24 2007 From: urpradhan at gmail.com (Utkal Ranjan Pradhan) Date: Wed, 8 Aug 2007 17:02:24 +0530 Subject: Help :: Stuck with YASM and VS 2005 In-Reply-To: References: Message-ID: <000501c7d9af$cccb53d0$6661fb70$@com> Hi I?m using __cdecl (/Gd) calling convention in Visual Studio 2005. Thank You; URPradhan At Gmail Dot Com From: Stefan Sellmer [mailto:stefansel at hotmail.de] Sent: Wednesday, August 08, 2007 3:29 PM To: Utkal Ranjan Pradhan; yasm-devel at tortall.net Subject: RE: Help :: Stuck with YASM and VS 2005 which calling convention do you use ?? the same in both compiling steps ? best regards,Stefan _____ To: yasm-devel at tortall.net Subject: Help :: Stuck with YASM and VS 2005 Date: Wed, 8 Aug 2007 15:23:55 +0530 From: urpradhan at gmail.com Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com _____ WOW ? sch?ne Bilder von Eva Longoria! Hier klicken! Live Search -------------- next part -------------- An HTML attachment was scrubbed... URL: From sthielemann at bitleap.com Wed Aug 8 06:07:03 2007 From: sthielemann at bitleap.com (John Seth Thielemann) Date: Wed, 08 Aug 2007 09:07:03 -0400 Subject: Help :: Stuck with YASM and VS 2005 In-Reply-To: <000501c7d9af$cccb53d0$6661fb70$@com> References: <000501c7d9af$cccb53d0$6661fb70$@com> Message-ID: <46B9BFF7.6070507@bitleap.com> Utkal; Just taking a quick look at the source and your comments, it looks and sounds like an ABI issue. RDI holds the first argument parameter under Linux-64, however under Windows-64, the RCX register holds the first argument parameter. For more information that might help: http://www.agner.org/optimize/ you may be interested in manual 2, 5 for this problem. Hope I that I may have helped, ~Seth Utkal Ranjan Pradhan wrote: > > Hi > > I?m using __cdecl (/Gd) calling convention in Visual Studio 2005. > > Thank You; > > URPradhan At Gmail Dot Com > > *From:* Stefan Sellmer [mailto:stefansel at hotmail.de] > *Sent:* Wednesday, August 08, 2007 3:29 PM > *To:* Utkal Ranjan Pradhan; yasm-devel at tortall.net > *Subject:* RE: Help :: Stuck with YASM and VS 2005 > > which calling convention do you use ?? > the same in both compiling steps ? > > best regards,Stefan > > > ------------------------------------------------------------------------ > > To: yasm-devel at tortall.net > Subject: Help :: Stuck with YASM and VS 2005 > Date: Wed, 8 Aug 2007 15:23:55 +0530 > From: urpradhan at gmail.com > > Friends > > I?m using YASM (latest version) for my GAS syntax (SSE2) assembly > files in Windows 64-bit environment. > > And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , > which creates the *.obj files for me perfectly. > > But after linking these *.obj files to my exe application (I?m using > Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception > > Note that the same assembly file is getting compiled and the > application is perfectly running in 64-bit Linux using GCC compiler. > > While debugging my application in VS 2005, I got the particular place > where I?m getting this error, but as I do not know much about assembly > coding I need your help. > > I?m listing the assembly code below and marking the place where I?m > getting this error at run time. > > push %rbp > > movq %rsp,%rbp > > push %rbx > > emms > > push %r12 > > push %r13 > > push %r14 > > push %r15 > > subq $408,%rsp ## local variable stack space (n*16+8) > > ## zero 32-bit iteration counters > > movl $0,%eax > > movl %eax,nb110_nouter(%rsp) > > movl %eax,nb110_ninner(%rsp) > > movl (%rdi),%edi ?================================= Getting Error at > this place > > movl %edi,nb110_nri(%rsp) > > movq %rsi,nb110_iinr(%rsp) > > movq %rdx,nb110_jindex(%rsp) > > movq %rcx,nb110_jjnr(%rsp) > > movq %r8,nb110_shift(%rsp) > > movq %r9,nb110_shiftvec(%rsp) > > movq nb110_p_ntype(%rbp),%rdi > > movl (%rdi),%edi > > movl %edi,nb110_ntype(%rsp) > > movq nb110_p_facel(%rbp),%rsi > > movsd (%rsi),%xmm0 > > movsd %xmm0,nb110_facel(%rsp) > > Hope to get suitable replies from this forum. > > Thank You; > > URPradhan At Gmail Dot Com > > ------------------------------------------------------------------------ > > WOW ? sch?ne Bilder von Eva Longoria! Hier klicken! Live Search > > > ------------------------------------------------------------------------ > > _______________________________________________ > yasm-devel mailing list > yasm-devel at tortall.net > http://cvs.tortall.net/mailman/listinfo/yasm-devel > From paulbarker at mailsnare.net Sat Aug 18 05:41:14 2007 From: paulbarker at mailsnare.net (Paul Barker) Date: Sat, 18 Aug 2007 13:41:14 +0100 Subject: ARM/PPC Support? Message-ID: <46C6E8EA.5000205@mailsnare.net> Hi, I've been trying to find an interesting project to work on for a while now, and I'm considering the idea of adding a couple of new architecture modules to yasm. Primarily I'm interested in ARM, but if theres already some code written for PPC support it might be an idea to start there. I've had a look around the current source tree (from subversion) and played around with a couple of things to try to learn the interface. I'm a little confused as to the status of the LC-3B arch module... is this deprecated? It no longer compiles and it looks like the arch module interface has changed and LC-3B hasn't kept up-to-date. I was hoping that I could learn the interface from a simple module rather than having to understand the x86 module. As well as looking at architecture modules, I've looked at the other open tickets for the 0.7.0 milestone. For a GAS-like preprocessor, would it help if I wrote a very simple preprocessor which can remove comments and handle the '.include' directive and nothing else? This probably doesn't involve too much work. I don't want to get your hopes up too much since I don't know how much time I will have to work on all this yet, but I'm happy to help out when I can. Thanks, -- Paul Barker http://eternalseptember.co.uk/ From dfeustel at mindspring.com Sat Aug 18 07:42:40 2007 From: dfeustel at mindspring.com (dfeustel at mindspring.com) Date: Sat, 18 Aug 2007 14:42:40 +0000 (GMT) Subject: complete (but short) sample yasm example Message-ID: <20070818144243.4C526183D9@cvs.tortall.net> Hi! I'm using yasm for amd 64-bit mode assembly and I have two questions: - Can yasm be used to produce 'flat mode' 16-bit assemblies like Flat assembler for bios code (how)? - Are there examples of complete yasm assembly files? (I haven't found any yet). (I haven't figured out what the prologue and epilogue of a yasm file should be). Also, I think all AM2 Athlon64 chips now support sse3 (mine does). Thanks, Dave Feustel -- From dfeustel at mindspring.com Sat Aug 18 13:26:49 2007 From: dfeustel at mindspring.com (dfeustel at mindspring.com) Date: Sat, 18 Aug 2007 20:26:49 +0000 (GMT) Subject: sse 4.1, 4.2 different from sse 4a Message-ID: <20070818202650.B7098183D9@cvs.tortall.net> So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure that I agree with xbit about this. What do you think? -- From arkon at ragestorm.net Sat Aug 18 13:38:45 2007 From: arkon at ragestorm.net (Gil Dabah) Date: Sat, 18 Aug 2007 23:38:45 +0300 Subject: sse 4.1, 4.2 different from sse 4a In-Reply-To: <20070818202650.B7098183D9@cvs.tortall.net> References: <20070818202650.B7098183D9@cvs.tortall.net> Message-ID: <46C758D5.4080307@ragestorm.net> Does it really matter that the new AMD instructions are under SSE4a and not SSE41? I classified them as SSE41 in diStorm. I don't see a good reason to put them in a new category. dfeustel at mindspring.com wrote: > So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at > http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure > that I agree with xbit about this. What do you think? > > > > > -- > _______________________________________________ > yasm-devel mailing list > yasm-devel at tortall.net > http://cvs.tortall.net/mailman/listinfo/yasm-devel > > From peter at tortall.net Sat Aug 18 14:48:24 2007 From: peter at tortall.net (Peter Johnson) Date: Sat, 18 Aug 2007 14:48:24 -0700 (PDT) Subject: sse 4.1, 4.2 different from sse 4a In-Reply-To: <20070818202650.B7098183D9@cvs.tortall.net> References: <20070818202650.B7098183D9@cvs.tortall.net> Message-ID: <20070818144525.N56983@cvs.tortall.net> On Sat, 18 Aug 2007, dfeustel at mindspring.com wrote: > So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at > http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure > that I agree with xbit about this. What do you think? You're right; they're indicated by different CPUID bits (SSE4.1 and 4.2 are ECX bits 19 and 20 for EAX=0x0001; SSE4a is ECX bit 6 for EAX=0x80000001). I'll fix yasm. Not a big deal in the short term of course; it only affects CPU xxx directive processing. Thanks, Peter From arkon at ragestorm.net Sat Aug 18 15:15:45 2007 From: arkon at ragestorm.net (Gil Dabah) Date: Sun, 19 Aug 2007 01:15:45 +0300 Subject: sse 4.1, 4.2 different from sse 4a In-Reply-To: <20070818144525.N56983@cvs.tortall.net> References: <20070818202650.B7098183D9@cvs.tortall.net> <20070818144525.N56983@cvs.tortall.net> Message-ID: <46C76F91.7050704@ragestorm.net> Thanks for clarification. Peter Johnson wrote: > On Sat, 18 Aug 2007, dfeustel at mindspring.com wrote: > > >> So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at >> http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure >> that I agree with xbit about this. What do you think? >> > > You're right; they're indicated by different CPUID bits (SSE4.1 and 4.2 > are ECX bits 19 and 20 for EAX=0x0001; SSE4a is ECX bit 6 for > EAX=0x80000001). I'll fix yasm. Not a big deal in the short term of > course; it only affects CPU xxx directive processing. > > Thanks, > Peter > _______________________________________________ > yasm-devel mailing list > yasm-devel at tortall.net > http://cvs.tortall.net/mailman/listinfo/yasm-devel > > From peter at tortall.net Sat Aug 18 15:28:04 2007 From: peter at tortall.net (Peter Johnson) Date: Sat, 18 Aug 2007 15:28:04 -0700 (PDT) Subject: ARM/PPC Support? In-Reply-To: <46C6E8EA.5000205@mailsnare.net> References: <46C6E8EA.5000205@mailsnare.net> Message-ID: <20070818144829.Q56983@cvs.tortall.net> On Sat, 18 Aug 2007, Paul Barker wrote: > I've been trying to find an interesting project to work on for a while now, and > I'm considering the idea of adding a couple of new architecture modules to yasm. > Primarily I'm interested in ARM, but if theres already some code written for PPC > support it might be an idea to start there. > > I've had a look around the current source tree (from subversion) and played > around with a couple of things to try to learn the interface. I'm a little > confused as to the status of the LC-3B arch module... is this deprecated? It no > longer compiles and it looks like the arch module interface has changed and > LC-3B hasn't kept up-to-date. I was hoping that I could learn the interface from > a simple module rather than having to understand the x86 module. Yeah, the authors of LC-3b have a nasty habit of changing the instruction definitions seemingly every year, so I stopped supporting it and unhooked it from the build. I'll work on unbitrotting it and reconnectting it as an example. For RISC machines, I'd really like to see an arch module generator based on an instruction description (this is very difficult to do for x86, but should be significantly easier for PPC/ARM). I started writing one for PPC and LC-3b (in Python) but didn't get anywhere close to completing it. If this sounds like an interesting project, I'd love to see this completed, and I do have some starter code for you to look at along those lines. Right now the code I have just generates the .c and .gap files for the instruction tables; ideally it would generate even more (e.g. the entire architecture would be the goal). See the just-added GenArch wiki page . > As well as looking at architecture modules, I've looked at the other open > tickets for the 0.7.0 milestone. For a GAS-like preprocessor, would it help if I > wrote a very simple preprocessor which can remove comments and handle the > '.include' directive and nothing else? This probably doesn't involve too much work. I also have a work in progress improvement for the GAS preprocessor, but I got bogged down in implementing .macro. I can hand it off to you if you're interested in this. I need to make sure it compiles first :). > I don't want to get your hopes up too much since I don't know how much time I > will have to work on all this yet, but I'm happy to help out when I can. Sure, I understand. Thanks for your help, every little bit is appreciated! Peter From dfeustel at mindspring.com Sun Aug 19 12:54:11 2007 From: dfeustel at mindspring.com (dfeustel at mindspring.com) Date: Sun, 19 Aug 2007 19:54:11 +0000 (GMT) Subject: 2 problems Message-ID: <20070819195411.EAE8C183D9@cvs.tortall.net> I am using yasm to assemble fasm as 64-bit code. Two problems have shown up. For some reason I am getting many redefined symbol warnings for the string instructions (eg. lods, stos). I also am getting many messages about 'instruction must follow label'. This happens where labels are on a line by themselves. Adding an instruction does not eliminate the error message. Are standalone labels really considered by yasm to be errors or is there something else wrong? Thanks, Dave Feustel -- From peter at tortall.net Sun Aug 19 13:42:56 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 13:42:56 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819195411.EAE8C183D9@cvs.tortall.net> References: <20070819195411.EAE8C183D9@cvs.tortall.net> Message-ID: <20070819133733.M95546@cvs.tortall.net> On Sun, 19 Aug 2007, dfeustel at mindspring.com wrote: > I am using yasm to assemble fasm as 64-bit code. > Two problems have shown up. > > For some reason I am getting many redefined symbol warnings for the string > instructions (eg. lods, stos). What do these lines look like? Are they just "lods", "stos", or do they specify size (e.g. "lodsw", "stosd"). Yasm requires the latter. > I also am getting many messages about 'instruction must follow label'. This > happens where labels are on a line by themselves. Adding an instruction does > not eliminate the error message. Are standalone labels really considered by > yasm to be errors or is there something else wrong? I'm not sure how you're getting that exact message. I can't find it in any of the error messages yasm generates. Can you show a piece of the code and yasm's error output for this case? Peter From peter at tortall.net Sun Aug 19 14:14:15 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 14:14:15 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819205442.87692183D9@cvs.tortall.net> References: <20070819205442.87692183D9@cvs.tortall.net> Message-ID: <20070819140530.Y5320@cvs.tortall.net> On Sun, 19 Aug 2007, dave wrote: > yasm fasm.asm -f elf64 > system.yinc:102: instruction expected after label > [open: push esi edi ebp ] > system.yinc:124: instruction expected after label > [ path_char_ok: > stos byte [edi] > ] > system.yinc:131: instruction expected after label > ../version.inc:39: instruction expected after label > fasm.asm:214: warning: value does not fit in 8 bit field > ../expressi.inc:29: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:60: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:67: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:69: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:71: redefinition of `stos' You must use "stosb" (or if you're paranoid, "a32 stosb") rather than "stos byte [edi]". Yasm (and NASM) do not support the latter syntax. Most likely this is what's causing the "instruction expected after label" errors too; e.g.: label: stos byte [edi] Will generate this error, as stos isn't an instruction. Peter From peter at tortall.net Sun Aug 19 15:12:44 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 15:12:44 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819214036.834A1183D9@cvs.tortall.net> References: <20070819214036.834A1183D9@cvs.tortall.net> Message-ID: <20070819150256.V74113@cvs.tortall.net> On Sun, 19 Aug 2007, dave wrote: > I changed all the stos byte ... instructions to stosb ... and that > got rid of a lot of errors. However, I am seeing the stos error > message in places where there is no stos instruction.-- > > ../assemble.inc:1633: redefinition of `stos' > cmp byte [esi],'.' > je invalid_value > push ebx edx > call get_dword_value > pop edx ebx <= line 1633 > mov [esp],eax > > I suspect that multiple operands to push/pop are illegal > (but extremely handy :-) ). Any chance of making that legal in yasm? You can mimic this via the use of macros. Yasm will not be supporting this natively (just like NASM), as not only is multiple operands not a real instruction, but because of this, the order by which these multiple operands are actually pushed onto the stack is not standardized (is push ebx edx equivalent to push ebx followed by push edx, or vice-versa; should pop pop in reverse order of its arguments or not?). Something like this example from the NASM manual might work: %macro multipush 1-* %rep %0 push %1 %rotate 1 %endrep %endmacro Which runs from left to right through the multipush arguments. Peter From peter at tortall.net Sun Aug 19 16:05:08 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 16:05:08 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819224213.216A5183D9@cvs.tortall.net> References: <20070819224213.216A5183D9@cvs.tortall.net> Message-ID: <20070819155733.B16782@cvs.tortall.net> On Sun, 19 Aug 2007, dave wrote: > Speaking of macros, why doesn't the following definition work? > > %macro movs 2 > %substr t macro '%1' 1 > movs%t %2,%3 > %endmacro > > movs dword [edi] dword [edi] is a single identifier parameter. So what you want is something like: %macro movs 1 %ifidni %1, dword [edi] a32 movsd %elifidni %1, word [edi] a32 movsw ; etc for other combinations %endif %endmacro Peter From kedar.potdar at gmail.com Fri Aug 24 00:10:58 2007 From: kedar.potdar at gmail.com (Kedar Potdar) Date: Fri, 24 Aug 2007 12:40:58 +0530 Subject: 64 bit programming issue... Message-ID: <015301c7e61d$eefe6d00$0298580a@persistent.co.in> Hi, I am currently porting 64 bit application with C and Assembly code (x86-64) from Linux to windows. I am using Microsoft C-Compiler 2005 and Yasm for compiling C and assembly code respectively. I have modified the assembly files as per the 64-bit ABI specification for windows and i do get expected results when i use ?RTCs? flag which is meant for stack pointer verification. This flag also requires optimization flags to be turned off. The problem starts when i dont use the ?RTCs? (which is the case in release version) it tries to access initial locations (0?04a0) of memory in C-code. I suspect that it has something to do with calling convention mismatch when control gets transferred from assembly to C-function. Any help in this regard would be highly appreciated. With warm regards, KEDAR -------------- next part -------------- An HTML attachment was scrubbed... URL: From urpradhan at gmail.com Wed Aug 8 02:53:55 2007 From: urpradhan at gmail.com (Utkal Ranjan Pradhan) Date: Wed, 8 Aug 2007 15:23:55 +0530 Subject: Help :: Stuck with YASM and VS 2005 Message-ID: <004e01c7d9a2$0b4466f0$21cd34d0$@com> Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefansel at hotmail.de Wed Aug 8 02:59:16 2007 From: stefansel at hotmail.de (Stefan Sellmer) Date: Wed, 8 Aug 2007 10:59:16 +0100 Subject: Help :: Stuck with YASM and VS 2005 Message-ID: which calling convention do you use ?? the same in both compiling steps ? best regards,Stefan To: yasm-devel at tortall.netSubject: Help :: Stuck with YASM and VS 2005Date: Wed, 8 Aug 2007 15:23:55 +0530From: urpradhan at gmail.com Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com _________________________________________________________________ Gefunden! Tolle Bilder von Kati Witt gibt es hier! http://search.msn.de/images/results.aspx?q=katarina%20witt&form=MIDGPS -------------- next part -------------- An HTML attachment was scrubbed... URL: From urpradhan at gmail.com Wed Aug 8 03:20:04 2007 From: urpradhan at gmail.com (Utkal Ranjan Pradhan) Date: Wed, 8 Aug 2007 15:50:04 +0530 Subject: Help :: Stuck with YASM and VS 2005 In-Reply-To: References: Message-ID: <000001c7d9a5$b58741c0$2095c540$@com> Thank you friend for your reply first. Yes, I use the following steps in both cases: For Win-64 Plat form: ============= 1. Yasm-win64.exe ?p gas ?f win64 *.s 2. Then using the generated *.obj file with other *.c and *.h files and creating the library (*.lib) in Vs 2005, using option /MT 3. Using my library I?m building my *.exe which gives run time error For Linux-64 Platform: ============== 1. Using GCC creating the library 2. Using the library, building the binary, which is working perfectly fine Now, I have gone through the YASM wiki page (http://www.tortall.net/projects/yasm/wiki/VisualStudio2005), where it has been mentioned that: There appears to be a linker bug in the VC++ v8 linker that prevents symbols with absolute addresses being linked in DLL builds. Plz help me. Thank You; URPradhan At Gmail Dot Com From: Stefan Sellmer [mailto:stefansel at hotmail.de] Sent: Wednesday, August 08, 2007 3:29 PM To: Utkal Ranjan Pradhan; yasm-devel at tortall.net Subject: RE: Help :: Stuck with YASM and VS 2005 which calling convention do you use ?? the same in both compiling steps ? best regards,Stefan _____ To: yasm-devel at tortall.net Subject: Help :: Stuck with YASM and VS 2005 Date: Wed, 8 Aug 2007 15:23:55 +0530 From: urpradhan at gmail.com Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com _____ WOW ? sch?ne Bilder von Eva Longoria! Hier klicken! Live Search -------------- next part -------------- An HTML attachment was scrubbed... URL: From urpradhan at gmail.com Wed Aug 8 04:32:24 2007 From: urpradhan at gmail.com (Utkal Ranjan Pradhan) Date: Wed, 8 Aug 2007 17:02:24 +0530 Subject: Help :: Stuck with YASM and VS 2005 In-Reply-To: References: Message-ID: <000501c7d9af$cccb53d0$6661fb70$@com> Hi I?m using __cdecl (/Gd) calling convention in Visual Studio 2005. Thank You; URPradhan At Gmail Dot Com From: Stefan Sellmer [mailto:stefansel at hotmail.de] Sent: Wednesday, August 08, 2007 3:29 PM To: Utkal Ranjan Pradhan; yasm-devel at tortall.net Subject: RE: Help :: Stuck with YASM and VS 2005 which calling convention do you use ?? the same in both compiling steps ? best regards,Stefan _____ To: yasm-devel at tortall.net Subject: Help :: Stuck with YASM and VS 2005 Date: Wed, 8 Aug 2007 15:23:55 +0530 From: urpradhan at gmail.com Friends I?m using YASM (latest version) for my GAS syntax (SSE2) assembly files in Windows 64-bit environment. And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , which creates the *.obj files for me perfectly. But after linking these *.obj files to my exe application (I?m using Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception Note that the same assembly file is getting compiled and the application is perfectly running in 64-bit Linux using GCC compiler. While debugging my application in VS 2005, I got the particular place where I?m getting this error, but as I do not know much about assembly coding I need your help. I?m listing the assembly code below and marking the place where I?m getting this error at run time. push %rbp movq %rsp,%rbp push %rbx emms push %r12 push %r13 push %r14 push %r15 subq $408,%rsp ## local variable stack space (n*16+8) ## zero 32-bit iteration counters movl $0,%eax movl %eax,nb110_nouter(%rsp) movl %eax,nb110_ninner(%rsp) movl (%rdi),%edi ?================================= Getting Error at this place movl %edi,nb110_nri(%rsp) movq %rsi,nb110_iinr(%rsp) movq %rdx,nb110_jindex(%rsp) movq %rcx,nb110_jjnr(%rsp) movq %r8,nb110_shift(%rsp) movq %r9,nb110_shiftvec(%rsp) movq nb110_p_ntype(%rbp),%rdi movl (%rdi),%edi movl %edi,nb110_ntype(%rsp) movq nb110_p_facel(%rbp),%rsi movsd (%rsi),%xmm0 movsd %xmm0,nb110_facel(%rsp) Hope to get suitable replies from this forum. Thank You; URPradhan At Gmail Dot Com _____ WOW ? sch?ne Bilder von Eva Longoria! Hier klicken! Live Search -------------- next part -------------- An HTML attachment was scrubbed... URL: From sthielemann at bitleap.com Wed Aug 8 06:07:03 2007 From: sthielemann at bitleap.com (John Seth Thielemann) Date: Wed, 08 Aug 2007 09:07:03 -0400 Subject: Help :: Stuck with YASM and VS 2005 In-Reply-To: <000501c7d9af$cccb53d0$6661fb70$@com> References: <000501c7d9af$cccb53d0$6661fb70$@com> Message-ID: <46B9BFF7.6070507@bitleap.com> Utkal; Just taking a quick look at the source and your comments, it looks and sounds like an ABI issue. RDI holds the first argument parameter under Linux-64, however under Windows-64, the RCX register holds the first argument parameter. For more information that might help: http://www.agner.org/optimize/ you may be interested in manual 2, 5 for this problem. Hope I that I may have helped, ~Seth Utkal Ranjan Pradhan wrote: > > Hi > > I?m using __cdecl (/Gd) calling convention in Visual Studio 2005. > > Thank You; > > URPradhan At Gmail Dot Com > > *From:* Stefan Sellmer [mailto:stefansel at hotmail.de] > *Sent:* Wednesday, August 08, 2007 3:29 PM > *To:* Utkal Ranjan Pradhan; yasm-devel at tortall.net > *Subject:* RE: Help :: Stuck with YASM and VS 2005 > > which calling convention do you use ?? > the same in both compiling steps ? > > best regards,Stefan > > > ------------------------------------------------------------------------ > > To: yasm-devel at tortall.net > Subject: Help :: Stuck with YASM and VS 2005 > Date: Wed, 8 Aug 2007 15:23:55 +0530 > From: urpradhan at gmail.com > > Friends > > I?m using YASM (latest version) for my GAS syntax (SSE2) assembly > files in Windows 64-bit environment. > > And I?m using the command like: yasm-win64.exe ?p gas ?f win64 *.s , > which creates the *.obj files for me perfectly. > > But after linking these *.obj files to my exe application (I?m using > Visual Studio 2005) , I?m getting RUN TIME error like: Unhanded Exception > > Note that the same assembly file is getting compiled and the > application is perfectly running in 64-bit Linux using GCC compiler. > > While debugging my application in VS 2005, I got the particular place > where I?m getting this error, but as I do not know much about assembly > coding I need your help. > > I?m listing the assembly code below and marking the place where I?m > getting this error at run time. > > push %rbp > > movq %rsp,%rbp > > push %rbx > > emms > > push %r12 > > push %r13 > > push %r14 > > push %r15 > > subq $408,%rsp ## local variable stack space (n*16+8) > > ## zero 32-bit iteration counters > > movl $0,%eax > > movl %eax,nb110_nouter(%rsp) > > movl %eax,nb110_ninner(%rsp) > > movl (%rdi),%edi ?================================= Getting Error at > this place > > movl %edi,nb110_nri(%rsp) > > movq %rsi,nb110_iinr(%rsp) > > movq %rdx,nb110_jindex(%rsp) > > movq %rcx,nb110_jjnr(%rsp) > > movq %r8,nb110_shift(%rsp) > > movq %r9,nb110_shiftvec(%rsp) > > movq nb110_p_ntype(%rbp),%rdi > > movl (%rdi),%edi > > movl %edi,nb110_ntype(%rsp) > > movq nb110_p_facel(%rbp),%rsi > > movsd (%rsi),%xmm0 > > movsd %xmm0,nb110_facel(%rsp) > > Hope to get suitable replies from this forum. > > Thank You; > > URPradhan At Gmail Dot Com > > ------------------------------------------------------------------------ > > WOW ? sch?ne Bilder von Eva Longoria! Hier klicken! Live Search > > > ------------------------------------------------------------------------ > > _______________________________________________ > yasm-devel mailing list > yasm-devel at tortall.net > http://cvs.tortall.net/mailman/listinfo/yasm-devel > From paulbarker at mailsnare.net Sat Aug 18 05:41:14 2007 From: paulbarker at mailsnare.net (Paul Barker) Date: Sat, 18 Aug 2007 13:41:14 +0100 Subject: ARM/PPC Support? Message-ID: <46C6E8EA.5000205@mailsnare.net> Hi, I've been trying to find an interesting project to work on for a while now, and I'm considering the idea of adding a couple of new architecture modules to yasm. Primarily I'm interested in ARM, but if theres already some code written for PPC support it might be an idea to start there. I've had a look around the current source tree (from subversion) and played around with a couple of things to try to learn the interface. I'm a little confused as to the status of the LC-3B arch module... is this deprecated? It no longer compiles and it looks like the arch module interface has changed and LC-3B hasn't kept up-to-date. I was hoping that I could learn the interface from a simple module rather than having to understand the x86 module. As well as looking at architecture modules, I've looked at the other open tickets for the 0.7.0 milestone. For a GAS-like preprocessor, would it help if I wrote a very simple preprocessor which can remove comments and handle the '.include' directive and nothing else? This probably doesn't involve too much work. I don't want to get your hopes up too much since I don't know how much time I will have to work on all this yet, but I'm happy to help out when I can. Thanks, -- Paul Barker http://eternalseptember.co.uk/ From dfeustel at mindspring.com Sat Aug 18 07:42:40 2007 From: dfeustel at mindspring.com (dfeustel at mindspring.com) Date: Sat, 18 Aug 2007 14:42:40 +0000 (GMT) Subject: complete (but short) sample yasm example Message-ID: <20070818144243.4C526183D9@cvs.tortall.net> Hi! I'm using yasm for amd 64-bit mode assembly and I have two questions: - Can yasm be used to produce 'flat mode' 16-bit assemblies like Flat assembler for bios code (how)? - Are there examples of complete yasm assembly files? (I haven't found any yet). (I haven't figured out what the prologue and epilogue of a yasm file should be). Also, I think all AM2 Athlon64 chips now support sse3 (mine does). Thanks, Dave Feustel -- From dfeustel at mindspring.com Sat Aug 18 13:26:49 2007 From: dfeustel at mindspring.com (dfeustel at mindspring.com) Date: Sat, 18 Aug 2007 20:26:49 +0000 (GMT) Subject: sse 4.1, 4.2 different from sse 4a Message-ID: <20070818202650.B7098183D9@cvs.tortall.net> So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure that I agree with xbit about this. What do you think? -- From arkon at ragestorm.net Sat Aug 18 13:38:45 2007 From: arkon at ragestorm.net (Gil Dabah) Date: Sat, 18 Aug 2007 23:38:45 +0300 Subject: sse 4.1, 4.2 different from sse 4a In-Reply-To: <20070818202650.B7098183D9@cvs.tortall.net> References: <20070818202650.B7098183D9@cvs.tortall.net> Message-ID: <46C758D5.4080307@ragestorm.net> Does it really matter that the new AMD instructions are under SSE4a and not SSE41? I classified them as SSE41 in diStorm. I don't see a good reason to put them in a new category. dfeustel at mindspring.com wrote: > So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at > http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure > that I agree with xbit about this. What do you think? > > > > > -- > _______________________________________________ > yasm-devel mailing list > yasm-devel at tortall.net > http://cvs.tortall.net/mailman/listinfo/yasm-devel > > From peter at tortall.net Sat Aug 18 14:48:24 2007 From: peter at tortall.net (Peter Johnson) Date: Sat, 18 Aug 2007 14:48:24 -0700 (PDT) Subject: sse 4.1, 4.2 different from sse 4a In-Reply-To: <20070818202650.B7098183D9@cvs.tortall.net> References: <20070818202650.B7098183D9@cvs.tortall.net> Message-ID: <20070818144525.N56983@cvs.tortall.net> On Sat, 18 Aug 2007, dfeustel at mindspring.com wrote: > So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at > http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure > that I agree with xbit about this. What do you think? You're right; they're indicated by different CPUID bits (SSE4.1 and 4.2 are ECX bits 19 and 20 for EAX=0x0001; SSE4a is ECX bit 6 for EAX=0x80000001). I'll fix yasm. Not a big deal in the short term of course; it only affects CPU xxx directive processing. Thanks, Peter From arkon at ragestorm.net Sat Aug 18 15:15:45 2007 From: arkon at ragestorm.net (Gil Dabah) Date: Sun, 19 Aug 2007 01:15:45 +0300 Subject: sse 4.1, 4.2 different from sse 4a In-Reply-To: <20070818144525.N56983@cvs.tortall.net> References: <20070818202650.B7098183D9@cvs.tortall.net> <20070818144525.N56983@cvs.tortall.net> Message-ID: <46C76F91.7050704@ragestorm.net> Thanks for clarification. Peter Johnson wrote: > On Sat, 18 Aug 2007, dfeustel at mindspring.com wrote: > > >> So sayeth xbit labs in its latest article on the AMD K10 microarchitecture at >> http://www.xbitlabs.com/articles/cpu/display/amd-k10_10.html. I'm not sure >> that I agree with xbit about this. What do you think? >> > > You're right; they're indicated by different CPUID bits (SSE4.1 and 4.2 > are ECX bits 19 and 20 for EAX=0x0001; SSE4a is ECX bit 6 for > EAX=0x80000001). I'll fix yasm. Not a big deal in the short term of > course; it only affects CPU xxx directive processing. > > Thanks, > Peter > _______________________________________________ > yasm-devel mailing list > yasm-devel at tortall.net > http://cvs.tortall.net/mailman/listinfo/yasm-devel > > From peter at tortall.net Sat Aug 18 15:28:04 2007 From: peter at tortall.net (Peter Johnson) Date: Sat, 18 Aug 2007 15:28:04 -0700 (PDT) Subject: ARM/PPC Support? In-Reply-To: <46C6E8EA.5000205@mailsnare.net> References: <46C6E8EA.5000205@mailsnare.net> Message-ID: <20070818144829.Q56983@cvs.tortall.net> On Sat, 18 Aug 2007, Paul Barker wrote: > I've been trying to find an interesting project to work on for a while now, and > I'm considering the idea of adding a couple of new architecture modules to yasm. > Primarily I'm interested in ARM, but if theres already some code written for PPC > support it might be an idea to start there. > > I've had a look around the current source tree (from subversion) and played > around with a couple of things to try to learn the interface. I'm a little > confused as to the status of the LC-3B arch module... is this deprecated? It no > longer compiles and it looks like the arch module interface has changed and > LC-3B hasn't kept up-to-date. I was hoping that I could learn the interface from > a simple module rather than having to understand the x86 module. Yeah, the authors of LC-3b have a nasty habit of changing the instruction definitions seemingly every year, so I stopped supporting it and unhooked it from the build. I'll work on unbitrotting it and reconnectting it as an example. For RISC machines, I'd really like to see an arch module generator based on an instruction description (this is very difficult to do for x86, but should be significantly easier for PPC/ARM). I started writing one for PPC and LC-3b (in Python) but didn't get anywhere close to completing it. If this sounds like an interesting project, I'd love to see this completed, and I do have some starter code for you to look at along those lines. Right now the code I have just generates the .c and .gap files for the instruction tables; ideally it would generate even more (e.g. the entire architecture would be the goal). See the just-added GenArch wiki page . > As well as looking at architecture modules, I've looked at the other open > tickets for the 0.7.0 milestone. For a GAS-like preprocessor, would it help if I > wrote a very simple preprocessor which can remove comments and handle the > '.include' directive and nothing else? This probably doesn't involve too much work. I also have a work in progress improvement for the GAS preprocessor, but I got bogged down in implementing .macro. I can hand it off to you if you're interested in this. I need to make sure it compiles first :). > I don't want to get your hopes up too much since I don't know how much time I > will have to work on all this yet, but I'm happy to help out when I can. Sure, I understand. Thanks for your help, every little bit is appreciated! Peter From dfeustel at mindspring.com Sun Aug 19 12:54:11 2007 From: dfeustel at mindspring.com (dfeustel at mindspring.com) Date: Sun, 19 Aug 2007 19:54:11 +0000 (GMT) Subject: 2 problems Message-ID: <20070819195411.EAE8C183D9@cvs.tortall.net> I am using yasm to assemble fasm as 64-bit code. Two problems have shown up. For some reason I am getting many redefined symbol warnings for the string instructions (eg. lods, stos). I also am getting many messages about 'instruction must follow label'. This happens where labels are on a line by themselves. Adding an instruction does not eliminate the error message. Are standalone labels really considered by yasm to be errors or is there something else wrong? Thanks, Dave Feustel -- From peter at tortall.net Sun Aug 19 13:42:56 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 13:42:56 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819195411.EAE8C183D9@cvs.tortall.net> References: <20070819195411.EAE8C183D9@cvs.tortall.net> Message-ID: <20070819133733.M95546@cvs.tortall.net> On Sun, 19 Aug 2007, dfeustel at mindspring.com wrote: > I am using yasm to assemble fasm as 64-bit code. > Two problems have shown up. > > For some reason I am getting many redefined symbol warnings for the string > instructions (eg. lods, stos). What do these lines look like? Are they just "lods", "stos", or do they specify size (e.g. "lodsw", "stosd"). Yasm requires the latter. > I also am getting many messages about 'instruction must follow label'. This > happens where labels are on a line by themselves. Adding an instruction does > not eliminate the error message. Are standalone labels really considered by > yasm to be errors or is there something else wrong? I'm not sure how you're getting that exact message. I can't find it in any of the error messages yasm generates. Can you show a piece of the code and yasm's error output for this case? Peter From peter at tortall.net Sun Aug 19 14:14:15 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 14:14:15 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819205442.87692183D9@cvs.tortall.net> References: <20070819205442.87692183D9@cvs.tortall.net> Message-ID: <20070819140530.Y5320@cvs.tortall.net> On Sun, 19 Aug 2007, dave wrote: > yasm fasm.asm -f elf64 > system.yinc:102: instruction expected after label > [open: push esi edi ebp ] > system.yinc:124: instruction expected after label > [ path_char_ok: > stos byte [edi] > ] > system.yinc:131: instruction expected after label > ../version.inc:39: instruction expected after label > fasm.asm:214: warning: value does not fit in 8 bit field > ../expressi.inc:29: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:60: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:67: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:69: redefinition of `stos' > system.yinc:124: `stos' previously defined here > ../expressi.inc:71: redefinition of `stos' You must use "stosb" (or if you're paranoid, "a32 stosb") rather than "stos byte [edi]". Yasm (and NASM) do not support the latter syntax. Most likely this is what's causing the "instruction expected after label" errors too; e.g.: label: stos byte [edi] Will generate this error, as stos isn't an instruction. Peter From peter at tortall.net Sun Aug 19 15:12:44 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 15:12:44 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819214036.834A1183D9@cvs.tortall.net> References: <20070819214036.834A1183D9@cvs.tortall.net> Message-ID: <20070819150256.V74113@cvs.tortall.net> On Sun, 19 Aug 2007, dave wrote: > I changed all the stos byte ... instructions to stosb ... and that > got rid of a lot of errors. However, I am seeing the stos error > message in places where there is no stos instruction.-- > > ../assemble.inc:1633: redefinition of `stos' > cmp byte [esi],'.' > je invalid_value > push ebx edx > call get_dword_value > pop edx ebx <= line 1633 > mov [esp],eax > > I suspect that multiple operands to push/pop are illegal > (but extremely handy :-) ). Any chance of making that legal in yasm? You can mimic this via the use of macros. Yasm will not be supporting this natively (just like NASM), as not only is multiple operands not a real instruction, but because of this, the order by which these multiple operands are actually pushed onto the stack is not standardized (is push ebx edx equivalent to push ebx followed by push edx, or vice-versa; should pop pop in reverse order of its arguments or not?). Something like this example from the NASM manual might work: %macro multipush 1-* %rep %0 push %1 %rotate 1 %endrep %endmacro Which runs from left to right through the multipush arguments. Peter From peter at tortall.net Sun Aug 19 16:05:08 2007 From: peter at tortall.net (Peter Johnson) Date: Sun, 19 Aug 2007 16:05:08 -0700 (PDT) Subject: 2 problems In-Reply-To: <20070819224213.216A5183D9@cvs.tortall.net> References: <20070819224213.216A5183D9@cvs.tortall.net> Message-ID: <20070819155733.B16782@cvs.tortall.net> On Sun, 19 Aug 2007, dave wrote: > Speaking of macros, why doesn't the following definition work? > > %macro movs 2 > %substr t macro '%1' 1 > movs%t %2,%3 > %endmacro > > movs dword [edi] dword [edi] is a single identifier parameter. So what you want is something like: %macro movs 1 %ifidni %1, dword [edi] a32 movsd %elifidni %1, word [edi] a32 movsw ; etc for other combinations %endif %endmacro Peter From kedar.potdar at gmail.com Fri Aug 24 00:10:58 2007 From: kedar.potdar at gmail.com (Kedar Potdar) Date: Fri, 24 Aug 2007 12:40:58 +0530 Subject: 64 bit programming issue... Message-ID: <015301c7e61d$eefe6d00$0298580a@persistent.co.in> Hi, I am currently porting 64 bit application with C and Assembly code (x86-64) from Linux to windows. I am using Microsoft C-Compiler 2005 and Yasm for compiling C and assembly code respectively. I have modified the assembly files as per the 64-bit ABI specification for windows and i do get expected results when i use ?RTCs? flag which is meant for stack pointer verification. This flag also requires optimization flags to be turned off. The problem starts when i dont use the ?RTCs? (which is the case in release version) it tries to access initial locations (0?04a0) of memory in C-code. I suspect that it has something to do with calling convention mismatch when control gets transferred from assembly to C-function. Any help in this regard would be highly appreciated. With warm regards, KEDAR -------------- next part -------------- An HTML attachment was scrubbed... URL: