the inb and outb asm functions are not defined in the intel instruction set
reference yet I see them used everywhere. Are they a part of gcc? Are they
based on the IN and OUT instructions?
Thanks,
Aaron
IN and OUT instructions have three forms, a BYTE form, a WORD form, and a
DWORD form (on 32bit CPUs only). So inb and outb are the byte form, inw and
outw are the word form, and ind and outd are the dword form. The difference
between them is, that the byte form outputs a single byte to the port, and
the word form outputs the low-byte to the port and the hgih-byte to port+1,
and so on. So to summarise:
outb 60h, al = outputs al to port 60h.
outw 60h, ax = outputs al to port 60h, and ah to port 61h.
outd 60h, eax = outputs al to port 60h, ah to port 61h, next 8bits to port
62h, and the last 8 bits to port 63h
Now, some assemblers know which size to use, but you can use an override
(which is what you are seeing), forcing the assembler to generate the
correct operand size, (either byte, word or dword form).
Chewy509...
PS. For more info read chap 9, vol 1, and chap2, vol 2 of the intel pentium
manuals. To generate input/output to a single 8bit port, then use the
ins/outs instructions.
"Chewy509" <Chew...@austarnet.com.au> wrote in message
news:9r8lkm$s7obr$2...@ID-98691.news.dfncis.de...
The functions you are referring to are:
inb = in byte (1 byte)
inw = in word (2 bytes
ind = in dword(4 bytes)
outb = out byte (1 byte)
outw = out word (2 bytes)
outd = out dword (4 bytes)
These are usaly functions that wrap the instructions "in" and "out". Have a
look in the Intel Architecture Manual: Instruction Set Reference.
"Aaron Coombs" <a.co...@home.com> wrote in message
news:neOB7.118170$ob.26...@news1.rdc1.bc.home.com...
"Aaron Coombs" <a.co...@home.com> wrote in message
news:neOB7.118170$ob.26...@news1.rdc1.bc.home.com...