Link Assemly function with Turbo C in DOS

Posted on 2003-03-06
Medium Priority
Last Modified: 2012-06-21
Can any one tell me how to link an assembly function with Turbo C 2.0 in DOS?
i write something like thissegment dseg
Assembly file: hello.asm

msg:    db      'Hello, Dear World$'

segment sseg stack
       resb 0x40

segment cseg
       mov     ax, dseg
       mov     ds, ax
       mov     dx, msg
       mov     ah, 0x09
       int     0x21
       mov     ah, 0x4C

C file: try.c
void hi(void)
void main()

i compiled try.c into try.obj in Turbo C2.0 IDE
then i use command line:
nasmw -fobj hello.asm
tlink lib\c0s try hello,try,,lib\cs

the result is
Undefined symbol "_HI" in module try.c

How should i correct this plz?
Question by:Adun
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 11

Accepted Solution

dimitry earned 80 total points
ID: 8089116
You need to declare _hi as Public function.
Try to add to ASM file:
_hi proc near
   Hi Code...
_hi endp
public _hi

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
In this article, I’ll show how research, determination, and use of modern technology helped me solve a DNA mystery.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 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