Hi!
I've got this (C) code to change to 320x200 graphics mode form pmode (attached). The problem is that it uses two ASM commands that I have not yet implemented: outpw and outp.
I have code for outb from the osfaq, and if I changed the outb to outw or outpw, would that work?
Thanks,
Stephen
Pmode VGA switch help
Re:Pmode VGA switch help
Outpw afaik writes a word to the given port
outp afaik writes a byte to the given port
Same with in*
outp afaik writes a byte to the given port
Same with in*
Re:Pmode VGA switch help
I have this code:
If I change it to
will that work?
Also, will it work with outpw?
Thanks,
Stephen
Code: Select all
static __inline__ void outb(unsigned short port, unsigned char val)
{
asm volatile("outb %0,%1"::"a"(val), "Nd" (port));
}
Code: Select all
static __inline__ void outp(unsigned short port, unsigned char val)
{
asm volatile("outp %0,%1"::"a"(val), "Nd" (port));
}
Also, will it work with outpw?
Thanks,
Stephen
Re:Pmode VGA switch help
From my experience, an out with a "p" indicates that a pause is present after the IO operation.
So you get the straight ones: outb, outw
And the ones with pauses: outpb, outpw
So you get the straight ones: outb, outw
And the ones with pauses: outpb, outpw
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Pmode VGA switch help
the 'pause' thing is something that is introduced by programmers. There's no such thing like "outp*" in the instruction set...
Re:Pmode VGA switch help
So how would you implement them? Do you have any code samples?
Stephen
Stephen
Re:Pmode VGA switch help
Hi,
But some people read from a dummy IO port instead..
To be honest, I wouldn't actually implement them at all - they aren't needed on 80486 or above computers....
Cheers,
Brendan
I'd implement them with something like this:Stephen wrote:So how would you implement them? Do you have any code samples?
Code: Select all
out dx,al
jmp .l1
.l1:
jmp .l2
.l2:
To be honest, I wouldn't actually implement them at all - they aren't needed on 80486 or above computers....
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.