How make C and ASM in borland 5.02?

Posted on 2003-03-07
Medium Priority
Last Modified: 2013-12-13
Hello, i like of know how i can make C and ASM programs in Borland 5.02(i think) but no using the __asm stand. One external file with the asm code and asm function, and so creater some like one LIB, or BGI(for grapichs). I dont know nothing about how create the .hex file for the asm code. How it know were start the code in the LIB(this is one example) and viculate with the .hex file? i am lost!!!
I am little new in C and i already know >ASM< language. Please, help-me!!! Thanks you very much if anyone can help-me!

Francisco Filho Brasil! :/
Question by:Franciscofilho
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 24

Accepted Solution

fridom earned 140 total points
ID: 8101124
Well the usually way to combine C and ASM is either through inline assembler or what I guess you want to do is the following.
1) Write you assembler code
2) compile that to object code (not an exectable)
3) link the object file with you application.



Assisted Solution

xyzzer earned 140 total points
ID: 8103758
Besides, if You want to link many modules in different languages You have to remember about the function-call standards. There are:


They mostly differ in the order of parameters passing and clean-up responsibility (whether the function or the caller removes things from the stack).

Besides, from what I remember if You want to call a function named FunctionNameHere from C module - its name in ASM module should be _FunctionNameHere.

That's what I remember from my "Operating Systems" labs (classes?).


Expert Comment

ID: 8340905
you can use any common assembler,
like TASM, MASM, NASM and so on,
a lot of theam available as freeware,
such as MASM as part of ms win98 sdk to
assemble your code to object files.
link these then together with your c project.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question