User Tools

Site Tools


opus:spring2012:dgirard3:asmpart3

asm Keywords

Registers (Stack Pointer, Program Counter, Flag/Status)

Definition

Back to the registers we have different special registers that can be used. Data stored in the stack frame may sometimes be accessed directly via the stack pointer register (which indicates the current top of the stack). However, as the stack pointer is variable during the activation of the routine, memory locations within the stack frame are more typically accessed via a separate register which makes relative addressing simpler and also enables dynamic allocation mechanisms.

The next thing is a program counter. It is also called a instruction pointer and it basically points to where the program is currently at. A flag.status can be used to stop an instruction or the program or something. The flag gives the option of other paths within the data.

Registers (Index/Pointer)

Definition

An index register in a computer's CPU is a processor register used for modifying operand addresses during the run of a program, typically for doing vector/array operations. This register is there to keep the process flowing by telling where to go next and keeping all the programs running smoothly.

Clear_accumulator
   Load_index 400,index2  //load 4*array size into index register 2 (index2)
loop_start : Add_word_to_accumulator array_start,index2   //Add to AC the word at the address (array_start + index2)
   Branch_and_decrement_if_index_not_zero loop_start,4,index2   //loop decrementing by 4 until index resister is zero

Instruction Sets (CISC, RISC)

Definition

RISC: Reduced instruction set computing is a CPU design strategy based on the insight that simplified instructions can provide higher performance if this simplicity enables much faster execution of each instruction.

CISC: A complex instruction set computer is a computer where single instructions can execute several low-level operations (such as a load from memory, an arithmetic operation, and a memory store) and/or are capable of multi-step operations or addressing modes within single instructions.

Demonstration

Data Instructions (Data Movement, Address Movement, Data Conversion, Bit Manipulation)

Definition

Data Movement: This is an instruction that moves data from one location to another location. It could be in memory or register.

Address Movement: This is an instruction that moves a given address from one location to another. Same as before the locations here can also be a memory location or registers.

Data Conversion: This is an instruction that changes the data type of the data being dealt with.

Bit Manipulation: This is an instruction that changes individual bits. Setting a bit sets the value to 1and opposite where clearing a bit sets it to 0.

Subroutines (Calling, Return Address)

Definition

A subroutine is a smaller piece of code inside a bigger code, usually remaining independent to itself. It performs a specific task that is been given and the main program needs it, it will call it to use its functionality. Its essentially a function that performs some task outside the main, does what it needs, returns a certain variable with a particular datatype that is needed and go to where it has been called to the main can use it effectively.

here is what a subroutine looks like:

char function3(int number)
 {
     char selection[] = {'S','M','T','W','T','F','S'};
     return selection[number];
 }

Data Representation (Big Endian, Little Endian, Size, Integer, Floating Point, ASCII)

Definition

Data is represented in a number of ways. Big endian is used to show how bits are stored and with this particularly it loads in big end value first. Little endian is very similar its just loads the little value first. so BE (0x1234) and LE is (0x4321). Size is the size of data. Like a bit is the smallest size we have, byte is the size of 8 bits. Integer is easy, its 1 2 3. A floating point is a data type to give to some data. ASCII is the table to show ASCII values in binary, Hex, octal and decimal to the letters and symbols we see.

Demonstration

Data Representation (Sign Representation, One's Complement, Two's Complement)

Definition

Sign representation just encodes negative numbers in to the binary system. One's Complement just flips the bit value in the binary number. Its like a NOT logic being used. Twos complement however does do the same thing but adds a 1 to the numbers after they have been flip. This allows negative numbers to reside with positive numbers.

Demonstration

Linking, Object and Machine Code

Definition

Linking is the act of bringing together all the different objects brought about the compile process. Object code is what is given when we compile the source code that we give to the compiler. Machine code is the lowest level language and is what is read at the pre processing stage, the 1's and 0's

Demonstration

asm Objective

asm Objective

State the course objective

Definition

In your own words, define what that objective entails.

Method

State the method you will use for measuring successful academic/intellectual achievement of this objective.

Measurement

Follow your method and obtain a measurement. Document the results here.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do?
  • Is there room for improvement?
  • Could the measurement process be enhanced to be more effective?
  • Do you think this enhancement would be efficient to employ?
  • Could the course objective be altered to be more applicable? How would you alter it?
opus/spring2012/dgirard3/asmpart3.txt · Last modified: 2012/05/10 02:41 by dgirard3