plotting a pixel in VGA
plotting a pixel in VGA
I have 2 questions:
1) How do you change graphics modes in Pmode?
2) How do you plot a pixel?
Help me please!
thx
1) How do you change graphics modes in Pmode?
2) How do you plot a pixel?
Help me please!
thx
Re:plotting a pixel in VGA
1. Use V86mode. Check here for more info: http://www.mega-tokyo.com/osfaq/How%20d ... %20mode%3F
2. Check out this tutorial: http://www.brackeen.com/home/vga/
covers everything from basic pixel plotting to primatives such as rectangles
2. Check out this tutorial: http://www.brackeen.com/home/vga/
covers everything from basic pixel plotting to primatives such as rectangles
Re:plotting a pixel in VGA
so, here is what i have:
asm ("mov ah, 0\n\t"
"mov al, 13\n\t"
"int 10\n");
the problem is that the compiler outputs this:
/tmp/ccKWd5AP.s:124: Error: too many memory references for `mov'
/tmp/ccKWd5AP.s:125: Error: too many memory references for `mov'
/tmp/ccKWd5AP.s:126: Error: suffix or operands invalid for `int'
whats the problem?
asm ("mov ah, 0\n\t"
"mov al, 13\n\t"
"int 10\n");
the problem is that the compiler outputs this:
/tmp/ccKWd5AP.s:124: Error: too many memory references for `mov'
/tmp/ccKWd5AP.s:125: Error: too many memory references for `mov'
/tmp/ccKWd5AP.s:126: Error: suffix or operands invalid for `int'
whats the problem?
Re:plotting a pixel in VGA
You need to use AT&T syntax if you are using GCC since it is then compiled by GAS
asm ("mov $0, %ah\n\t"
"mov $13, %al\n\t"
"int $10\n");
asm ("mov $0, %ah\n\t"
"mov $13, %al\n\t"
"int $10\n");
Re:plotting a pixel in VGA
This used to be the case some time ago, but Intel Syntax is supported by GAS these days.fox wrote: You need to use AT&T syntax if you are using GCC since it is then compiled by GAS
Take a look at this define statement...
Code: Select all
#define x86(s) asm(".intel_syntax"); asm(s);asm(".att_syntax");
As for the "Bad TSS Exception", that sounds like the Protected Mode version of Interrupt 10 (0Ah) is firing and not the Real Mode (BIOS) one. It could also be a genuine TSS Exception if the v86 Monitor is bug-prone.
Took a look at THIS v86 Mode Monitor Example and compare it to how you are doing things.
Re:plotting a pixel in VGA
I guess you learn something new each dayThis will allow you to embed your Intel-based inline ASM syntax in blocks of "x86()" (or whatever else you wish to call it) while maintaining "asm()" for the AT&T stuff
If I would have known that I wouldn't have been sticking to the ugly AT&T syntax all this time. Thanks for the heads up.
Re:plotting a pixel in VGA
ok, so using the defined x86, do you do:
x86("mov ah,0\n\t"
"mov al,13\n\t"
"int 0x10\n");
?
or something?
the compiler says
/tmp/ccIkcdQK.s:125: Error: ambiguous operand size for `mov'
/tmp/ccIkcdQK.s:126: Error: ambiguous operand size for `mov'
x86("mov ah,0\n\t"
"mov al,13\n\t"
"int 0x10\n");
?
or something?
the compiler says
/tmp/ccIkcdQK.s:125: Error: ambiguous operand size for `mov'
/tmp/ccIkcdQK.s:126: Error: ambiguous operand size for `mov'
Re:plotting a pixel in VGA
AFAIK && IIRC, the GNU Intel syntax isn't the normal intel syntax, it's AT&T syntax with the operands swapped.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:plotting a pixel in VGA
which suggests you should use "movb" rather than just "mov" ... btw, you've noticed that even if you got it compiled fine, it won't work because that's real-mode-only code, right ?Candy wrote: AFAIK && IIRC, the GNU Intel syntax isn't the normal intel syntax, it's AT&T syntax with the operands swapped.