mah pix

Friday, October 10, 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.









#include
#include
#include


/********************************************************



* my_strchr -- Finds a character in a string. *



* Duplicate of a standard library function, *



* put here for illustrative purposes *



* *



* Parameters *



* string_ptr -- String to look through. *



* find -- Character to find. *



* *



* Returns *



* pointer to 1st occurrence of character *



* in string or NULL for error. * ********************************************************/



char *my_strchr(char * string_ptr, char find)



{



while (*string_ptr != find) {



/* Check for end */



if (*string_ptr == '\0')



return (NULL); /* not found */



++string_ptr; } return (string_ptr); /* Found */



}



int main()



{



char line[80]; /* The input line */



char *first_ptr; /* pointer to the first name */



char *last_ptr; /* pointer to the last name */



fgets(line, sizeof(line), stdin);



/* Get rid of trailing newline */



line[strlen(line)-1] = '\0';



last_ptr = line; /* last name is at beginning of line */



first_ptr = my_strchr(line, '/'); /* Find slash */



/* Check for an error */



if (first_ptr == NULL)



{



fprintf(stderr,



"Error: Unable to find slash in %s\n", line);



exit (8);



}



*first_ptr = '\0'; /* Zero out the slash */



++first_ptr; /* Move to first character of name */



printf("First:%s Last:%s\n", first_ptr, last_ptr);



return (0);



}










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.Cite your reference. Refrain from copying and pasting answers.

The most recent assembler is the FASM..

History:

The project was started in 1999 by Tomasz Grysztar aka Privalov (at that time, an undergraduate student of mathematics from Poland) and its first public was announced on March 15 2000. Fasm is completely written in ASSEMBLY LANGUAGE and comes with full source. it is self-hosting and has been used to write several operating systems including MenuetOS , KolibriOS and DexOS.

Nature:
Fasm is a low-level assembler. It does not support as many high-level statements as MASM or TASM. Instead it provides syntax features and macros which make it possible to customize or create missing statements. Its memory addressing syntax is similar to Tasm's ideal mode and Nasm. Brackets are used to denote memory operands as in both assemblers but their size is places outside the brackets like in Nasm. It is multi-pass assembler. It makes extensive code size optimization, and allows more forward referencing. A usual Fasm construct is defining data or procedures only if they are used somewhere in the code, something that in most languages is done per-object by the linker.

Applications:

DexOS, & BOS - 32-bit DOS-like OS'es
MenuetOS - 32-bit and 64-bit GUI operating systems
KolibriOS -32-bit GUI OS
FASMLIB - portable library for x86 32-bit assembly programming
PROE - x86-64 encryption engine
RevaForth
uFMOD - xm player for Win32,Linux, Unix/BSD & KolibriOS


References:
1. Tomasz Grystar. Flat Assembler Programmer's Manual

2. Randall Hyde. "which Assembler is the Best?"

3. FASMARM (2008-03-20)

4. Interview with Privalov the author of FASM

5. Tomasz Grysztar. " Flat Assembler Design Principles"









Thursday, October 2, 2008

itZ a Matter oF cHoiCe!!!!

weLL, in this moment of mah life i feel so terrible, stress and lonely. why? its because i miss people whom i used to laugh with. i miss thier teases about me, i miss the things they do to me. i miss them!!!
one person whom i miss is Liptoni!!! even we see each other at the school, its just that i miss his company..
another one is eric!!!!!!!!hehehe.. i just miss his kurot to me evah. i missed his asar through text,..hahahaha!! funny but true!!
i missed also mah tseB!!i missed the old Chrizy whom i used to call when im depressed.i missed his attention to me. even he has GF,he make sure that im alright.he makes assure that im happy..=) . . . but now??well, something had changed.i feel he doesn't care anymore. he doesn't even notice that im not feeling well the other day..hayyy!!am i not special for him anymore??=(

well, this things happen in just a twink of an Eye!!.. its a matter of choice if im gonna make it so serious.. but no matter how much i ignore this feeling inside,, i just break down and CRY!!='(


well, im still happy with mah friends!!!!!

=)
=)
=)

Wednesday, September 24, 2008

Question #4





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

Learning assembly language forces the programmer to learn the costs associated with various high-level constructs.You can learn the 20 or 30 machine instructions found in common assembly applications in just a few days. You can even learn how to put those machine instructions together to solve problems the same way you'd solve those same problems in a high-level language in just a few short weeks.the real reason assembly language programs tend to be more efficient than programs written in other languages is because assembly language forces the programmer to consider how the underlying hardware operates with each machine instruction they write. And this is the key to learning how to write efficient code -- keeping one's eye on the low-level capabilities of the machine.



The capable of learning and knowing how to use the assembly language is the chance that can be easily learn the higher level language.



The application of this kind of language is Java. Here is a view of Java Program:







Tuesday, September 23, 2008

ahMM nice picture Huh. .. sa house poh yan,,,

Monday, September 22, 2008

wen i turned 18....hmmm its really nice...

the day has come when my childish years will end. September 20, 2008 is the best thing happen in my life.
the night before that day, i was so excited what will happen the next day. but the excitement that I felt was gone in a twink of an eye because of several reasons.
well, sabi nga nila expect the unexpected.. something happen when the preparation was on going.there was a feeling of mine that made me so scared to pursue the plan to go at the beach.. duH,, nagpatuloy pa rin dahil na rin sa pag-convince sakin ng mga friends ko tsaka para maging happy ako sa birthday ko noh. mahirap na yung magsisi pa ako sa huli..

Question #3

Research in the net what is the best assembler and why.

The best assembler for me is the fasm or FAT ASSEMBLER. It is because fasm is a fast speed, size optimizations, OS portability and macro capabilities. it also provides syntax features and macros which make it possible to customize or create missing statements.
It doesn't uses high-level language unlike the others. It is also free and open source intel-style assembler. This is an
example of Flat Assembler Language: