X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sat, 11 Dec 2004 10:24:40 -0500 Message-Id: <200412111524.iBBFOeqJ032761@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (message from Carlo on Sat, 11 Dec 2004 10:34:47 GMT) Subject: Re: why inportb and outportb are so time expensive ? References: Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > I have an application with a lot of inportb and outportb, most of the > time is spent to do these function calls. Two things come to mind: 1. inportb and outportb are intended to be inlined. Are you including the right header, and compiling with optimization, and have you verified that the instructions are inlined into a single opcode? You can check this with gdb (x/i) or objdump -d. 2. What peripherals are you talking to? I/O requests to slow peripherals will require a delay in the I/O itself, which can add a significant delay to those opcodes.