TASM¾øÀ̵µ C++Builder¿¡¼ inpb ¿Í outp¸¦ ¾²´Â ¹æ¹ý
"__emit__"ÇÔ¼ö¸¦ ÀÌ¿ëÇϸé Input/Output ÇÔ¼ö¸¦ Á¦¾îÇÒ ¼ö ÀÖ´Ù. ¾Æ·¡ÀÇ ÇÔ¼öµéÀº
inport, inportb, outportb, outport ÇÔ¼ö¸¦ ±¸ÇöÇÑ °ÍÀÌ´Ù. ÄÜ¼Ö ¾ÖÇø®ÄÉÀ̼ǰú
À©µµ¿ì ÇÁ·Î±×·¥¿¡¼ Àß ÀÛµ¿ÇÑ´Ù. ´ÜÁö NT¿¡¼´Â °ËÁõµÇÁö ¾Ê¾ÒÀ¸´Ï µÇµµ·ÏÀ̸é
windows95¿¡¼ »ç¿ëÇÏ´Â °ÍÀÌ ÁÁ´Ù.
win95¿¡¼ I/O
#include <dos.h>
void outportb(unsigned short int port, unsigned char value)
{
// mov edx, *(&port);
__emit__(0x8b, 0x95, &port);
// mov al, *(&value);
__emit__(0x8a, 0x85, &value);
// out dx, al;
__emit__(0x66, 0xee);
}
void outportw(unsigned short int port, unsigned short int value)
{
// mov edx,*(&port);
__emit__(0x8b, 0x95, &port);
// mov ax, *(&value);
__emit__(0x66, 0x8b, 0x85, &value);
// out dx, ax;
__emit__(0xef); }
unsigned char inportb(unsigned short int port)
{
unsigned char value;
// mov edx, *(&port);
__emit__(0x8b, 0x95, &port);
// in al, dx;
__emit__(0x66, 0xec);
// mov *(&value), al;
__emit__(0x88, 0x85, &value);
return value;
}
unsigned short int inportw(unsigned short int port)
{
unsigned short int value;
// mov edx, *(&port);
__emit__(0x8b, 0x95, &port);
// in ax, dx;
__emit__(0xed);
// mov *(&value), ax;
__emit__(0x66, 0x89, 0x85, &value);
return value;
}
 |