consider the following code example:
How much time would it take to write this in assembler?
How much space would it take?
It is actually a waste of time to use assembler.
What I hope is more people will stop using it.
What I really don't like about assembler is the urge to try to optimize code downto efforts to save single bytes for instruction encoding!
It's no difference if 20 bytes are wasted here and there!
What I liked about assembler, well, I have it easier to use C...
But I am happy that I found the exit...from using assembler.
By the way, code size somehow has increased from 1300 to 2400 bytes...
Rich (BB code):
while(1)
{
if(prg_status&c_prg_status_500msec)
{
LC7=led_0&0x01;
time_1sec();
lcd_cmd(0b1010,10);
lcd_cmd(0b1000,10);
itoa(&time_buf,hours,10);
l=lcd_str(time_buf);
for(i=0;i<(2-l);i++)lcd_char(" ");
lcd_char(":");
itoa(&time_buf,minutes,10);
l=lcd_str(time_buf);
for(i=0;i<(2-l);i++)lcd_char(" ");
lcd_char(":");
itoa(&time_buf,seconds,10);
l=lcd_str(time_buf);
for(i=0;i<(2-l);i++)lcd_char(" ");
prg_status&=(0xff-c_prg_status_500msec);
}
}
How much space would it take?
It is actually a waste of time to use assembler.
What I hope is more people will stop using it.
What I really don't like about assembler is the urge to try to optimize code downto efforts to save single bytes for instruction encoding!
It's no difference if 20 bytes are wasted here and there!
What I liked about assembler, well, I have it easier to use C...
But I am happy that I found the exit...from using assembler.
By the way, code size somehow has increased from 1300 to 2400 bytes...