#include "ataio.h"


char inportb(unsigned int port){
	// read a byte from a port
	unsigned char ret;
	asm volatile ("in al,dx":"=a"(ret):"d"(port));
	return ret;
}

void outportb(unsigned int port,unsigned char value) {
	// write a byte to a port
	asm volatile ("out dx, al": :"d"(port),"a"(value));
}

WORD inportw(unsigned int port){
	// read a byte from a port
	WORD ret;
	asm volatile ("in ax,dx":"=a"(ret):"d"(port));
	return ret;
}
void outportw(unsigned int port,WORD value) {
	// write a byte to a port
	asm volatile ("out dx, ax": :"d"(port),"a"(value));
}
void enable(){
	asm volatile("sti");
}
void disable(){
	asm volatile("cli");
}
void setvect(int no, inthdlr_t func){
	asm volatile("int 0x03");//not implemented
}
inthdlr_t getvect(int no){
	asm volatile("int 0x03");//not implemented
}

