Page 2 of 2
Re:Compile your own OS with Visual Studio
Posted: Sun Aug 10, 2003 3:59 am
by Therx
If all you want is good colour coding look no further than ConTEXT:-
http://fixedsys.com/context/
This is what I use and it's completely free. It highlights most languages and you can edit the highlighters to your preference. Other useful features are:-
- You can export the colour coded code to a HTML doc.
- You can specify functions keys so that it will automatically save, then compile your OS on F9 for example. It also helps because you can look through the whole compile without the first warnings/errors scrolling off the top of the screen.
Pete
Re:Compile your own OS with Visual Studio
Posted: Sun Aug 10, 2003 7:54 am
by Robert Lee
Well personally I prefer IDEAL mode syntax (TASM). Is there any way to get GCC to accept that?
-Robert
Re:Compile your own OS with Visual Studio
Posted: Mon Aug 11, 2003 2:48 am
by mystran
@solar: Emacs no good.. but fortunately Vim is ported to Windows too..
Re:Compile your own OS with Visual Studio
Posted: Mon Aug 11, 2003 9:24 am
by nullify
I'm not too concerned about GCC's use of AT&T syntax over Intel syntax... rather, it seems more unproductive that inline assembly code must be within strings.
For example,
Code: Select all
asm
(
"func: \n"
" mov %eax, %ebx \n"
" mov %eax, %ebx \n"
" mov %eax, %ebx \n"
" mov %eax, %ebx \n"
);
This makes inline assembly a bit more difficult to write and edit, and its a bit distracting.
Code: Select all
asm
{
func:
mov %eax, %ebx
mov %eax, %ebx
mov %eax, %ebx
mov %eax, %ebx
};
IMHO if it could be formatted this way, it would render the code a bit easier to read and maintain.
Just a thought.
Re:Compile your own OS with Visual Studio
Posted: Mon Aug 11, 2003 12:32 pm
by Pype.Clicker
err ... imho, the inline asm isn't meant to be "productive" ... it's just there to provide a clean way to create macros that will give the programmer access to resource that aren't available through "normal" instruction set (the one the compiler knows and uses), like in, out, ltr, pginvl, etc.
Re:Compile your own OS with Visual Studio
Posted: Mon Aug 11, 2003 1:58 pm
by nullify
Hmm, well you'd think that since C was designed to code UNIX, they would make inline assembly somewhat more convenient. For some reason C seems to be getting this whole "for system programming only" reputation these days...
I'd argue that increasing productivity wouldn't be a bad thing, and besides - people wouldn't be complaining about AT&T syntax if they were just as productive with it
Re:Compile your own OS with Visual Studio
Posted: Tue Aug 12, 2003 6:42 am
by Silverhawk
Hello, I'm back !
I've tried the following syntax in GCC :
asm(".intel_syntax");
asm("mov ax,0x10");
asm("mov cs,ax");
But I've an error when I try to compile :
c:/djgpp/tmp/ccTpLn5j.s: Assembler messages: c:/djgpp/tmp/ccTpLn5j.s:66: Error: no such instruction: `subl $8,%esp' c:/djgpp/tmp/ccTpLn5j.s:67: Error: no such instruction: `pushl $10' c:/djgpp/tmp/ccTpLn5j.s:68: Error: no such instruction: `pushl $1280' c:/djgpp/tmp/ccTpLn5j.s:70: Error: no such instruction: `addl $16,%esp' c:/djgpp/tmp/ccTpLn5j.s:71: Error: no such instruction: `pushl $LC3' c:/djgpp/tmp/ccTpLn5j.s:72: Error: no such instruction: `pushl $9' c:/djgpp/tmp/ccTpLn5j.s:73: Error: no such instruction: `pushl $24' c:/djgpp/tmp/ccTpLn5j.s:74: Error: no such instruction: `pushl $0' c:/djgpp/tmp/ccTpLn5j.s:76: Error: no such instruction: `addl $16,%esp'
it is DJGPP...
Is it necessary to have a specific version to use
asm(".intel_syntax"); ?
Thanks.
Re:Compile your own OS with Visual Studio
Posted: Tue Aug 12, 2003 6:59 am
by nullify
Silverhawk wrote:Hello, I'm back !
I've tried the following syntax in GCC :
asm(".intel_syntax");
asm("mov ax,0x10");
asm("mov cs,ax");
But I've an error when I try to compile :
c:/djgpp/tmp/ccTpLn5j.s: Assembler messages: c:/djgpp/tmp/ccTpLn5j.s:66: Error: no such instruction: `subl $8,%esp' c:/djgpp/tmp/ccTpLn5j.s:67: Error: no such instruction: `pushl $10'
..........
You forgot to switch back to AT&T syntax after you were done writing your Intel syntax code:
asm(".att_syntax");
Re:Compile your own OS with Visual Studio
Posted: Tue Aug 12, 2003 7:18 am
by Silverhawk
Thanks to nullify...
It works...
I didn't know it was necessary to come back to the AT&T syntax...