User Tools

Site Tools


opus:spring2012:bkenne11:asmpart2

asm Keywords

Data Bus

Definition

An internal element that transfers data between computer components, or between computers.

Demonstration

A bus is a way to connect a peripheral device for data transfer. They have evolved from a different card for every peripheral to universal busses to connect many different peripherals through the same bus. These busses can range from a system bus, to attach a cpu, to a universal serial bus to connect anything from a mouse or keyboard to another harddrive.

Few more examples:

  • USB
  • SYSTEM BUS
  • SATA PORT
  • ATA PORT
  • VGA PORT
  • CONSOLE PORT
  • etc…

Address Bus

Definition

An address bus is a computer bus that is used to specify a physical address. When a processor needs to read or write to a memory location it specifies that memory location on the address bus.

Demonstration

Early processors used to you a single wire for each address bit that it sent, meaning a 32 bit address bus used a 32 wire connector. This was soon replaced by cutting the address in half and sending it in two waves, cutting a 32 bit address bus down to a 16 wire strip.

The width of the address bus determines the amount of memory a system can address.

interrupts

Definition

An asynchronous signal that indicates the need to look at a certain event or tell running software to change its execution.

Demonstration

Hardware Interupt:

  • Causes the processor to save its state of execution and begin execution of an interrupt handler.

Software interupt:

  • Implemented as instructions in the instruction set, which cause a context switch to an interrupt handler similar to a hardware interrupt.
  • A signal to the system from an event that has originated in hardware, such as the pressing of a key on the keyboard, a movement of the mouse or a progression in the system clock.

Stack operations

Definition

Stax yo! a stack is a last in, first out data gobbling beast! Also called a LIFO if you must. These work like a stack of papers. The last page you set on the stack is the top page, and you cannot access any of the pages below without first moving/removing the pages above it. They are commonly implemented using a linked list, but can also be implemented by use of an array.

There are three common stack operations, and they are as follows:

  • push - add a node to the top of the list
  • pop - remove the top node from the list
  • peek - display the value of the top node

Demonstration

#include"stack.h"
 
Stack *push(Stack *notes, int val)
{
        Node *stick;
        stick=(Node *)malloc(sizeof(Node));
        stick -> value = val;
 
        if(notes -> top == NULL)
        {
                notes -> top = notes -> bottom = stick;
        }
        else
        {
                notes -> top -> prev = stick;
                stick -> next = notes -> top;
                notes -> top = notes -> top -> prev;
        }
        return notes;
}

Machine Word

Definition

It's a bunch o' bits wrapped up all nice and neat for a computer to read, like an instruction of sorts. The number of bits in a word(size, width, length) is defined by the proccessor design, or the computer architecture. The size of a word reflects the computers operation. Registers are often word sized, and the largest peice of memory that can be moved into working memory is the size of word. Common sizes today are 32 and 64 bit.

Depending on how the computer is structured, units of the word size can be:

  • Integer numbers
  • floating point numbers
  • addresses → holders for memory addresses
  • registers → processor registers
  • memory-processor transfer
  • unit of address resolution
  • instructions → machine instructions

Storage

Definition

Puttin stuff in spots to keep it for a while. The retension of information.

short term

  • Volatile memory
  • Lost when power is yanked from the wall in a TMNA(teenage mutant ninja aliens) rage
  • examples are ram and cpu ram

long-term

  • non-volatile
  • does not rely on power to save information
  • examples are hard drive and cmos

subroutines

Definition

A portion of code running inside a program that has one specific purpose and is relatively independant of the rest of the code to be performed.

A subroutine is also called a subprogram, and as that insinuates, it will act much like a program itself, running inside a larger program. A subroutine is usually code that can be called multiple times from multiple places inside the program.

Subroutines are often collected into libraries, and contain programs such as mathmatical computations.

Fetch-Execute Cycle

Definition

The fetch-execute cycle is the basic operation cycle of a computer. This cycle is repeated by the CPU from startup to when the computer is shut down and is the process by which the computer retreives its instructions from memory.

The cicuits used in a fetch-execute cycle are:

  • Program Counter - an incrementing counter that contains the memory address of the instruction to be used next.
  • Memory Data Register - holds data fetched from memory
  • Contol Unit - decodes the instruction in the instruction register and activates needed resources.
  • Instruction Register - holds the instruction just fetched from memory.
  • Memory Address Register - holds the address of the memory to be written to
  • Arithmetic Logic Unit - Does logical and mathmatical operations

So, to break it down:

  • Fetch the instruction
  • Decode the instruction
  • indirect vs. direct instruction
    • indirect - effective address is read from main memory.
    • direct - do nothing
  • Execute the instruction

asm Objective

asm Objective

familiarity with how assembly impacts programming.

Definition

How assembly will impact the styles and flow of programming. How the code is put together in functions.

Method

General discussion on how assembly affects programming. Matt has expressed that assembly and processor commands can affect programming styles by helping to make code more efficient.

Measurement

The only good way to measure this is to review some code that I recently wrote to see if i can relate my new knowledge of assembly and processor instructions to coding styles.

Analysis

I can see how processor commands can affect programming styles. I can not yet really optimize any code or change the flow based on what the processor does/receives, but I believe that by the end of this course I will be able to optimize my code at least a little by being processor sensitive.

There is deffinitely room for improvement, I think I need to do some research on assembly commands so that I can better understand what the processor is being told because of the code I am writing.

opus/spring2012/bkenne11/asmpart2.txt · Last modified: 2012/03/28 12:54 by bkenne11