Thursday, October 9, 2008

sorry maam for this late report of mine because i ask you if i will report and you said just post here at blog siguro yung pag sulat mo sa name ko na magreport ako baka absent ako nung time na yun working student kasi ako maam and ako lang ang nagpapaaral sa akin my last week kasi dami ko ginawa kaya nga im so late every class of yours i hope you will understand me maam


The Z8000
was a 16-bit microprocessor introduced by ZiLOG in 1979. The architecture was designed by Bernard Peuto while the logic and physical implementation was done by Masatoshi Shima, assisted by a small group of people. Z8000 was not Z80-compatible, and although it saw steady use well into the 1990s, it was not very widely used. However, the Z16C01 and Z16C02 Serial Communication Controllers still use the Z8000 core.

Feature
Although fundamentally a 16-bit architecture, some versions had 7-bit, segment registers that extended the address space to 8 megabytes.
The register set consisted of sixteen 16-bit registers, and there were instructions that could use them as 8-bit, 16-bit, 32-bit, and 64-bit registers. The register set was completely orthogonal, with register 15 conventionally designated as stack pointer, and register 14 for stack segment.
There was both a user mode and a supervisor mode.
Like the Z80, the Z8000 included built-in DRAM refresh circuitry. Although an attractive feature for designers of the time, overall the Z8000 was not especially fast and had some bugs, and in the end it was overshadowed by the x86 family.
One notable use of the Z8000 series was by Namco in the design of its famous Pole Position series of racing videogames. Two Z8002's (small-memory versions of the Z8000) were incorporated into the design.

Final BLog 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.

ANSWER:

default {
state_entry()
{
llSay(0, "Hello, Avatar!");
}
}

000000 00 00 40 00 00 00 00 00 00 00 02 00 00 00 3f ff ..@...........?ÿ
000010 00 00 3f ff 00 00 00 af 00 00 00 b6 00 00 00 00 ..?ÿ...¯...¶....
000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000030 00 00 00 00 00 00 00 00 00 00 00 64 00 00 00 64 ...........d...d
000040 00 00 00 00 00 00 00 00 00 00 00 64 00 00 00 00 ...........d....
000050 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 ................
000060 00 00 00 01 00 00 00 01 00 00 00 10 00 00 00 00 ................
000070 00 00 00 01 00 00 00 05 00 00 00 00 08 00 00 00 ................
000080 00 00 00 00 05 00 63 5b 5e 00 00 00 00 60 48 65 ......c[^....`He
000090 6c 6c 6f 2c 20 41 76 61 74 61 72 21 00 66 00 00 llo, Avatar!.f..
0000a0 00 00 5c 5e 00 00 00 08 70 11 08 d1 00 17 95 00 ..\^....p..Ñ....
0000b0 00 40 00 00 .@..
... remaining bytes are 00 ...

***************************************************************/
.INCLUDE "LSO.inc"

HeaderBlock:
LONG $00004000 ; Machine memory
LONG $00000000 ; Program Counter (0 means currently not running)
LONG $00000200 ; version
LONG LocalFrame
LONG StackTop
LONG HeapTop
LONG HeapBottom
LONG $00000000
LONG $00000000 ; Current State
LONG $00000000
LONG $00000000
LONG $00000000
LONG $00000000
LONG $00000000
LONG StaticBlock
LONG FunctionBlock
LONG $00000000
LONG $00000000
LONG StateBlock
LONG $00000000
LONG $00000001 ; Bit-Encoded Events to run bit31-0
LONG $00000000
LONG $00000000
LONG $00000000 ; Bit-Encoded Event Mask bit63-32
LONG $00000001 ; Bit-Encoded Event Mask bit31-0 ... bit0=state_entry

StaticBlock:
FunctionBlock:
StateBlock:
LONG 1 ; Numer of States in script

;StateEntry
LONG State0-StateBlock ; Location of State Relative to State Block
LONG $00000000 ; Bit-Encoded Event Mask bit63-32
LONG $00000001 ; Bit-Encoded Event Mask bit31-0 ... bit0=state_entry

State0:
;State Header
LONG 5 ;Size of Header
.db 0 ;null terminated string

State0_header_end:
; Pointer to Code Chunk (relative to end of State Block header)
LONG State0_state_entry-State0_header_end
LONG 0 ; Call Frame Size
State0_state_entry:
;Code Chunk Header
LONG 5 ;Size of Code Chunk Header
.db 0 ;Null Terminated String

PUSH_VOID4
PUSH_ARGS_START
PUSH_INTEGER $00000000
PUSH_STRING "Hello, Avatar!"
PUSH_LOCAL_ALLOC $00000000
PUSH_ARGS_END PUSH_INTEGER $00000008 MATH_ADD Integer, Integer BUILD_CALL_FRAME
CALL_BUILTIN llSay
RETURN

State0End:
HeapTop:
;HeapEntry DataSize(long), Type(byte), Reference count(word)
;marks the end of the heap?
HeapEntry $4000,Void,0

HeapBottom:
.org $3FFFStackTop:LocalFrame:

Question Number 5

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

ANSWER: LSO Assembler

A very crude LSO assembler has been created based on the information available on the LSO reverse engineering page. It is created using Ville Helin's WLA assemblers. His macro support is good enough that it is a language of its own and thus allowed the LSO assembler to be built on top of his existing assembler using just macros and constant definitions (I told you it was crude! For those curious, it is actually running on the assembler designed for the Super Nintendo sound processor

SOURCE: http://www.libsecondlife.org/wiki/LSO_Assembler

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.


ANSWER:

FOR ME, Assembly language are generally very simple, unlike in a high-level language. Each instruction typically consists of an operation or opcode plus zero or more operands. Most instructions refer to a single value, or pair of values. Generally, an opcode is a symbolic name for a single executable machine language instruction. Operands can be either immediate (typically one byte values, coded in the instruction itself) or the addresses of data elsewhere in storage.


Most assemblers also support pseudo-operations, which are directives obeyed by the assembler at assembly time instead of the CPU at run time. (For example, pseudo-ops would be used to reserve storage areas and optionally set their initial contents.) Often the names of pseudo-ops start with a dot to distinguish them from machine instructions.


Most assemblers provide flexible symbol management, letting programmers manage different namespaces, automatically calculate offsets within data structures, and assign labels that refer to literal values or the result of simple computations performed by the assembler. Labels can also be used to initialize constants and variables with relocatable addresses.


Assembly languages, like most other computer languages, allow comments to be added to assembly source code that are ignored by the assembler. Good use of comments is even more important with assembly code than with higher-level languages.

Sunday, September 28, 2008

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


ANSWER: NASM Assembler

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.

SOURCE: http://www.programmersheaven.com/download/24089/Download.aspx
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.Include your reference. REFRAIN FROM COPYING AND PASTING THE ENTIRE TEXTS.


ANSWER:

Launch Java Applications from Assembly Language Programs

by Biswajit SarkarJavaNative Interface (JNI) is a mechanism that can be used toestablish communication between native language programs and theJava virtual machine. The documentation for JNI and the technicalliterature on JNI deal extensively with interactions between theJVM and C/C++ code. The Java SDK even provides a utility togenerate a header file to facilitate calling C/C++ programs fromJava code. However, there is hardly any mention of Java andassembly language code working together. In an earlier article I showed how assembly language programs can becalled from Java applications. Here I deal with the technique forinvoking Java programs from an ASM process through a demoapplication that calls a Java method from assembly language code.The Java method brings up a Swing JDialog to show thatit has, indeed, been launched.
Why Java with ASM?JNI is essential to the implementation of Java, since the JVMneeds to interact with the native platform to implement some of itsfunctionality. Apart from that, however, use of Java classes canoften be an attractive supplement to applications written in otherlanguages, as Java offers a wide selection of APIs that makesimplementation of advanced functions very simple.Some time ago, I was associated with an application to collectreal-time data from a number of sources and save them in circularbuffers so that new data would overwrite old data once the buffergot filled up. If a designated trigger event was sensed through adigital input, a fixed number of data samples would be saved in thebuffers so that a snapshot of pre- and post-trigger data would beavailable. The original application was written in assemblylanguage. After the application was used for a few months, it wasfelt that it would be very useful to have the application mail thesnapshots to authorized supervisors whenever the trigger eventoccurred. Of course, it would have been possible to write thisextension in assembly, but the team felt that in that particularinstance it was easier to write that extension in Java and hook itup with the ASM program. As I had earlier worked with ASM-orientedJNI, I knew this could be done and, indeed, the project wasimplemented quickly and successfully.I am sure there are many legacy applications written in assemblylanguage that could benefit from such add-ons. However, it is notonly for old applications in need of renovation that JNI can proveuseful. Although it may seem unlikely to some of us, assemblylanguage is still used for writing selected portions of newprograms. In an article published not very long ago, the author says, "I havefound that many of Sun's partners still use assembly language intheir products to ensure that hot code paths are as efficient aspossible. While compilers are able to generate much more efficientcode today, the resulting code still doesn't always compete withhand-coded assembly written by an engineer that knows how tosqueeze performance out of each microprocessor instruction.Assembly language remains a powerful tool for optimization,granting the programmer greater control, and with judicious use canenhance performance." Clearly, in such "mixed language"applications the ability to use Java with ASM can be useful.Note that the technique shown here can also be used to call Javacode from languages other than ASM. If JInvoke isrewritten as a .dll, code written in FORTRAN, for instance,can link to it and call a Java method.I have used JNI with legacy ASM code in two ways:
Functional enhancement: Mail-enabling an existing ASMapplication, as mentioned earlier.
Interface enhancement: Adding interactive user interface(mostly AWT, but some Swing as well).
These enhanced applications have run on Windows 2000 and XP. TheJava versions used were 1.3, 1.4, and 1.6. In all cases theapplications worked smoothly.

SOURCE: http://www.javaworld.com/community/?q=node/850

Sunday, September 14, 2008

MCS 213 Students

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: the easy topic on mcs 213 on me is about the computer system or about the memory of the computer, because it gives me more idea and i can understand fast. and the difficult part is the reports of my classmates, because it makes me dizzy, so many topic to memories.

Student Name: Genaro T. Rogan Jr.

Due: September 16, 2008