Thread: Turbo C

  1. #16
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,662
    I think alot of C developers like to speed up their code by using ASM
    I'd have to disagree with this. It's been a seriously long time since I had to do this. Mind you, I still look at the ASM the compiler generates, just to make sure it's generating the code I expect.

    Writing ASM is very much the last resort when it comes to speeding up your code - there are so many other things you can do before you have to do this.

    It is also very hard to do - especially on modern processors with multiple stage pipelines, and in some cases multiple execution units. Being able to program for such processors to their best advantage will take a lot of effort (non-portable learning effort I might add).

    http://www.ontek.com/mikey/optimization.html

    The only real reason for using ASM is as Witch_King says, writing operating systems, where the compiler cannot generate the instructions you require. These typically being the supervisor level instructions for managing cache, memory management units and so on.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  2. #17
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    you can use asm to optomize speed critical parts of teh program. Doesn't it also allow (restricted) access to the hardware?
    Monday - what a way to spend a seventh of your life

  3. #18
    Anti-Terrorist
    Join Date
    Aug 2001
    Location
    mming, Game DevelopmentCSR >&<>&2Minimization of boolean functions, PROM,PLA design >&0>&WA, USA guitar, dogsCommercial Aviation >&>>&USAProgramming
    Posts
    742
    You should learn how to work with your operating system, not against it. There are so many details to win32 API without getting into assembly programming, that you can use to speed up your programs critical paths. Try working with individual processes, look up threading. But getting any more specific limits the compatibility of the program and can be a danger to the complex and efficiently designed professional operating system. If anything, next gerneration operating systems are even more complex and powerful, they allow the programmer to write more secure programs, to have more control over libraries and to protect programs from each other, especially programs that share assemblies.
    I compile code with:
    Visual Studio.NET beta2

  4. #19
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    C/C++ compilers have come a long way since asm was the way to speed up a program. I like using asm for communicating with the hardware. But that is only a preferrence. Usually better algorithms can increase speed. It is also good to learn asm to know what your compiler is doing. Also a very good asm programmer (which i am not) can very quickly debug code by looking at a program's errors. The point is that asm isn't necessarily faster (it can be) but it can be a preferrence.

  5. #20
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    well...

    I love learning about ASM. It gives you sort of an intimate knowledge of the processor. althought Salem is right when he says that modern processors with the added segments/pipelines/etc. are hard to work with. Although, the only use I've ever found for it is using it to speed up character output. Other than that...I dunno. Maybe speeding up renering time in a program or something.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help creating game with Turbo C
    By Trafalgar Law in forum Game Programming
    Replies: 10
    Last Post: 09-17-2008, 06:54 AM
  2. Remember Turbo? It is comming back
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2006, 01:26 PM
  3. Turbo Assembler
    By darkknight1984 in forum Tech Board
    Replies: 2
    Last Post: 03-10-2005, 01:05 PM
  4. What is Borland and Turbo
    By pratapgj in forum C Programming
    Replies: 1
    Last Post: 07-30-2002, 11:36 AM
  5. Turbo C 2.01
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 05-10-2002, 09:59 AM