Thursday, October 9, 2008

Final Question

Since not all MCS 213 students can try DEBUG commands because of the technical problems of our computers, search now any Turbo C program with assembly codes in it and run this in your PC. Check the result of your running C program.If the program produces the expected output, copy the Turbo C codes into your post and its result. YOu may do this by pressing Print Screen on your keyboard for the result of your program then, switch to Paint Brush and Paste. Resize the window and copy this to your post.



Answer:
#include
extern int TRIPLE ( int ) ;
void main ( void )

{ int p ; p = TRIPLE ( 20 ) ;
printf ( "%d", p ) ;

}










Due: October 10, 2008.

Question #5

Research in the net the most recent assembler. Describe its history, nature and applications. Evaluate this assembler from its predecessor.


Assemblers
For any given personal computer, mainframe, embedded system, and game console, both past and present, at least one--possibly dozens--of assemblers have been written. For some examples, see the
list of assemblers.
On
Unix systems, the assembler is traditionally called as, although it is not a single body of code, being typically written anew for each port. A number of Unix variants use GAS.
Within processor groups, each assembler has its own dialect. Sometimes, some assemblers can read another assembler's dialect, for example, TASM can read old MASM code, but not the reverse. FASM and NASM have similar syntax, but each support different macros that could make them difficult to translate to each other. The basics are all the same, but the advanced features will differ.
Also, assembly can sometimes be portable across different operating systems on the same type of
CPU. Calling conventions between operating systems often differ slightly to none at all, and with care it is possible to gain some portability in assembly language, usually by linking with a C library that does not change between operating systems. However, it is not possible to link portably with C libraries that require the caller to use preprocessor macros that may change between operating systems.
For example, many things in
libc depend on the preprocessor to do OS-specific, C-specific things to the program before compiling. In fact, some functions and symbols are not even guaranteed to exist outside of the preprocessor. Worse, the size and field order of structs, as well as the size of certain typedefs such as off_t, are entirely unavailable in assembly language, and differ even between versions of Linux, making it impossible to portably call functions in libc other than ones that only take simple integers and pointers as parameters.
Some higher level computer languages, such as
C, support Inline assembly where relatively brief sections of assembly code can be embedded into the high level language code. Borland Pascal also had an assembler compiler, which was initialized with a keyword "asm". It was mainly used to create mouse and COM-port drivers.
Many people use an
emulator to debug assembly-language programs.






Cite your reference.
Due: October 6

Sunday, October 5, 2008

Question # 4

Justify what situations or applications programmers will rather use Assembly Languages than Higher Level Progamming Languages and vice versa.


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.
High level languages are abstract. Typically a single high level instruction is translated into several (sometimes dozens or in rare cases even hundreds) executable machine language instructions. Some early high level languages had a close correspondence between high level instructions and machine language instructions. For example, most of the early COBOL instructions translated into a very obvious and small set of machine instructions. The trend over time has been for high level languages to increease in abstraction. Modern object oriented programming languages are highly abstract (although, interestingly, some key object oriented programming constructs do translate into a very compact set of 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. 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).



www.osdata.com

Cite your reference.
Due: Sept. 25, 2008

Wednesday, September 24, 2008

Question #3

Research in the net what is the best assembler and why.Cite your reference.

FASMA good all around assembler, great for beginners because of its simplicity.

http://flatassembler.net/

Due: September 22, 2008

Monday, September 22, 2008

Question #2

Research in the net usual application done in assembly language. Describe this application briefly and cite the effeciency and effectiveness of this applications.
include your reference.


Answer: Hard-coded assembly language is typically used in a system's
boot ROM (BIOS on IBM-compatible PC systems). This low-level code is used, among other things, to initialize and test the system hardware prior to booting the OS, and is stored in ROM. Once a certain level of hardware initialization has taken place, execution transfers to other code, typically written in higher level languages; but the code running immediately after power is applied is usually written in assembly language. The same is true of most boot loaders.
Many compilers render high-level languages into assembly first before fully compiling, allowing the assembly code to be viewed for
debugging and optimization purposes. Relatively low-level languages, such as C, often provide special syntax to embed assembly language directly in the source code. Programs using such facilities, such as the Linux kernel, can then construct abstractions utilizing different assembly language on each hardware platform. The system's portable code can then utilize these processor-specific components through a uniform interface.
Assembly language is also valuable in
reverse engineering, since many programs are distributed only in machine code form, and machine code is usually easy to translate into assembly language and carefully examine in this form, but very difficult to translate into a higher-level language. Tools such as the Interactive Disassembler make extensive use of disassembly for such a purpose.
A particular niche that makes use of assembly language is the
demoscene. Certain competitions require the contestants to restrict their creations to a very small size (e.g. 256B, 1KB, 4KB or 64 KB), and assembly language is the language of choice to achieve this goal.[9] When resources, particularly CPU-processing constrained systems, like the Amiga and the Commodore 64, are a concern, assembler coding is a must: optimized assembler code is written "by hand" and instructions are sequenced manually by the coders in an attempt to minimize the number of CPU cycles used; the CPU constraints are so great that every CPU cycle counts. However, using such techniques has enabled systems like the Commodore 64 to produce real-time 3D graphics with advanced effects, a feat which would be considered unlikely or even impossible for a system with a 0.99MHz processor.


http://www.wikipedia.com/


Due: Sept. 17, 2008.

Tuesday, September 16, 2008

Question #1

Now that you have your first blog, your first writing assignment is to answer the question below:What topic(s) in MCS 213 do you find easy and/or difficult and why?Follow this format:

Title: My First Blog

Question #:1

Question:________________
Answer: Actually all topics in MCS 213 is difficult for me because it makes me think to much when making a program and sometimes i dont no how to make it.

Student Name: Ramjie P. Brillantes
Due: September 16, 2008

Sunday, September 14, 2008