add ioport address by offset
This commit is contained in:
@ -33,6 +33,13 @@ public:
|
||||
: "a"(val), "Nd"(address));
|
||||
}
|
||||
|
||||
// NOTE: I added this for easier init of COM1 port
|
||||
void outb(unsigned char offset, unsigned char val) const {
|
||||
asm volatile("outb %0, %1"
|
||||
:
|
||||
: "a"(val), "Nd"(address + offset));
|
||||
}
|
||||
|
||||
// Wortweise Ausgabe eines Wertes ueber einen I/O-Port.
|
||||
void outw(unsigned short val) const {
|
||||
asm volatile("outw %0, %1"
|
||||
@ -57,6 +64,16 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
// NOTE: I added this for COM1 port
|
||||
unsigned char inb(unsigned char offset) const {
|
||||
unsigned char ret;
|
||||
|
||||
asm volatile("inb %1, %0"
|
||||
: "=a"(ret)
|
||||
: "Nd"(address + offset));
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Wortweises Einlesen eines Wertes ueber einen I/O-Port.
|
||||
unsigned short inw() const {
|
||||
unsigned short ret;
|
||||
|
||||
Reference in New Issue
Block a user