Friday, October 10, 2008

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

const char *tutorial3;
void main(){
clrscr(); print(tutorial3);
for(;;);} const char *tutorial3 = "MuOS Tutorial 3";
void clrscr(){ unsigned char *vidmem = (unsigned char *)0xB8000;c
onst long size = 80*25; long loop; for (loop=0; loop
}out(0x3D4, 14);
out(0x3D5, 0);
out(0x3D4, 15);
out(0x3D5, 0);}
unsigned char in(unsigned short _port){ unsigned char result; __asm__ ("in %%dx, %%al" : "=a" (result) : "d" (_port));
return result;}
void out(unsigned short _port, unsigned char _data){ __asm__ ("out %%al, %%dx" : : "a" (_data), "d" (_port));} void print(const char *_message){ unsigned char *vidmem = (unsigned char *)0xB8000); unsigned short offset;
unsigned long i;out(0x3D4, 14);
offset = in(0x3D5) << offset =" in(0x3D5);" i =" 0;" vidmem =" _message[i++];">> 8));}
nasmw -f bin tutor3.asm -o bootsect.bin gcc -ffreestanding -c main.c -o main.o
gcc -c video.c -o video.o
gcc -c ports.c -o ports.o
'ld -e _main -Ttext 0x1000 -o kernel.o main.o video.o ports.o
ld -i -e _main -Ttext 0x1000 -o kernel.o main.o video.o ports.o
objcopy -R .note -R .comment -S -O binary kernel.o kernel.bin makeboot a.img bootsect.bin kernel.bin
}

Thursday, October 9, 2008

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

Cite your reference. Refrain from copying and pasting answers.

The Netwide Assembler, NASM, is an 80x86 assembler designed for
portability and modularity. It supports a range of object file
formats, including Linux and NetBSD/FreeBSD a.out, ELF, COFF,
Microsoft 16-bit OBJ and Win32. It will also output plain
binary files. Its syntax is designed to be simple and easy to
understand, similar to Intel's but less complex. It supports
Pentium, P6, MMX, 3DNow!, SSE and SSE2 opcodes, and has macro
capability. NASM is primally an Linux project. This web site
provide installation package for Windows 9x/NT/2k/XP and BeOS
Release 5, additionnal installation notes for Visual Studio
Integration and BeIDE integration and CHM documentation format.


NASM can output several binary formats including COFF,Portable executable, a,out, ELF and MAch-O, though Position independent code is only supported for ELF object files. NASM also has its own binary format called RDOFF. 32-bit programs can be written using NASM in such a way that they are portable to all 32-bit x86 operating system, if the right libraries are used.

The variety of output formats allows one to retarget programs to virtually any x86 operating system. In addition, NASM can create flat binary files, usable in writing boor loaders, ROM images, and various facets of OS development. NASM can run on non-x86 platforms, such as SparC and PowerPC, though it cannot output programs usable by those machines.

NASM uses Intel assembly syntax instead of AT&T syntax. It also avoids features such as automatic generation of segment overrides (and the related ASSUME directive) used by MASM and compatible assemblers.


Reference: Wikipedia.org
Justify what situations or applications programmers will rather use Assembly Languages than Higher Level Programming Languages and vice versa.

Assembly language is used when:

1. Low level control. When you need to change the flags, or thecontrol registers of the processor, as when entering protectedmode.
2. Speed. Programs written in machine language execute fast! It canexecute 10-100 times the speed of BASIC, and about twice as fast asa program written in C or Pascal.
3. Time Critical Code. Critical sections of programs written inhigher level languages can be written in assembly to speed upsections.
4. Small program size. When you write a TSR for example this is veryuseful. Writing interrupt handlers is where assembly languageshines.

 Reference: Patrik Ohman

Tuesday, October 7, 2008

Research in the net what is the best assembler and why.Cite your reference.Due: September 22, 2008

C is the best assembler because:


In computing, C is a general-purpose, cross-platform, block structured, procedural, imperative computer programming language.
Although C was designed for implementing system software, it is also widely used for developing application software
It is widely used on a great many different software platforms and computer architectures, and several popular compilers exist. C has greatly influenced many other popular programming languages, most notably C++, which originally began as an extension to C.


C's primary use is for "system programming", including implementing operating systems and embedded system applications, due to a combination of desirable characteristics such as code portability and efficiency, ability to access specific hardware addresses, ability to "pun" types to match externally imposed data access requirements, and low runtime demand on system resources.
C has also been widely used to implement end-user applications, although as applications became larger much of that development shifted to other, higher-level languages.
One consequence of C's wide acceptance and efficiency is that the compilers, libraries, and interpreters of other higher-level languages are often implemented in C.





Reference: Wikipedia.org

Saturday, September 27, 2008

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.



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.


Reference : Wikipedia.org

Wednesday, September 10, 2008


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: What topic(s) in MCS 213 do you find easy and/or difficult and why?
Answer: in making all the programs in C programming.
I have no idea how to create a program in C using an array and making a formula for the program.

Student Name: Abinon,Teodoro Jr