Re: A89: Which is better?


[Prev][Next][Index][Thread]

Re: A89: Which is better?




The fact that assembly must be written in a specific way (column 1 is reserved
for labels, 2 and beyond for mnemonics, one space between the mnemonic and the
operand, comma betweeen multiple operands, and no more than one instruction per
line) makes it much easier to read than C programs which have been purposfully
obfuscated:

#define p struct c #define q struct b #define h a->a #define i a->b #define e
i->c #define o a=(*b->a)(b->b,b->c) #define s return a;}q* #define n
(d,b)p*b;{q*a;p*c; #define z(t)(t*)malloc(sizeof(t)) q{int a;p{q*(*a)();int
b;p*c;}*b;};q*u n a=z(q);h=d;i=z(p);i->a=u;i->b=d+1;s v n c=b;do
o,b=i;while(!(h%d));i=c;i->a=v;i->b=d;e=b;s w n
o;c=i;i=b;i->a=w;e=z(p);e->a=v;e->b=h;e->c=c;s t n
for(;;)o,main(-h),b=i;}main(b){p*a;if(b>0)a=z(p),h=w,a->c=z(p),a->c->a=u,
a->c->b=2,t(0,a);putchar(b?main(b/2),-b%2+'0':10);} 

Even under assembly there are a very limited way of saying things.  In C, you
could say printf("Hello, world") in a few million different ways.

But if you don't have a good grasp of either language, then you'll certianly
have a problem in the one you don't fully understand.

-Adam

Brady Simon wrote:
> 
> I don't mean to bash on you or anything but do you honestly think it is
> harder to read C than it is to read assembly? Looking back at my assembly
> code I think it is a lot easier to read C.
> 
> -----Original Message-----
> From: owner-assembly-89@lists.ticalc.org
> [mailto:owner-assembly-89@lists.ticalc.org]On Behalf Of Zeljko Juric
> Sent: Tuesday, May 30, 2000 11:34 AM
> To: assembly-89@lists.ticalc.org
> Subject: Re: A89: Which is better?
> 
> Hi!
> 
> > i cant ever imagine finding assembly easier then C... (in most respects)
> C
> > seems alot like basic to me. and its especially easy after learning
> > cgi/perl. they seem almost the same...
> 
> Generally, C is easier than ASM, but C programs may be much more cryptic
> than ASM programs, e.g. C programs sometimes may be absolutely
> ununderstandable. It is not hard to write such programs, but it is
> very hard to read and understand them. That's why C is sometimes
> called "write-only language".
> 
> Zeljko Juric



Follow-Ups: References: