Thread View: comp.os.msdos.programmer
1 messages
1 total messages
Started by Thomas Dwyer III
Wed, 08 Aug 1990 22:46
Calling .ASM from .C ?
Author: Thomas Dwyer III
Date: Wed, 08 Aug 1990 22:46
Date: Wed, 08 Aug 1990 22:46
50 lines
1625 bytes
1625 bytes
Hi there. I have RTFM many times over and still cannot grasp the idea of
how to call an assembly procedure from Turbo C (I have TC v1.5 & MASM 5.1).
Suppose I have two trivial programs, TEST.C and HELLO.ASM as follows:
TEST.C
------
extern hello();
main()
{
hello();
}
HELLO.ASM
---------
_text segment public
org 100h
assume cs:_text,ds:_text
start:
call _hello
mov ax,4c00h
int 21h
msg: db 13,10,"Hello world.",13,10,"$"
public _hello
_hello proc
mov ah,9
mov dx,offset msg
int 21h
ret
_hello endp
_text ends
end start
The question is, how to I hack up HELLO.ASM so that I can link it with
TLINK? Does my "hello" need to be prefixed in my "extern" statement?
I tried it both ways. Any insight on the matter would be most appreciated.
Thanks,
Thomas Dwyer III TOMIII @ MTUS5.BITNET
Network Programmer DWYERIII @ MTUS5.BITNET
Computing Technology Services
Michigan Technological University
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads