Page 2 of 2

Re: New to os dev

Posted: Sat Nov 05, 2005 12:00 am
by rexlunae
python wrote:NASM is written in c what kind of self-respecting asm programmer would use an assembler written in C?

PS Ive heard this said in many places...
I wonder how many assembers are written in assembly. It seems like that would be really hard, and I suspect that most of them are written in something else. I could be wrong, but I would almost bet most of them are written in C.

Anyway, that attitude is really stupid. There are very few things that should be written in assembly, but some people think that being able to write loads of completely unportable, unreadable, unstructured code is somehow impressive.

Re: New to os dev

Posted: Sat Nov 05, 2005 12:00 am
by earlz
I think that writing a ton of asm code is impressive but stupid because a lot of times just 2 or 3 lines of C(even not using libc) converts to 7 to 30 lines of asm
example

Code: Select all

//C code
void func(void){}

//asm code
_func:
push ebp
mov ebp.esp ;i think
;code in the function
pop ebp
ret
endproc ;something like this is on a few assemblers
now see which one looks a bit easier to work with and which one looksmore coding effeicent
1 line of C code=5(or sometimes 6) lines of asm code and you have no idea what the function paremeters are in asm so clearly C or osme other higher level(ive heard a lot of people using pascal) language is a must

Re: New to os dev

Posted: Sat Nov 05, 2005 12:00 am
by python
Well your right that not many things should be written in asm. Ive been working on learning it for a while now and it seems to me the only thing that should be written in it would be the bootsector of an os... I believe you are right that learning the most popular one (nasm) is a good idea. I will (try) do that. I really dont see a difference in the nasm/fasm code though...

Re: New to os dev

Posted: Sat Nov 05, 2005 12:00 am
by earlz
i dont see a difference in them either but tasm and masn sure as crap are different

there are a few other things that must be writtin in asm, things like table loaders(lgdt,lidt,ect) and if you want to make interrupt handlers they might require a 'boiler plate' or at least be nice to have one so that you can avoid inline asm to access registers and such

Re: New to os dev

Posted: Mon Nov 07, 2005 12:00 am
by JAAman
there are things which ASM is clearer and easier to read, but thats the exception, not the rule:

as for an assembler? i will be writing one myself, and ill be using C! (MSVC++/VS to be precise)

also: once your OS is more usable, you may want to port you dev tools into it -- this will be FAR easier to do if you use a C based one than one written in ASM

Re: New to os dev

Posted: Thu Jan 05, 2006 12:00 am
by Zaibot
I always useing nasm because tasm, wasm, masm got all sorts of crap for its programming... I like the basics of nasm, just assembly and nothing more like for programmed loops (it handy but it's not my style)