Sunday, September 30, 2012

SmallTalk


I. History

  • 1960 - August 1981
An excellent starting place for learning about the early history of Smalltalk (1960 - August 1981) is "The Early History of Smalltalk" by Alan Kay.

  • August 1981 Byte Magazine Smalltalk Issue
Byte Magazine published a special issue in August 1981 that was completely devoted to the Smalltalk-80 Langauge and System. A key article was written by Dan Ingalls and entitled "Design Principles Behind Smalltalk". It provides an overview of the core ideas of Smalltalk. This article is still considered required reading for anyone new to Smalltalk. The cover of Byte Magazine was done by Robert Tinney and is of a multi-colored balloon leaving the ivory tower of Xerox labs.

  • 1983 Smalltalk-80 Books Published
Addison Wesley publishes the three Blue, Red and Green Smalltalk-80 books authored by Adele Goldberg, David Robson and Glenn Krasner.

  • 1983 Official Release of Smalltalk-80
1983 saw the first publicly available release of Smalltalk known as Smalltalk-80, the definitive release of the language that has set the standard for high level langauge systems since.

  • 1984 Apple Release of Smalltalk-80
Apple releases a USD$50.00 version of Smalltalk-80 for the Apple MacIntosh Plus. System requirements are a hard disk drive and one megabyte of RAM. Available working RAM once Smalltalk was loaded was 50 kilobytes, barely enough to use the system.

  • Digitalk Smalltalk/V
  • .ParcPlace Smalltalk-80/VisualWorks Smalltalk
  • .ParcPlace-Digitalk Merger into ObjectShare
  • .IBM VisualAge Smalltalk
  • Squeak Smalltalk
Squeak Smalltalk project started at Apple by Alan Kay and Dan Ingals. Squeak is based on the Apple Smalltalk-80 system (and presumably license).  

  • 1983 -> Present, Smalltalk Proliferates, Stablelizes and Proliferates Again!
Since it's Official Release Smalltalk has proliferated and currently has around twenty active versions in distribution and a few in various stages of development. Recently a flood of new versions and variations have surfaced including numerous versions aimed at bringing Smalltalk into the Java universe.

II. Origin of Name

        It is “called”Smalltalk”—as in”programming should be a matter of …” [Smalltalk] and “children should program in…” [Smalltalk].
        The name is also a reaction against the “IndoEuropean god theory” where systems were named Zeus, Odin, and Thor, and hardly did anything.
        I figured that “Smalltalk” was so innocuous a label that if it ever did anything nice people would be pleasantly surprised.”
-Alan Kay, The Early History of Smalltalk, section III, Origin of Smalltalk's Name"

III. Description

Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." It was designed and created in part foreducational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s.
The language was first generally released as Smalltalk-80. Smalltalk-like languages are in continuing active development, and have gathered loyal communities of users around them. ANSI Smalltalk was ratified in 1998 and represents the standard version of Smalltalk.


IV. Language Predecessor

Simula67
Lisp

V. Sample Run

Squeak transcript showing the result of Transcript show: 'Hello World'

COMMENTS:

"Wala akong idea sa SmallTalk." -- Sir JACHermocilla
"Nagamit ko s'ya no'ng MS, pero I can't even remember how to program "Hello World!" in SmallTalk anymore..." --Sir Arian Jacildo

Sources:

http://www.smalltalk.org/smalltalk/history.html
http://www.smalltalk.org/smalltalk/whatissmalltalk.html 
Kay, Alan. "The Early History of Smalltalk" . Retrieved 2007-09-13. http://www.smalltalk.org/versions/ANSIStandardSmalltalk.html 
http://pupeno.com/2011/07/


CMSC 124 T-8L
Aguila, Kasandra Mae M.                            2010-62626
Esclanda, Charmaine Bianca F.                  2010-01931
Maranan, Jonathan P.                                 2010-57000



Friday, September 28, 2012

JADE


I. History

JADE was first released in September 1996. It was conceived by Sir Gilbert Simpson and is currently developed by the Jade Software Corporation.   JADE is used throughout the public hospitals in Australia’s Northern Territory and powers the scheduling software for Britain’s largest rail freight operator.  The latest version is JADE 7.

II. Features

JADE is a parallel programming language for exploiting coarse-grain concurrency processing in sequential, imperative programs. JADE allows programmers to implement a shared memory model by letting any process access shared objects transparently. Commonly, JADE programmers augment their sequential programs with special constructs that divides the whole computation into tasks and specify how each task would access shared objects. JADE interprets these instructions but still preserve sequential semantics. The JADE implementation analyzes divided modules and determines which tasks can be executed concurrently. JADE is object-oriented with syntax based on Modula-2 – derived from Pascal.

JADE offers developers the ease to store, retrieve and manipulate complex object models from different frameworks. Also, while providing portability, JADE lets designers to build distributed systems of complex logic with automatic object caching for better performance. It entirely eliminates the development effort required to move objects to and from a database. Another thing to consider is that JADE is distributed in Open Source. It is implemented with a GUI somehow making programming easy and a lot more organized.

Though implemented with Java and is considered to be a high-level object-oriented programming language, JADE developers chose to set aside common and at the same time somehow very significant features. JADE does not support method overloading and operators. Also it does not provide constructors with specific parameters; which can lead to problems regarding the proper initialization of a particular object. Though missing some important modern object-oriented features, it is built with an object manager.

Summing it all up JADE is a modern language with great features and compatibility advantages of other well-known programming languages packaged into one. In addition, it is developed to let programming be easier but at the same time efficient.

III. Applications

1. Databases – Jade is a very useful programming language in when talking about databases simply because object database is a native part of its language.
2. Web services - JADE supports deployment of applications to the web through its HTML documents feature. These work very similarly to ASP.NET, where developers create templates of HTML pages and leave parts in the template for the program to fill in.
3. GUI – As programming language based on java, Jade introduced a whole new kinds of libraries applicable in creating User Interfaces.

IV. "Hello World" in Jade

helloWorld();
begin
   write "Hello, World!";
end;

V. Insights

 "Our JADE system is critical to the operation of our organisation, particularly our communications with our supporters and management of child sponsorships. Since going live, it has met all performance demands, with absolutely no unscheduled outages. The reliability of the JADE platform and JADE Care24 managed service has been excellent." - Andrea Spurdle, Head of IT, World Vision UK

"JADE is great for small, agile, collaborative development teams like ourselves. Teams of customer-oriented, solution-focused developers who get a kick out of getting on and delivering stuff. JADE enables us to achieve a high degree of code reuse and with its seamless database integration we have less code to worry about reusing. Since 1996, JADE has given us a real solid platform that we can rely on. A single platform on which we can build large commercial systems that can scale from small, inexpensive hardware to high-end servers. It has never let us or our customers down." -Allan Baird, Abel Software Limited

 "We have used SQL Server and Microsoft's Business Intelligence tools for our data warehousing needs for more than four years. The ETL process is an important element of any data warehouse to ensure that data is loaded quickly and accurately. RPS in JADE delivers an automated and seamless mechanism to transfer data from our core online JADE systems to SQL Server. This provides us with a cost-effective approach to significantly improve the availability, performance, scalability and security of the first stage of our ETL process." -Debbie Richardson, IT Director, Homeloan Management Limited

"JADE enables the entire server-side of Greentree to be encapsulated in a single installation directory. This greatly simplifies system administration and makes Greentree reliable, robust, and extremely cost effective from an IT perspective. We can easily run multiple independent, isolated installations on the same machine without them affecting each other, which is great for development and testing." -Stephen Sims, Director R&D, Greentee International

"Okay, first of all, it's not cross-platform. There lies the first problem to scalable development. A first look at its features and you would see that the stack used for JADE can only be used to its full potential when running on a Windows environment. Tama ba ako? Of course, if there are other cross-platform stacks out there that are both open source and very reliable in terms of end-to-end deployment (regardless of application stacks) JADE doesn't look very promising." -Allister Alambra, Instructor 1 at ICS

"A very good language for web applications because it is almost like a combined java and php. Its built in libraries make OOP easier to implement in web." -Reecenil Valencia


"Easy to learn, somehow noob friendly" - Aldreege Beltran

"Sa syntax ng Jade, mas human-readable siya compared sa ibang programming languages kaya bilang isang typical user, mas preferred ko ang jade. " -Angelo dela Cruz

"Jade is like a combination of known programming languages. Also, its syntax is easy to learn and understand." - Marjerie Anne Roxas

"Easy to learn and implement that can support multilingual properties and most of all, portable." - Sheleen San Antonio

References:

http://suif.stanford.edu/jade.html
http://people.csail.mit.edu/rinard/paper/thesis.pdf

CMSC 124 T-5L

Beltran, Aldreege             2010-26797
Dela Cruz, Jose Angelo    2010-13975 
Roxas, Marjerie Anne      2010-03959
San Antonio, Sheleen       2010-03283
Valencia, Reecenil           2010-04038

Tuesday, September 25, 2012

Eiffel


About Eiffel
Eiffel is an ISO-standardized, object-oriented programming language  . The design of the language is closely connected with the Eiffel programming method. Both are based on a set of principles, including design by contractcommand-query separation, the uniform-access principle, the single-choice principle, the open-closed principle, and option-operand separation.
Many concepts initially introduced by Eiffel later found their way into JavaC#, and other languages. New language design ideas, particularly through the Ecma/ISO standardization process, continue to be incorporated into the Eiffel language.

A Little History
The Eiffel programming language was created by Bertrand Meyer and developed by his company, Interactive Software Engineering (ISE) of Goleta, CA in 1985. Eiffel has evolved continually since its conception on September 14, 1985 and its first introduction in 1986. Eiffel is named after Gustave Eiffel, the engineer who designed the Eiffel Tower. The developers of Eiffel like to compare themselves to the well-built structure of the Eiffel Tower. The Eiffel Tower was completed on time and within budget, which should happen if you use Eiffel for your software projects.

Significant Language Features
There are several significant language features of Eiffel:
  • Portable - this language is available for major industry platforms, such as Windows, OS/2, Linux, UNIX, VMS, etc...
  • Open System - includes a C and C++ interface making it easily possible to reuse code previously written.
  • "Melting Ice Technology" - combines compilation, for the generation of efficient code, with bytecode interpretation, for fast turnaround after a change.
  • "Design by Contract" - enforced through assertions such as class invariants, preconditions and postconditions.
  • Automatic Documentation ("Short Form") - abstract yet precise documentation produced by the environment at the click of a button.
  • Multiple Inheritance - a class can inherit from as many parents as necessary.
  • Repeated Inheritance - a class inherits from another through two or more parents.
  • Statically Typed - ensure that errors are caught at compile time, rather than run time.
  • Dynamically Bound - guarantees that the right version of an operation will always be applied depending on the target object.
Areas of Application
Eiffel is used in many application areas, such as:
  • Telecommunication Systems
  • Teaching Purposes
  • Rapid Prototyping
  • Financial Applications

Sample Hello World Program



Why Eiffel?
  •         Eiffel is arguably the best commercial object-oriented language available today.

            ---Jim Rumbaugh et al. in Object-Oriented Modeling and Design, Prentice Hall 1991.
  •        Developers who want an object-oriented language that adheres to the keystone principles of software engineering need look no further than Eiffel.

           ---Peter Varhol in Byte Magazine, February 1996.
  •      As a design language, Eiffel continues to be a better model for object- oriented programming than Ada. It is even better than the new Ada 9X standard.

          ---Richard Riehle in HP Professional, October 1994, A Tour of Eiffel.
  •                It took us 7 years to design the Taligent software in C++. If we had had Eiffel as our design and coding environment, we could have done it in 4.

         ---Jack Grimes, VP, Taligent in a Keynote speech at the TOOLS USA '95 Conference in Santa Barbara, CA
  •               There is a big problem with people who say they know C++ - but they don't really know how to do objects. If they have Eiffel on their résumé, then we know they really have the proper understanding of what they are doing.

        ---Leslie Goff quoting an IT hiring manager in Computerworld, Object Edge, December 18, 1995.
  •                We evaluated three major object-oriented languages for the project - Smalltalk, C++ and Eiffel - and chose Eiffel. [...] Rainbow currently comprises over 400,000 lines of code, for about 3000 classes. The developers feel very productive. This was confirmed when Rainbow's financial backers brought in object professionals to audit the project. The auditors evaluated the project during July 1994 and were impressed with the productivity of the Rainbow development group.

--                              ---Stephan in Object Magazine, July-August 1995, Building financial software with object technology.

References
http://www.irisa.fr/pampa/EPEE/WhyEiffel.html
http://groups.engin.umd.umich.edu/CIS/course.des/cis400/eiffel/eiffel.html
http://en.wikipedia.org/wiki/Eiffel_(programming_language)
http://tecomp.sourceforge.net/index.php?file=doc/lang/tutorial.txt



Group Members
Names                        Student Number
Ybur Haniel                              2010-50662
Jericko Ramilo                          2010-15519
Ivan Matabang                          2010-52896
Renee Chiarianne Navarrosa               2010-53164
Charmina  Sejalbo                     2010-04070
T-2L

Wednesday, September 19, 2012

Crushing nuts with Squirrel!




"Squirrel is a high level imperative, object-oriented programming language, designed to be a light-weight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications like video games."

Created by Alberto Demichelis, it is an imperative, functional, object-oriented and also a scripting language all in one. Though it's relatively young--making its debut last 2003--Squirrel already had its stable release last July 19, 2012. Squirrel 3.0.3 is now up for grabs in the net under MIT LicenseIt is highly influenced by programming languages like Python, Lua, JavaScript and C++ and uses a C-like syntax. It can be used for commercial and non-commercial products because it's free and open source.

(For further information about Demichelis, you may visit his site at http://www.demichelis.net/)

Why was Squirrel created in the first place?

According to the author of this programming language,
"I was working on a game using Lua as scripting language; while I'm in love with Lua's design I was having problems with the garbage collector. Initially, I tried to convert the Lua from garbage collected to referene counted, and then I decided to create a brand new language designed around my needs and vision of scripting. Later on, a colleague of mine suggested me to distribute it as open source."


Language Features:
  • dynamic typing
  • delegation
  • classes & inheritance
  • higher order functions
  • lexical scoping
  • generators
  • cooperative threads(coroutines) 
  • tail recursion
  • exception handling
  • automatic memory management (CPU bursts free; mixed approach ref counting/GC)
  • both compiler and virtual machine fit together in about 7k lines of C++ code and add only around 100kb-150kb the executable size.
  • optional 16bits characters strings
  • powerful embedding api
    • eg. function/classes can be defined by scripts or in C
    • eg. objects can fully exist in the VM or be bound to native code
    • eg. classes created in C can be extended by scripts or vice-versa 

Squirrel, just like in other PL uses the equal sign ( = ) for assigning a value to a variable. But it also has a special operator called the New Slot Operator ( <- ) which is a conjunction with tables to create a new slot before the assignment if the assignment references a non-existent slot identifier.

table.x <- y; // creates x if not present in table and assigns the value of y to x

  It also supports bitwise operators such as:

    • Bitwise AND (&): a & b
    • Bitwise OR (|): a | b
    • Bitwise XOR (^): a ^ b
    • Bitwise NOT (~): ~a
    • Left shift (<<): a << b
    • Right shift (>>): a >> b
    • Zero-fill right shift (>>>): a >>> b

  Bitwise operators only work on integers, any other type will
  cause an exception.

  Its statements as well as operators and how it is executed are very much alike as C with a touch of Java. This is evident with its loop statements and its exception handling.

Here are some sample codes we tried ourselves:

    Since Squirrel had been recently introduced and is being used mostly for game development, we had a hard time looking for an application where we can run it. The following code snapshots are done with the use of the Squirrel Shell (which can be downloaded from http://sourceforge.net/projects/squirrelsh/). 

Here is a simple hello world program:




    The printl() function prints the string inside it then prints a new line. You can use the print() instead if you do not want to print a new line after the string.


    Our second example is a simple scanning of the user's input:




 Here, we use the function scan where the console will wait for your input until you press the enter key. The value it gets is initially a string so if you want to have an input that is an integer, you need to convert it using the function tointeger() as illustrated in our next example.



   The tointeger() function is used like how methods are used in Java.


Did you know that...


  • Squirrel was used as a scripting language in games like Left For Dead 2 and Final Fantasy Crystal Chronicles: My Life as a King, Portal 2 and Alien Swarm?
  • It already influenced a programming language named MiniD?


Insights...


"This is the first time I've heard this programming language. And all I could say about this PL is that it is very much like C but with added features of Java or Python. For programmers who really want to try a nice hybrid of an imperative and object-oriented--with scripting as a bonus-- I think they would find this PL a very nice language to learn. And for a newbie language like this, I think it is very promising because the development is centralized and considering that an application like Left for Dead 2 used this as a scripting language already tells us a lot. Lastly, I really find the file extension (.nut) of this PL very amusing and witty. :)"


- Reneelou "Renz" Estacio


"The syntax is almost alike to JAVA and C++, making it easier to understand and code. But the downfall is that, its SO HARD to find its compiler as well as sample codes due to the fact, as said earlier that its a new programming language. Still its cute, living up to its name, SQUIRREL. :))))" 
 -Sefora Doreen Galos (2010-42177)
"Squirrel is a language that can be easily understood because of the fact that it is inspired by popular languages such as C/C++ and Java. Its syntax is very similar to the said languages which makes it easier for programmers to use. Also, it is a multi-paradigm language. It is imperative, which ensures us its performance; functional, which tells us that it is reliable; and object-oriented to make representations of real-world problems much easier. And since it is lightweight, it is very good for development of games in the net or even on IOS and Android OS. If only the resources (and tutorials) would increase, then I think squirrel might become very popular language game development."
-Kristine Bernadette Pelaez (2010-16170)
"I find squirrel very easy to understand because of its similarity to C and Java in terms of its syntax, It's like programming in an object-oriented way in C syntax. In terms of learning the language, it is easy to use squirrel but I guess, it has still a long way to go since it is still a new PL. "
-Anna Rodina Marte (2010-01064)




Sources:
http://www.squirrel-lang.org/
http://wiki.squirrel-lang.org/default.aspx/SquirrelWiki/FAQ.html
http://en.wikipedia.org/wiki/Squirrel_(programming_language)



Members: (T-5L)

Estacio, Reneelou Marie D.
Galos, Sefora Doreen R. (2010-42177)
Marte, Anna Rodina S. (2010-01064)
Pelaez, Kristine Bernadette P. (2010-16170)

Tuesday, September 18, 2012

NO Detours, NO Shortcuts - Just Assembly.

  • What is Assembly Language?

Assembly Language is a low level programming language and considered as the native language of computers. It is a close approximation of the binary machine code and is referred to as Assembly Code.

It is the same as machine language, only that instead of numbers, letter sequences which are easier to memorize and understand are used to write commands. It maps human readable mnemonics to machine instructions, thus allows machine level programming without writing in the machine language.

  •  History of Assembly Language
Early computer systems were programmed literally by hand. Front panel switches were used as input device for entering instructions and data. They represented addresses, data, and other significant function in the system. Specific switches were toggled to operate. 

For example, to be able to run a specific program, a certain switch which represented a certain address needs to be toggled. After that, another switch representing the data that would be used in that address would also be toggled. When all of the preparations were already made, the final run switch was then toggled signaling the run of the program.


Basically, programming back then required a certain talent in memorizing and focus for you to remember every procedure that was needed for a certain program. The programmer also needed to know every instruction set in a processor. It would allow the programmer to convert those instructions into bit patterns so that the panel switches would be set correctly.


 Because of the fact that everything was being manipulated manually, the programs were very much prone to errors. Not only that, they were also very likely to be very slow because raw manpower was needed for the program to run.

 With the advent of new technologies, programs were written to perform those manual entries on the premise of having a larger memory. Small monitor programs that used hex keypads or terminals to enter instructions became popular as well as paper tapes and punch cards which were used as storage media for programs.

 Since programs were still hand-coded, conversion from mnemonics to instructions were still performed manually. Because of that, programmers thought of a way to increase the efficiency of their every work thus the idea of writing a program to interpret another was a major breakthrough. This program would run as a translator of mnemonics to instructions. Advantages of having such changes reduced errors, provided faster translation times and easier editing.

  • Who's Who?    
Nathaniel Rochster
               Nathaniel Rochster wrote the first assembler that was used in IBM 701 in 1954.

Stan Poley 


                  Stan Poley is the author of SOPA (Symbolic Optimal Assembly Program). SOPA was written in 1955 and used as the assembly language for IBM 650.

  • What does it do?
          Assemblers are programs which generate machine code instructions from a source code program written in assembly language. The features provided by an assembler are:

  • allows the programmer to use mnemonics when writing source code programs.
  • variables are represented by symbolic names, not as memory locations
  • symbolic code is easier to read and follow
  • error checking is provided
  • changes can be quickly and easily incorporated with a re-assembly
  • programming aids are included for relocation and expression evaluation

           In writing assembly language programs for micro-computers, it is essential that a standardized format be followed. Most manufacturers provide assemblers which are programs used to generate machine code instructions for the actual processor to execute.

           The assembler converts the written assembly language source program into a format which runs on the processor. Each machine code instruction (the binary or hex value) is replaced by a mnemonic. A mnemonic is an abbreviation which represents the actual instruction.

Binary
Hex
Mnemonic
01001111
4f
Clra
00110110
36
Psha
01001101
4d
tsta


                              CLRA - Clears the A accumulator
                           PSHA - Saves A accumulator on Stack
                               TSTA - Test A accumulator for 0

            Mnemonics are used because they:
          · are more meaningful than hex or binary values
          · can reduce the risks of commiting errors
          · are easier to remember than bit values

            Assemblers also accept certain characters to represent number bases and addressing modes.

           $ prefix or h suffix for hexadecimal
           $24 or 24h


           D for decimal numbers

           24D 67
           B for binary numbers
           0101111B


           O or Q for octal numbers
           377O 232Q

           # for immediate addressing
           LDAA #$34

           ,X for indexed addressing
           LDAA 01,X

            Assembly language statements are written one per line. They are machine code programs that consist of sequence of assembly language statements, each of which contains a mnemonic. Each line of an assembly language program is split into four fields, as shown below:

LABEL”  “OPCODE”  “OPERAND”  “COMMENTS"

           The label field is optional. A label is an identifier (or text string symbol). Labels are used extensively in programs to reduce reliance upon programmers remembering where data or code is located. A label can be used to refer to:
  • a memory location 
  • the value of a piece of data 
  • the address of a program, sub-routine, code portion etc.

          The maximum length of a label differs between assemblers. Some accepts up to 32 characters long while others accept only four characters. A label, when declared, is suffixed by a colon, and begins with a valid character (A..Z). Consider the following example.

           START: LDAA #24H

           Here, the label START is equal to the address of the instruction LDAA #24H. The label is used in the program as a reference, eg,
  
           JMP START


         This would result in the processor jumping to the location (address) associated with the label START, thus executing the instruction LDAA #24H immediately after the JMP instruction. When a label is referenced later on in the program, it is done so without the colon suffix.

         An advantage of using labels is that inserting or re-arranging code statements do not necessitate re-working actual machine instructions. A simple re-assembly is all that is required. In hand-coding, such changes can take hours to perform.

         Each instruction consists of an opcode and possible one or more operands. In the instruction:

           JMP START

        - the opcode is JMP and the operand is the address of the label START

        The opcode field contains a mnemonic. Opcode stands for operation code, ie, a machine code instruction. The opcode may also require additional information (operands). This additional information is separated from the opcode by using a space (or tab stop).

         The operand field consists of additional information or data that the opcode requires. In certain types of addressing modes, the operand is used to specify:
  •    constants or labels
  •    immediate data
  •    data contained in another accumulator or register
  •    an address

         Examples of operands are:

  •    TAB ; operand specified by opcode 
  •    LDAA 0100H ; two byte operand
  •    LDAA START ; label operand
  •    LDAA #0FH ; immediate operand

         The comment field is optional and is used by the programmer to explain how the coded program works. Comments are preceded by a semi-colon. The assembler, when generating instructions from the source file, ignores all comments. Consider the following examples:

         ORG 0100H ;H means hexadecimal values
                          ;This program starts at address 0100 hex
         STATUS: DFB 23H ;This byte is identified as STATUS, and is
                                   ;initialized to a value of 23 hex
         CODE: LDAA STATUS ;The label called CODE is identified as a
                                       ;machine code instruction which loads the
                                       ;An accumulator with the contents of the
                                       ;memory location associated with the label
                                       ;STATUS, ie, the value 23
         JMP CODE  ;Jump to the address associated with CODE


          Note that the programmer does not need to worry about bit patterns, hex values, and the addresses of STATUS or CODE. The assembler, when fed the above program, will generate the correct code. The code output from the assembler will be:


                             Memory location          Byte value
                                  0100                             23
                                  0101                             B6
                                  0102                             01
                                  0103                             00
                                  0104                             7E
                                  0105                             01
                                  0106                             01

         Location 0100 holds the value associated with the label STATUS
         Locations 0101 to 0103 perform the LDAA STATUS instruction
         Locations 0104 to 0106 perform the JMP CODE instruction

         The statement ORG 0100H in the above program is not a machine code instruction. It is an instruction to the assembler, which instructs the assembler to generate the code to run at the designated origin address. Instructions to assemblers are called pseudo-ops. These are used for:

  •   reserving memory for data variables, arrays and structures
  •   determining the start address of the program
  •   determining the entry address of the program
  •   initializing variable values

         The assembler does not generate any machine code instructions for pseudo-ops or comments. Assemblers scan the source program generating machine instructions. Sometimes, the assembler reaches a reference to a variable which has not yet been defined. This is referred to as a forward reference problem. The assembler can tackle this problem in a number of ways. It is resolved in a two pass assembler as follows:

         On the first pass, the assembler simply reads the source file, counts up the number of locations that each instruction will take and builds a symbol table in memory which lists all the defined variables cross-referenced to their associated memory address. 

         On the second pass, the assembler substitutes opcodes for the mnemonics and variable names are replaced by the memory locations obtained from the symbol table.

  • What do CS instructors say about Assembly Programming?









  • What can we say about Assembly? 
"Assembly Language is like studying. It takes so much time. There are other programming languages that are easier, faster and more comfortable to use, but we just have to deal with it. We can't settle taking short cuts. "
      Mary Grace R. Lumenario

“Assembly Language is sooooooo tiring… and at the same time mind bugging because of those mnemonics. Several lines of codes in assembly language can just be a single line or even a single built-in function in a certain high level language. I don’t want assembly..:D”
      - Angelo Paolo V. Aruta

  • Sample Hello World
include '%fasminc%/win32ax.inc'

.code

  start:
        invoke  MessageBox,HWND_DESKTOP,"Hello World!","Win32 Assembly",MB_OK
        invoke  ExitProcess,0

.end start


  • References



  • Bloggers
CMSC 124 T-4L
Aruta, Angelo Paolo V.              2007-17678
Lumenario, Mary Grace R.       2007-63926