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:
main()
{
i = 0x0004;
_exit(0x0000);
_scanf(0x0194,&l_int_1);
if(i < i =" l_int_1;" l_char_1 =" 0x0004;" l_int_1 =" 0x0004;" k =" 0x0002;"> l_int_1) ? k : l_int_1)
{
case 0 :
if(i < i =" l_int_1;"> l_int_1)
{
if(l_char_1 == 0x0001)
{
_printf(0x01A3);
l_int_1 = 0x0004;
}
}
}
break;
case 22 :
_printf(0x01A7);
break;
case 19 :
_printf(0x01AA);
case -4 :
i = 0x0001;
break;
default :
i = 0x0000;
while(i < i =" i" k =" 0x0001;">
Thursday, October 9, 2008
Tuesday, October 7, 2008
QUESTION # 5
Research in the net the most recent assembler. Describe its history, nature and applications. Evaluate this assembler from its predecessor.
Assembler
Compare with: Microassembler.
Typically a modern assembler creates object code by translating assembly instruction mnemonics into opcodes, and by resolving symbolic names for memory locations and other entities. The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution—e.g., to generate common short sequences of instructions to run inline, instead of in a subroutine.
Assemblers are generally simpler to write than compilers for high-level languages, and have been available since the 1950s. Modern assemblers, especially for RISC based architectures, such as MIPS, Sun SPARC and HP PA-RISC, optimize instruction scheduling to exploit the CPU pipeline efficiently.
More sophisticated high-level assemblers provide language abstractions such as:
Advanced control structures
High-level procedure/function declarations and invocations
High-level abstract data types, including structures/records, unions, classes, and sets
Sophisticated macro processing
Object-Oriented features such as encapsulation, polymorphism, inheritance, interfaces .
Note that, in normal professional usage, the term assembler is often used ambiguously: It is frequently used to refer to an assembly language itself, rather than to the assembler utility. Thus: "CP/CMS was written in S/360 assembler" as opposed to "ASM-H was a widely-used S/370 assembler."
REFERENCE: WIKIPEDIA.ORG
Assembler
Compare with: Microassembler.
Typically a modern assembler creates object code by translating assembly instruction mnemonics into opcodes, and by resolving symbolic names for memory locations and other entities. The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution—e.g., to generate common short sequences of instructions to run inline, instead of in a subroutine.
Assemblers are generally simpler to write than compilers for high-level languages, and have been available since the 1950s. Modern assemblers, especially for RISC based architectures, such as MIPS, Sun SPARC and HP PA-RISC, optimize instruction scheduling to exploit the CPU pipeline efficiently.
More sophisticated high-level assemblers provide language abstractions such as:
Advanced control structures
High-level procedure/function declarations and invocations
High-level abstract data types, including structures/records, unions, classes, and sets
Sophisticated macro processing
Object-Oriented features such as encapsulation, polymorphism, inheritance, interfaces .
Note that, in normal professional usage, the term assembler is often used ambiguously: It is frequently used to refer to an assembly language itself, rather than to the assembler utility. Thus: "CP/CMS was written in S/360 assembler" as opposed to "ASM-H was a widely-used S/370 assembler."
REFERENCE: WIKIPEDIA.ORG
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.
When a stand-alone binary executable is required, i.e. one that must execute without recourse to the run-time components or libraries associated with a high-level language; this is perhaps the most common situation. These are embedded programs that store only a small amount of memory and the device is intended to do single purpose tasks. Such examples consist of telephones, automobile fuel and ignition systems, air-conditioning control systems, security systems, and sensors.
When interacting directly with the hardware, for example in device drivers.
When using processor-specific instructions not exploited by or available to the compiler. A common example is the bitwise rotation instruction at the core of many encryption algorithms.
Embedded systems.
When extreme optimization is required, e.g., in an inner loop in a processor-intensive algorithm. Some game programmers are experts at writing code that takes advantage of the capabilities of hardware features in systems enabling the games to run faster.
When a system with severe resource constraints (e.g., an embedded system) must be hand-coded to maximize the use of limited resources; but this is becoming less common as processor price/performance improves
When no high-level language exists, e.g., on a new or specialized processor
Real-time programs that need precise timing and responses, such as simulations, flight navigation systems, and medical equipment. (For example, in a fly-by-wire system, telemetry must be interpreted and acted upon within strict time constraints. Such systems must eliminate sources of unpredictable delays – such as may be created by interpreted languages, automatic garbage collection, paging operations, or preemptive multitasking. Some higher-level languages incorporate run-time components and operating system interfaces that can introduce such delays. Choosing assembly or lower-level languages for such systems gives the programmer greater visibility and control over processing details.)
When complete control over the environment is required (for example in extremely high security situations, where nothing can be taken for granted).
When writing computer viruses, bootloaders, certain device drivers, or other items very close to the hardware or low-level operating system.
When reverse-engineering existing binaries, which may or may not have originally been written in a high-level language, for example when cracking copy protection of proprietary software.
Reverse engineering and modification of video games (known as ROM Hacking), commonly done to games for Nintendo hardware such as the SNES and NES, is possible with a range of techniques, of which the most widely employed is altering the program code at the assembly language level.
Assembly language is still used for writing games and other software for graphing calculators.
Finally, compiler writers usually write software that generates assembly code, and should therefore be expert assembly language programmers themselves.
REFERENCE:
WIKIPEDIA.ORG
When a stand-alone binary executable is required, i.e. one that must execute without recourse to the run-time components or libraries associated with a high-level language; this is perhaps the most common situation. These are embedded programs that store only a small amount of memory and the device is intended to do single purpose tasks. Such examples consist of telephones, automobile fuel and ignition systems, air-conditioning control systems, security systems, and sensors.
When interacting directly with the hardware, for example in device drivers.
When using processor-specific instructions not exploited by or available to the compiler. A common example is the bitwise rotation instruction at the core of many encryption algorithms.
Embedded systems.
When extreme optimization is required, e.g., in an inner loop in a processor-intensive algorithm. Some game programmers are experts at writing code that takes advantage of the capabilities of hardware features in systems enabling the games to run faster.
When a system with severe resource constraints (e.g., an embedded system) must be hand-coded to maximize the use of limited resources; but this is becoming less common as processor price/performance improves
When no high-level language exists, e.g., on a new or specialized processor
Real-time programs that need precise timing and responses, such as simulations, flight navigation systems, and medical equipment. (For example, in a fly-by-wire system, telemetry must be interpreted and acted upon within strict time constraints. Such systems must eliminate sources of unpredictable delays – such as may be created by interpreted languages, automatic garbage collection, paging operations, or preemptive multitasking. Some higher-level languages incorporate run-time components and operating system interfaces that can introduce such delays. Choosing assembly or lower-level languages for such systems gives the programmer greater visibility and control over processing details.)
When complete control over the environment is required (for example in extremely high security situations, where nothing can be taken for granted).
When writing computer viruses, bootloaders, certain device drivers, or other items very close to the hardware or low-level operating system.
When reverse-engineering existing binaries, which may or may not have originally been written in a high-level language, for example when cracking copy protection of proprietary software.
Reverse engineering and modification of video games (known as ROM Hacking), commonly done to games for Nintendo hardware such as the SNES and NES, is possible with a range of techniques, of which the most widely employed is altering the program code at the assembly language level.
Assembly language is still used for writing games and other software for graphing calculators.
Finally, compiler writers usually write software that generates assembly code, and should therefore be expert assembly language programmers themselves.
REFERENCE:
WIKIPEDIA.ORG
Wednesday, September 24, 2008
QUESTION #3
Research in the net what is the best assembler and why.
Cite your reference.
Answer:
A86 (with its 32-bit version A386) is the finest assembler available, at any cost under any terms, for the Intel 86-family of microprocessors (IBM-PC, compatibles, and not-so-compatibles).
A86 accepts assembly language source files, and transforms them directly into either: (1) .COM files executable under DOS (or in a DOS box under Windows), starting at offset 0100 within a code segment; (2) .OBJ files suitable for feeding to a linker to create EXE files; or (3) object files starting at offset 0, suitable for copying to ROMs. A86 is a full featured, professional-quality program. I designed A86 to be as closely compatible to the standard Intel/IBM assembly language as possible, given that I insisted upon making design and language enhancements necessary to make A86 the best possible assembler.
Reference:http://eji.com/a86/index.htm
Cite your reference.
Answer:
A86 (with its 32-bit version A386) is the finest assembler available, at any cost under any terms, for the Intel 86-family of microprocessors (IBM-PC, compatibles, and not-so-compatibles).
A86 accepts assembly language source files, and transforms them directly into either: (1) .COM files executable under DOS (or in a DOS box under Windows), starting at offset 0100 within a code segment; (2) .OBJ files suitable for feeding to a linker to create EXE files; or (3) object files starting at offset 0, suitable for copying to ROMs. A86 is a full featured, professional-quality program. I designed A86 to be as closely compatible to the standard Intel/IBM assembly language as possible, given that I insisted upon making design and language enhancements necessary to make A86 the best possible assembler.
Reference:http://eji.com/a86/index.htm
Monday, September 22, 2008
2ND QUESTION IN MCS213
Question:Research in the net usual applications done in assembly language. Describe these applications briefly and cite the efficiency and effectiveness of these applications.Include your reference.
REFRAIN FROM COPYING AND PASTING THE ENTIRE TEXTS.
Answer:An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on abbreviations (called mnemonics) that help the programmer remember individual instructions, registers, etc. An assembly language is thus specific to a certain physical or virtual computer architecture (as opposed to most high-level languages, which are usually portable).
Assembly languages were first developed in the 1950s, when they were referred to as second generation programming languages. They eliminated much of the error-prone and time-consuming first-generation programming needed with the earliest computers, freeing the programmer from tedium such as remembering numeric codes and calculating addresses. They were once widely used for all sorts of programming. However, by the 1980s (1990s on small computers), their use had largely been supplanted by high-level languages, in the search for improved programming productivity. Today, assembly language is used primarily for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems.
A utility program called an assembler is used to translate assembly language statements into the target computer's machine code. The assembler performs a more or less isomorphic translation (a one-to-one mapping) from mnemonic statements into machine instructions and data. (This is in contrast with high-level languages, in which a single statement generally results in many machine instructions. A compiler, analogous to an assembler, is used to translate high-level language statements into machine code; or an interpreter executes statements directly.)
REFERENCE:WIKIPEDIA.ORG
REFRAIN FROM COPYING AND PASTING THE ENTIRE TEXTS.
Answer:An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on abbreviations (called mnemonics) that help the programmer remember individual instructions, registers, etc. An assembly language is thus specific to a certain physical or virtual computer architecture (as opposed to most high-level languages, which are usually portable).
Assembly languages were first developed in the 1950s, when they were referred to as second generation programming languages. They eliminated much of the error-prone and time-consuming first-generation programming needed with the earliest computers, freeing the programmer from tedium such as remembering numeric codes and calculating addresses. They were once widely used for all sorts of programming. However, by the 1980s (1990s on small computers), their use had largely been supplanted by high-level languages, in the search for improved programming productivity. Today, assembly language is used primarily for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems.
A utility program called an assembler is used to translate assembly language statements into the target computer's machine code. The assembler performs a more or less isomorphic translation (a one-to-one mapping) from mnemonic statements into machine instructions and data. (This is in contrast with high-level languages, in which a single statement generally results in many machine instructions. A compiler, analogous to an assembler, is used to translate high-level language statements into machine code; or an interpreter executes statements directly.)
REFERENCE:WIKIPEDIA.ORG
Wednesday, September 10, 2008
My First Blog in MCS213
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: Question #:
Question:________________
Answer: Actually MCS 213 is a difficult subject for me because it makes me think to much when making a program sometimes i got some headache.
Student Name: ALBERT IAN C. AMBE
Due: September 16, 2008
Question:________________
Answer: Actually MCS 213 is a difficult subject for me because it makes me think to much when making a program sometimes i got some headache.
Student Name: ALBERT IAN C. AMBE
Due: September 16, 2008
Subscribe to:
Posts (Atom)