CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Assembly
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Assembly Questions and Answers for Assembly here!

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old December 1st, 2004, 02:58 PM
    YourSurrogateGod YourSurrogateGod is offline
    Senior Member
     
    Join Date: Apr 2004
    Location: In the back seat of New Horizons.
    Posts: 1,229
    YourSurrogateGod is a jewel in the rough (200+)YourSurrogateGod is a jewel in the rough (200+)YourSurrogateGod is a jewel in the rough (200+)
    Intel and AMD

    From what I hear, AMD is a clone of Intel. Does that mean that assembly that executes fine on Intel will work just as well on AMD? Sorry if this question has been asked already...
    __________________
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.
    Reply With Quote
      #2    
    Old December 3rd, 2004, 03:19 PM
    Maven Maven is offline
    Junior Member
     
    Join Date: Feb 2003
    Location: Greeneville, TN
    Posts: 17
    Maven is an unknown quantity at this point (<10)
    Re: Intel and AMD

    It may be slower but it will run, unless you use optimizations that are specific to intel or amd.
    __________________
    I never travel without my diary. One should always have something sensational to read.
    Reply With Quote
      #3    
    Old December 4th, 2004, 12:45 AM
    kahlinor kahlinor is offline
    Member
     
    Join Date: Nov 2004
    Posts: 34
    kahlinor is an unknown quantity at this point (<10)
    Re: Intel and AMD

    If you do not use AMD specific instruction extensions, there won't be a conflict.
    Reply With Quote
      #4    
    Old December 15th, 2004, 02:01 PM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Intel and AMD

    Quote:
    Originally Posted by YourSurrogateGod
    From what I hear, AMD is a clone of Intel. Does that mean that assembly that executes fine on Intel will work just as well on AMD? Sorry if this question has been asked already...
    They both use the basic instruction set specified by IBM several years ago. If you look deeper into some graphical/multimedia extension you will find differences between them there. So beware: Your source code will work on both machines if you don't use any Intel Multimedia extensions.
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #5    
    Old December 15th, 2004, 05:24 PM
    Sam Hobbs Sam Hobbs is offline
    Elite Member
    Power Poster
     
    Join Date: May 1999
    Location: Southern California
    Posts: 12,261
    Sam Hobbs has a spectacular aura about (125+)Sam Hobbs has a spectacular aura about (125+)
    Re: Intel and AMD

    Just think a bit.

    Have you ever seen versions of software thart was specific to AMD or Intel? In other words, have you ever seen software that requires either an AMD or Intel processor?

    Well, maybe. If so, then they require a specific processor due to some extra features of the specific processor, but if so, then it is rare. As far as I know, at least 99% of all Pentium software works with either Intel or AMD.
    __________________
    "Signature":
    My web site is Simple Samples.
    Reply With Quote
      #6    
    Old December 15th, 2004, 05:39 PM
    Sam Hobbs Sam Hobbs is offline
    Elite Member
    Power Poster
     
    Join Date: May 1999
    Location: Southern California
    Posts: 12,261
    Sam Hobbs has a spectacular aura about (125+)Sam Hobbs has a spectacular aura about (125+)
    Re: Intel and AMD

    Quote:
    Originally Posted by NoHero
    They both use the basic instruction set specified by IBM several years ago.
    Specified where? I am very interested in seeing the IBM specifications describing the basic Pentium instruction set. The basic Pentium instruction set of course is based upon the processor used in the original IBM PC, so I suppose it would be those specifications that are relevant.

    So did IBM contract with Intel to build the processor designed by IBM for the PC?
    __________________
    "Signature":
    My web site is Simple Samples.
    Reply With Quote
      #7    
    Old December 15th, 2004, 08:01 PM
    YourSurrogateGod YourSurrogateGod is offline
    Senior Member
     
    Join Date: Apr 2004
    Location: In the back seat of New Horizons.
    Posts: 1,229
    YourSurrogateGod is a jewel in the rough (200+)YourSurrogateGod is a jewel in the rough (200+)YourSurrogateGod is a jewel in the rough (200+)
    Re: Intel and AMD

    Quote:
    Originally Posted by Sam Hobbs
    Just think a bit.

    Have you ever seen versions of software thart was specific to AMD or Intel? In other words, have you ever seen software that requires either an AMD or Intel processor?

    Well, maybe. If so, then they require a specific processor due to some extra features of the specific processor, but if so, then it is rare. As far as I know, at least 99% of all Pentium software works with either Intel or AMD.
    :shrug: I'm new to assembly, hence the question. I know that C, C++ and Java will work fine, I just wasn't sure if the linker did something different in an AMD machine in order to get them to run, as opposed to an Intel one.
    __________________
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.
    Reply With Quote
      #8    
    Old December 15th, 2004, 09:10 PM
    Sam Hobbs Sam Hobbs is offline
    Elite Member
    Power Poster
     
    Join Date: May 1999
    Location: Southern California
    Posts: 12,261
    Sam Hobbs has a spectacular aura about (125+)Sam Hobbs has a spectacular aura about (125+)
    Re: Intel and AMD

    I have not done a lot of assembler programming, but I have done some; both for Intel processors and for old-style big IBM "Mainframe" processors. I am familiar with what compilers and linkers do, and what happens during execution. I don't say that to brag; I am trying to avoid making you feel bad for not being familiar with those things. For me, it is very obvious that there is no difference between the machine instructions for AMD and Intel processors.

    The output of a linker is dependent on the operating system. For a Linux system, I assume the output would be the same in terms of format, but the machine instructions would vary depending on the processor. The fundamental purpose of a linker is to combine files created by compilers; the files might have been created by the same compiler or they could be from different compilers (and an assembler of course). In most environments, a linker is the only way to mix source code from more than one compiler into a single static link. A linker also allows multiple source files for a single compiler/assembler to be combined into a single executable.
    __________________
    "Signature":
    My web site is Simple Samples.
    Reply With Quote
      #9    
    Old December 16th, 2004, 05:51 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Intel and AMD

    Quote:
    Originally Posted by Sam Hobbs
    Specified where? I am very interested in seeing the IBM specifications describing the basic Pentium instruction set. The basic Pentium instruction set of course is based upon the processor used in the original IBM PC, so I suppose it would be those specifications that are relevant.

    So did IBM contract with Intel to build the processor designed by IBM for the PC?
    In those old days where IBM ruled this business they made a specifcation (based on the Intel processors engine) how a Personal Computer should work. This was necessary because Intel was unable to protect their label "x86". So other companies created clone processors called "7086" (I remember my friend has such a thing, he was really pissed off when he realized that a normal DOS doesn't work on this thing. I can't say if it was created by AMD or not) for example, but those were not compatible to any standard. IBM specified that - you may see "IBM compatible" on old software and or on old devices - based on the work of Intel. Intel renamed it's processor to Pentium so they can protect it, and avoid such clones as the "7086". That's the story behind IBM and Intel and why AMD needs to fit with this specification. Other story would be MIPS or PPC processors.
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #10    
    Old December 16th, 2004, 12:11 PM
    Sam Hobbs Sam Hobbs is offline
    Elite Member
    Power Poster
     
    Join Date: May 1999
    Location: Southern California
    Posts: 12,261
    Sam Hobbs has a spectacular aura about (125+)Sam Hobbs has a spectacular aura about (125+)
    Re: Intel and AMD

    Again, show us the specifications. I doubt the accuracy of most of what you are saying.

    I searched the internet for "+7086 processor"; I did not see anything about a 7086 processor. So if can find anything about what you are talking about, then that will be interesting.
    __________________
    "Signature":
    My web site is Simple Samples.
    Reply With Quote
      #11    
    Old December 16th, 2004, 12:15 PM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Intel and AMD

    Quote:
    Originally Posted by Sam Hobbs
    Again, show us the specifications. I doubt the accuracy of most of what you are saying.

    I searched the internet for "+7086 processor"; I did not see anything about a 7086 processor. So if can find anything about what you are talking about, then that will be interesting.
    I always thought so. . Otherwise I cannot explain myself the "IBM Compatible" sticker my old 486 processor has ... If you can, please feel free to do so.
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #12    
    Old December 16th, 2004, 12:25 PM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Intel and AMD

    Quote:
    IBM, a strategic partner of Intel, soon started manufacturing PCs based on this CPU. Several manufacturers (Compaq, Columbia, Kayro, etc.) also built machines with i8086 inside, and claimed them to be "IBM-compatible" (however, their BIOSes weren't totally compatible with IBM's one).

    About 14.9 million units were sold (including clones).
    Ok its not exactly what I meant but it is the same direction ... Sry for confusing you all:
    http://www.alasir.com/x86ref/
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #13    
    Old December 17th, 2004, 05:08 PM
    Maven Maven is offline
    Junior Member
     
    Join Date: Feb 2003
    Location: Greeneville, TN
    Posts: 17
    Maven is an unknown quantity at this point (<10)
    Re: Intel and AMD

    As I said above, unless you use specific instructions related to intel or AMD your code will run. They both use the x86 language.

    I also said that it might run slower. This is true when you move from one type of processor to another. Moving from intel to amd or even intel to a different chipset of intel. The reason I say this is some things work better on some processors then others. The reason is because of how the chip handles the instructions internally, some do some instructions good and some instructions bad. Things that may have been in fashion for a P2 may not be in fashion for a P4.

    The only instruction that I know of that you should avoid on any processor is "Div" or any form of it. Division instructions whore clock cycles like a *****. Even in high level languages I do work arounds for division when they are in loops to keep the compiler from spiting out a div instruction.
    __________________
    I never travel without my diary. One should always have something sensational to read.
    Reply With Quote
      #14    
    Old December 17th, 2004, 06:26 PM
    Sam Hobbs Sam Hobbs is offline
    Elite Member
    Power Poster
     
    Join Date: May 1999
    Location: Southern California
    Posts: 12,261
    Sam Hobbs has a spectacular aura about (125+)Sam Hobbs has a spectacular aura about (125+)
    Re: Intel and AMD

    Quote:
    Originally Posted by Maven
    Even in high level languages I do work arounds for division when they are in loops to keep the compiler from spiting out a div instruction.
    Assuming that the denominator is totally variable (unpredictalbe), are there work arounds that are faster than the Pentium processor's instructions for doing the division? I know that division is among the most processor-intensive instructions for all processors, but the reason why is fundamental to division. I assume that the Intel and AMD engineers have done the best they could to optimize the process, and if you have something better, then you should send them a message. They are likely to be very interested in your algorithm.

    Certainly when dividing by 2 or a power of 2, it is much more efficient to shift the bits, but that works only when it is known at design time what the denominator is.
    __________________
    "Signature":
    My web site is Simple Samples.
    Reply With Quote
      #15    
    Old December 18th, 2004, 07:09 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Intel and AMD

    Yes the division is some quite of processor intensive. But implementing an ALU and divide this instruction several substraction made it quiet fast though. Don't forget the prefech unit that enhances the speed quite good. And it would be interesting to know if your instruction for dividing is faster than this one from the intel processor. I never looked to deep into this that I can say if the MMX clone of div is faster than the normal div/idiv. But most programmers use that if they need a faster division algorithm. Back to the topic of the clones: here you can find some old Intel x86 clones. Just scroll down to "5. Identifying CPU manufacturer through CPUID.". The old ones are these which don't are a link.
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Assembly


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 06:57 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009