Page 1 of 2

C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 6:57 am
by Perica
..

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 7:32 am
by jrfritz
Do you know how long and hard it'd be to program a whole kernel in asm?

That's why they made UNIX in C!

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 7:35 am
by jrfritz
A full printf in ASM would be about 12 pages most likly!

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 7:45 am
by pskyboy
Your mad doing it in assembler, it will be much harder to do, take much longer and im betting you will get lost at points just because of the amoint of code you will have. Also i don't see why you think C/C++ is messy, in most cases it will be faster then ASM as unless your are a ASM Guru which you obviously arn't at the moment as you only know a little ASM. This is also debatable with a lot of people saying that modern c/c++ compilers do as good or even better job then an ASM guru, but that is debatable.

The one thing that is true is that a C compiler will probably produce better code then you until you learn alot more asm.

Peter

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 8:53 am
by VitalDragon
I use to like C/C++ until I started learning ASM ;) . Its much easier to do some stuff in ASM, I use ASM for everything now Win32, Console, DOS Programs. Its just recently that I found out about OS Programming (6 days ago). I'm going to write my whole OS in Assembler because it creates smaller files , and you see exactly what machine instructions you gave to the computer. However I'm not using NASM, NASM bloats files up, I'm using FASM.

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 9:36 am
by hanoi
They made UNIX in C to keep compatibility
if you want to write a kernel in asm, you should look for
Primula in http://Robert.zizi.org

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 10:22 am
by jrfritz
Shouldn't this be better in the General Fourm?

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 12:41 pm
by Mr_Spam
i'd imagen that writing the whole thing in asm would take longer and be much more mental straining. after writing this bootloader, ive also really started to like asm. i'm also desiding to write the kernel in C or asm. it is also possiable to combine the 2....... write some parts in C, other parts in asm.....that probbily what i'll end up doing.

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 4:04 pm
by Madmonky1
I've decided to use assembly to. I don't care how easy c++ is, It's just never worked for me. Ive gotten text functions to work, but I tried graphics in djgpp for a while and it just didn't work. C++ is good for games, but I think in the long run asm will work best for my kernel. There seems to be fewer used assemblers for tutorials than C/C++ which is WAY less confusing to learn to do stuff with.
EDIT: Of course I am an OS n00b so if someone could help with djgpp It'd be greatly appreciated, and if I could do some in assembly and some in C/C++

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 6:53 pm
by Perica
..

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 7:09 pm
by jrfritz
Well then...if ASCII are numbers...and when you push 'a' how does the asm printf know that the 'a' is a number or letter? Since they can interchange...

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 7:15 pm
by Perica
..

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 7:30 pm
by Pype.Clicker
asm kernel, hu ? i had such f00l1sh 1d34 when i was about 18 ... then i learned C (i mean i *really* learned how to use it, not just the syntax of the for statement :), and i realized that once your reach a certain amount of complexity (such as AVL or Btrees, memory allocation algorithms, etc.) things simply cannot be done in ASM anymore ...
Just because the code become too huge, you lose the track of what you"re doing ... you find yourself unable to correct a bug without introducing 3 new bugz ...

nah, believe someone who tried. 90% of the ASM code you write will be rewritten in higher-level language soon or late ...

Re:C/C++ vs Assembler?

Posted: Fri Dec 27, 2002 8:43 pm
by Perica
..

Re:C/C++ vs Assembler?

Posted: Sat Dec 28, 2002 1:28 pm
by VitalDragon
C/C++ is way too confusing when it comes to making an OS. Assembler is much easier to use for OS Developing. If you want to make an OS you'll have to learn Assembler anyway, plus anyone can make an OS in C/C++ but only a few can make an OS in pure assembler...


BTW Unix sucks.