Saturday, October 11, 2008

QUESTION #6

Question:
Age Calculator: It will compute the age and prints how many months, weeks, days, hours and minutes old you are now.

Answer:
#include

/* Programmed by Harvey Losin *//* http://www.bikoy.com/harvey *//*
webmaster@bikoy.com */
main()
{ float years;
clrscr();
printf("Enter your age in years: ");scanf("%f",&years);
printf ("\nYou are %.0f months old", years * 12);
printf ("\nYou are %.0f weeks old", years * 48);
printf ("\nYou are %.0f days old", years * 365);
printf ("\nYou are %.0f hours old", years * 8760);
printf ("\nYou are %.0f minutes old", years * 525600);
getch();
}

Tuesday, October 7, 2008

QUESTION #5

Question: Research in the net the most recent assembler. Describe its history, nature and applications. Evaluate this assembler from its predecessor.
Answer:
HISTORY
Assembly languages are close to a one to one correspondence between symbolic instructions and executable machine codes. Assembly languages also include directives to the assembler, directives to the linker, directives for organizing data space, and macros. Macros can be used to combine several assembly language instructions into a high level language-like construct (as well as other purposes). There are cases where a symbolic instruction is translated into more than one machine instruction. But in general, symbolic assembly language instructions correspond to individual executable machine instructions.

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.

NATURE
Nature procedural language with one to one correspondence between language mnemonics and executable machine instructions.
Assembler languages occupy a unique place in the computing world. Since most assembler-language statements are symbolic of individual machine-language instructions, the assembler-language programmer has the full power of the computer at his disposal in a way that users of other languages do not. Because of the direct relationship between assembler language and machine language, assembler language is used when high efficiency of programs is needed, and especially in areas of application that are so new and amorphous that existing program-oriented languages are ill-suited for describing the procedures to be followed.

There are a number of situations in which it is very desirable to use assembler language routines to do part of a job, and use some higher-level language for other parts. It makes sense to use higher-level languages such as Fortran, COBOL, or PL/I for parts of procedures for which they are well-suited, and supplement with assembler language routines for those parts of procedures for which the higher-level language is awkward or inefficient.

If one has a choice between assembly language and a high-level language, why choose assembly language? The fact that the amount of programming done in assembly language is quite small compared to the amount done in high-level languages indicates that one generally doesn’t choose assembly language. However, there are situations where it may not be convenient, efficient, or possible to write programs in hihg-level languages. … Programs to control and communicate with peripheral devices (input and output devices) are usually written in assembly language because they use special instructions that are not available in high-level languages, and they must be very efficient. Some systems programs are written in assembly language for similar reasons. In general, since high-level languages are designed without the features of a particular machine in mind and a compiler must do its job in a standardized way to accomodate all valid programs, there are situations where to take advantage of special features of a machine, to program some details that are inaccessible from a high-level language, or perhaps to increase the efficiency of a program, one may reasonably choose to write in assembly language.

Thursday, September 25, 2008

Question #4

Question: Justify what situations or applications programmers will rather use Assembly Languages than Higher Level Progamming Languages and vice versa.
Answer: For me, I will prefer Higher Level Programming Language it has a strong abstraction that defines how "high level" a programming language. It is simplier, easier and more understandable than Assembly Language because it is closely related to the english language.
Reference: Wikipedia

Tuesday, September 23, 2008

Question #3

Question #3: Research in the net what is the best assembler and why.
Answer: For me, the best assembler is the FASM because it source of open intel style as assembler it also known for its fast speed, size optimizations, OS portability and macro capabilities. FASM contains binding to the windows it can directly output in binary or executables in either MZ, ELF and PE format.
It is a low-level assembler and it is not supported by the high level statement instead it provides syntax features and macros which make it possible to customize or create missings statement.
Student name: Zyra Joy Palmes
Reference: Wikipedia

Question#2

Question #2: Research in the net usual applications done in assembly language. Describe these applications briefly and cite the efficiency and effectiveness of these applications.
Answer: Assembly language it is a low-level language for programming, it also defined by a hardware manufacturer to help the programer remember the instructions and register. From now Assembly language is used as a direct hardware manipulation.
Student name: Zyra Joy Palmes
Reference: Wikipedia

Monday, September 15, 2008

Question # 1

Title: Question # 1
Question: What topic(s) in MCS213 do you find easy or difficult and why?
Answer: For me the topic that i found difficult is the topic about programing this is the topic that i hardly to understand especially when my teacher told us to program the conversion of binary numbers.

Wednesday, September 10, 2008