Friday, October 10, 2008

question # 4

Assembly language is much harder to program than high level languages. The programmer must pay attention to far more detail and must have an intimate knowledge of the processor in use. But high quality hand crafted assembly language programs can run much faster and use much less memory and other resources than a similar program written in a high level language. Speed increases of two to 20 times faster are fairly common, and increases of hundreds of times faster are occassionally possible. Assembly language programming also gives direct access to key machine features essential for implementing certain kinds of low level routines, such as an operating system kernel or microkernel, device drivers, and machine control.
High level programming languages are much easier for less skilled programmers to work in and for semi-technical managers to supervise. And high level languages allow faster development times than work in assembly language, even with highly skilled programmers. Development time increases of 10 to 100 times faster are fairly common. Programs written in high level languages (especially object oriented programming languages) are much easier and less expensive to maintain than similar programs written in assembly language (and for a successful software project, the vast majority of the work and expense is in maintenance, not initial development).

question # 5

Most recent assembler

The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs. NASM is considered to be one of the most popular assemblers for Linux and is the second most popular assembler overall. NASM was originally written by Simon Tatham with assistance from Julian Hall, and is currently maintained by a small team led by H. Peter Anvin. It is available as free software under the terms of the GNU Lesser General Public License.



Netwide Assembler
Design by Simon Tatham, Julian Hall

Developed by H. Peter Anvin, et al.

Latest release 2.04 / 2008-09-25; 13 days ago

OS Microsoft Windows, UNIX-like, OS/2, Mac OS, DOS

Platform x86, x86-64

Available in English

License GNU Lesser General Public License

Website
http://nasm.sourceforge.net/

last question


#include
#define p printf
#define s scanf
#define g gotoxy
float num,ans;
char opp;
int y,z,d,a[3];
void designed(int x,int as,int x1),des();
main(){
a:ans=0;
des();
g(38,5);s("%f",&ans);
while(opp!='r')
{
b:
des();
if(ans>1000000){g(2,10);
p(" The system could not");
g(2,11);
p(" proceed because the");
g(2,12);
p(" Answer was already");
g(2,13);
p(" greater than to");
g(2,14);
p(" 1000000.");
g(2,15);
p(" Press any key !");
getch();
exit(0);
}
c:g(38,4);
s("%s",&opp);
if(opp=='='){
goto b;
}else if(opp=='r'){opp='';
goto a;
}
des();
num=0;
g(38,5);
s("%f",&num);
if(opp=='+'){ans=ans+num;
}
else if(opp=='-'){ans=ans-num;
}else if(opp=='x'){ans=ans*num;
}
else if(opp=='/'){ans=ans/num
;
}else{des();
g(2,10);
p(" The system could not");
g(2,11);
p(" compute because you ");
g(2,12);
p(" entered a wrong ");
g(2,13);
p(" operator.");
goto c;
}
}getche();
}
void des(){clrscr();
a[0]=2;a[1]=9;a[2]=16;
designed(1,25,25);
a[1]=6;
designed(37,19,55);
z=14;
g(39,z);
for(y=0;y<=9;y++)
{
p(" %i ",y);
if(d==0){delay(1000000);
}
if(y==0 y==3 y==6){z=z-2;
g(39,z);}
}g(44,14);
p(". =");
g(52,8);p("/");
g(52,10);p("x");
g(52,12);p("-");
g(52,14);p("+");
g(9,1);
p("Operator");
g(41,1);
p("Calculator");
g(3,3);
p("Addition = +");
g(3,4);
p("Subtraction = -");
g(3,5);
p("Division = /");
g(3,6);
p("Multiplication = x");
g(3,7);
p("Equals = =");
g(3,8);
p("Reset = r");
g(28,3);
p("Answer");
g(27,4);
p("Operator");
g(28,5);
p("Number");
d=1;
g(38,3);
p("%f",ans);
g(38,4);
p("%c",opp);
}
void designed(int x,int as,int x1)
{for(y=2;y<=16;y++)
{if(y==a[0] y==a[1] y==a[2])
{g(x,y);
for(z=0;z
{p("*");
if(d==0)
{delay(1000000);
}
}
}
else{g(x,y);
p("*");
if(d==0){delay(1000000);
}
g(x1,y);
p("*");}
}
}