Re: To Beth
From: Alex (alex_at_alex.com)
Date: 03/17/05
- Next message: Jim Carlock: "Some interesting things about XML..."
- Previous message: \\\\o//annabee: "Re: War"
- In reply to: \\\\o//annabee: "Re: To Beth"
- Next in thread: \\\\o//annabee: "Re: To Beth"
- Reply: \\\\o//annabee: "Re: To Beth"
- Reply: \\\\o//annabee: "Re: To Beth"
- Reply: Ro : "Re: To Beth"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Mar 2005 13:16:40 +1100
"\\o//annabee" <http://TheWannabee.org> wrote in message
news:opsnrdmskw1ounrv@news.braodpark.no...
> På Thu, 17 Mar 2005 11:50:15 +1100, skrev Alex <alex@alex.com>:
>
>> Its making life much easier, admittedly 100% of my bootcode and second
>> stage loader are entirely in assembly language. I chose to use C mainly
>> in the
>> kernel as development times are 1/20th of that it would take to write the
>> kernel
>> entire in assembly.
>
> I see what you mean, but I disagree. Because I think theres a payment
> upfront with asm, and that this payment slowly becomes a huge tax return
> in the long run. Allready, I write asm, in many many cases, when using the
> known, much-used memonics, just as effective as I wrote pascal, earlier.
> More effective.
>
I would agree that well written assembly code will almost always perform
better than any code generated by a HLL. With CPU's being as quick as they
are these days, the number of excuses for programmers to become lazy,
increase.
I disagree that development time is faster writing in assembler, and
debugging of
asm code is more time consuming.
eg: this routine took me not much more than a couple of mins
to write:
dword fs_type()
{
if(bpb.bpb_fatsize16)
{
fatsz=bpb.bpb_fatsize16;
}
else
{
fatsz=bpb.bpb_fatsize32;
}
if(bpb.bpb_totsec16)
{
totsec=bpb.bpb_totsec16;
}
else
{
totsec=bpb.bpb_totsec32;
}
datasec=totsec-(bpb.bpb_reservedsec_cnt+(bpb.bpb_numfats*fatsz)+rootdirsectors);
countofclusters=datasec/bpb.bpb_secpercluster;
firstdatasector=(bpb.bpb_reservedsec_cnt+(bpb.bpb_numfats*fatsz)+rootdirsectors);
if(countofclusters<4085)
{
return(FAT12);
}
else
{
if(countofclusters<65525)
{
return(FAT16);
}
else
{
return(FAT32);
}
}
}
Imagine the time taken to write the equivilent in asm? In the time
that it would have most _average_ asm coders to write the
equivilent, I could have written another dozen C functions.
Thats why I disagree development timeframes are quicker in asm.
> I thought for instance it was a real hell to start with the FPU memonics ?
> But after some time, the order of the memonics for "optimal" performance,
> in both writingtime and execution time comes, by itself. I am surpriced
> how easy the brain understands whats going on, with assembly, after just
> some small practice. And I find no diffrence in calling a C function, over
> a asm function, except the latter is usually much faster running.
>
This is true of well written asm code. Its also possible for asm code
to be slower than the C equivilent if the asm code is poorly written.
>
> Also, something I just must say, is that the myth that assembly is hard to
> read, vanishes if you have a good macro language available. I have never
> found any reason to comment a single proc, in 1000kb of assembly code. I
> find it now more easy to just read the code, than to look at the comments,
> and so I stopped commenting a long time ago.
>
Not commenting code in my opinion is the worst habit ever. I always comment
code. That way, if i pull some code off the shelf 2 years later, the
comments are
there to help refresh my memory straight away, also, if another programmer
has to work on your project and you havent commented anything, I am sure
he/she would feel like murdering you :P
>> PS: How did you know I was working on an OS? :P
>
> I am psychic ??? :D
>
> --
lol :P
I am certainly not bagging out asm as I believe it to be an extremely
powerful
and efficient language. My arguement in this case is purely based on
development
timeframes.
- Next message: Jim Carlock: "Some interesting things about XML..."
- Previous message: \\\\o//annabee: "Re: War"
- In reply to: \\\\o//annabee: "Re: To Beth"
- Next in thread: \\\\o//annabee: "Re: To Beth"
- Reply: \\\\o//annabee: "Re: To Beth"
- Reply: \\\\o//annabee: "Re: To Beth"
- Reply: Ro : "Re: To Beth"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|