Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
PUBLIC PitIrq
EXTERNDEF ticks:NEAR
.586
.MODEL FLAT, C
.CODE
PitIrq PROC
inc dword ptr[ticks]
pusha
mov al, 20h
movzx dx, al
out dx, al
popa
ret
PitIrq ENDP
END
It's hard to guess without telling us what compiler or options you're using to compile or even the symbol's name (you only tells us where it comes from). Without that information, my guess is that you need to rename your function to _PitIrq inside the assembly file.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
ml /c pic.asm
cl /c test.cpp
link /NODEFAULTLIB /ENTRY:test /SUBSYSTEM:NATIVE /OUT:test.sys test.obj pic.obj
The language model directive in the masm file ("C" in this case) should set the naming convention for the assembler symbols to underscore. This matches the naming convention for extern "C" and can be verified with dumpbin:
PUBLIC PitIrq
.586
.MODEL FLAT, C
EXTERNDEF ticks:NEAR
.CODE
PitIrq PROC
inc dword ptr[ticks]
pusha
mov al, 20h
movzx dx, al
out dx, al
popa
ret
PitIrq ENDP
END
May be your asm file does not participate in the build.
Apparently some VS targets (including masm) are disabled by default for new projects and have to be enabled on a per-project basis from Project->Build Customizations. Take a look here.
Damn it...
Do you know guys what was the problem in it?
I named them with same names (pic.asm and pic.cpp)
I renamed pic.asm to pit.asm and now it works. Woohoo!