I am soon going to resume my study of IR using Parallel port etc..
So I decided to learn how to write data to the DATA bits 0-7. It works through the DOS debug, but not Assembly.
Here is my code:
Code:
#include <dos.h>
void outportw(unsigned short port, unsigned short val);
int main()
{
outportw(278, 10);
return 0;
}
void outportw(unsigned short port, unsigned short val)
{
__asm mov dx, port
__asm mov ax, val
__asm out dx, ax
}
So I debugged the error and this is the code that VS60 turns the ASM into:
Code:
void outportw(unsigned short port, unsigned short val)
{
00401050 push ebp
00401051 mov ebp,esp
00401053 sub esp,40h
00401056 push ebx
00401057 push esi
00401058 push edi
00401059 lea edi,[ebp-40h]
0040105C mov ecx,10h
00401061 mov eax,0CCCCCCCCh
00401066 rep stos dword ptr [edi]
__asm mov dx, port
00401068 mov dx,word ptr [port]
__asm mov ax, val
0040106C mov ax,word ptr [val]
__asm out dx, ax
00401070 out dx,ax
}
I have tried this through MASM as well, and the same thing happens. I would appreciate any insight.