Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C ASM TurboC++ TurboC
I am a novice C/C++ developer still in college. One of the topics that I would like to explore is the inline assembly that C language has. However, I have not been able to locate any resource (via google) that teaches me how to use inline assembly in the Turbo C IDE. I am using Turbo C as it is most familiar to me. I have not already learnt assembly via GASS as I am not familiar with the environment GNU/Linux provides for C. Please provide me with resources to learn assembly via TASM. I am an absolute novice in assembly and would like to learn the assembly for x86 processor family.
Posted 25-Mar-13 8:00am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This question caught my eye. I think it is great that you are interested in exploring the low level universe of programming. It can be a frustrating experience, but when you get something working and you understand what you just did, it is a great feeling.
 
I used Turbo C many years ago when it was DOS based and later when it evolved into C++ Builder, but I have not followed the latest history. I just Googled a bit and it looks like they made a stripped down version of C++ Builder that they named Turbo C. I assume that is what you have.
 
I don't know what the latest version is or when it was released, but I suspect you might be limited in functionality. As far as I understand, Turbo C is no longer supported and it might not be able to handle the newer instruction sets introduced in modern CPUs. My advice would be to use a newer IDE if it is possible for you. I don't know if Visual Studio is ideal, but it is what I have used in the past.
 
I did find a couple of links to the old Turbo C stuff. Maybe that can help you out:
http://www.ic.unicamp.br/~celio/mc404/turboc201/embedded-asm.html[^]
https://sites.google.com/site/pratiktambe/assemblyandc[^]
 
If you instead want to try out Visual Studio, here are two CodeProject articles to get you started:
Using Inline Assembly in C/C++[^]
Inline Assembly in GCC Vs VC++[^]
 
I like the links given in Solution 1. Below are some of my old links, but since my inline assembly code was done a few years ago in order to optimize video compression code, the links might be a little advanced for you at this stage.
Paul Hsieh's Assembly Lab[^]
Assembly Gems[^]
Mark Larson: Assembly Optimization Tips[^]
Agner: Optimizing assembly code[^]
 
The last link (Agner) is one of those with advanced context, but I included it here because it is the reference for anyone looking into using assembly code for optimization purposes. Additionally, there is a great list of links at the bottom of that page.
 

All the best.
Soren Madsen
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 25-Mar-13 18:56pm
   
5ed.
—SA
SoMad at 25-Mar-13 20:22pm
   
Thank you Sergey.
 
Soren Madsen
parths at 26-Mar-13 3:17am
   
Thanks for the excellent set of links. 5'ed!
SoMad at 26-Mar-13 18:17pm
   
You are welcome. If anyone find it useful, I am happy.
 
Soren Madsen
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
vishurockssrivastava at 25-Mar-13 13:36pm
   
I have a small problem- the first link you linked to is for MASM which will be present in Visual C/C++ and the second one you linked to is related to A86 assembler. Neither of the links are related to TASM or Turbo Assembler. However, both are useful for me (and I'm definitely going to start reading the A86 reference) but neither allow me to inline the code in my Turbo C code. In TASM, the asm command doesn't have _ preceeding it. Its simple asm mov eax,#FFFF or asm mov eax,FFFFh
Style-7 at 25-Mar-13 14:18pm
   
http://www.ic.unicamp.br/~celio/mc404/turboc201/embedded-asm.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100