New to os dev

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
rexlunae
Member
Member
Posts: 134
Joined: Sun Oct 24, 2004 11:00 pm
Location: North Dakota, where the buffalo roam

Re: New to os dev

Post 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.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: New to os dev

Post 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
Last edited by earlz on Sat Nov 05, 2005 12:00 am, edited 1 time in total.
python
Posts: 7
Joined: Thu Oct 27, 2005 11:00 pm
Location: The great state of confusion

Re: New to os dev

Post 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...
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: New to os dev

Post 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
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: New to os dev

Post 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
Zaibot
Posts: 4
Joined: Thu Jan 05, 2006 12:00 am
Location: The Netherlands
Contact:

Re: New to os dev

Post 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)
Blackbird OS :-) lol, hope it works out before I graduate (including the GUI) :-) (am 17 years old :-)
Post Reply