Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Assembly code & binary numbers [modified]

Assembly code & binary numbers [modified]

Scheduled Pinned Locked Moved IT & Infrastructure
c++delphiperformancequestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Heinz_
    wrote on last edited by
    #1

    Hi, programs written with assembly code executes faster so, should we try to embed as much assembly code as we can in our pascal,c,c++,d code if we need speed? Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor? Thx. -- modified at 20:46 Sunday 30th July, 2006

    J T D H 4 Replies Last reply
    0
    • H Heinz_

      Hi, programs written with assembly code executes faster so, should we try to embed as much assembly code as we can in our pascal,c,c++,d code if we need speed? Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor? Thx. -- modified at 20:46 Sunday 30th July, 2006

      J Offline
      J Offline
      Jonathan Darka
      wrote on last edited by
      #2

      Heinz_ wrote:

      programs written with assembly code executes faster so

      It depends on who writes the code.

      Heinz_ wrote:

      should we try to embed as much assembly code as we can in...

      no, whatever language you use just try to write efficient code, there are several books on this. Assembler is non-portable, difficult to read and unnecessary for most programs.

      Heinz_ wrote:

      Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor?

      No, the compiler will do this. regards,


      Darka [Xanya] "When you're taught to love everyone, to love your enemies, then what value does that place on love?"

      1 Reply Last reply
      0
      • H Heinz_

        Hi, programs written with assembly code executes faster so, should we try to embed as much assembly code as we can in our pascal,c,c++,d code if we need speed? Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor? Thx. -- modified at 20:46 Sunday 30th July, 2006

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        that's totally ideological dream...

        Heinz_ wrote:

        should we use binary numbers in c++ code

        C++ doesn't understand binary numbers moreover, that would have been useless, as the compiler traduces all that stuff into binary when making the bin


        TOXCCT >>> GEII power

        [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

        1 Reply Last reply
        0
        • H Heinz_

          Hi, programs written with assembly code executes faster so, should we try to embed as much assembly code as we can in our pascal,c,c++,d code if we need speed? Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor? Thx. -- modified at 20:46 Sunday 30th July, 2006

          D Offline
          D Offline
          Duncan Edwards Jones
          wrote on last edited by
          #4

          Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor? Erm - we already do. When you write x = 5 in source code this compiles as "put the binary number 00000000000000101 into the memory address 0011010001110110" which is ready for the processor. ...should we try to embed as much assembly code as we can in our pascal,c,c++,d...? No. Only really very very skilled developers can write better assembly code than an optimizing compiler and on a processor that executes 3.2 million operations per second the difference would be impossible to measure.

          '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

          1 Reply Last reply
          0
          • H Heinz_

            Hi, programs written with assembly code executes faster so, should we try to embed as much assembly code as we can in our pascal,c,c++,d code if we need speed? Can we and should we use binary numbers in c++ code so they are already translated and ready for use by the processor? Thx. -- modified at 20:46 Sunday 30th July, 2006

            H Offline
            H Offline
            Heinz_
            wrote on last edited by
            #5

            So, in conclusion assembler code is recommended only for special cases such as direct hardware communication and others. Assemblers is non portable across cpu architectures but is portable across OS platforms right? x86 asm code is the same in all platforms so it should be portable in this term, but asm syntax code is not compatible between different assemblers. Correct me if i'm wrong. ¿Hardware drivers are written or parts of them in assembler?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups