Giter VIP home page Giter VIP logo

ece281_ce4's Introduction

ECE281_CE4

##PRISM Assembly Language Programming

###So what exactly is "Assembly" anyways? Well, think of Lego blocks: you only have so many different blocks (in this case 16) to work with, but can build an almost unlimited amount of things. Also, because Santa is on a budget, you have to try and fit everything within 256 addresses because, after all, RAM and ROM - er, Legos - ain't cheap.

PRISM (That's Programmable Reconfigurable Informational Simple Microcomputer) is a simulation of a typical digital computer which allows for easy assembly programming. The manual โ€“ provided by USAFA DFEC โ€“ gives more information on how everything works, but basically there is a computer Controller which directs the Datapath, Memory, and Input/Output. Each assembly command takes up one chunk of memory (four bits in PRISM). Certain commands have additional slots for a value or address. It is an extremely simple way of telling the computer precisely what to do.

###Let's step through a problem. This is a screenshot of the programming for the Mathematics problem. The actual .psm file is included with the other programs in the repo.

alt text

Mathematics.psm doubles the value stored in RAM, subtracts 4, and outputs the result to port 2.

  1. Load a -4 into the accumulator. PRISM doesn't accept negative numbers, so instead Address (Addr) loads $C into the accumulator, which is -4 in two's complement.
  2. Add the value stored in RAM slot B0. The label is predefined, as is the value within the RAM.
  3. Add this number again; this is the same as doubling.
  4. Output the final value to port 2
  5. Infinite loop to prevent crashing.

##So What? Why go through all of this trouble in the first place? I mean, there are tons of high level languages out there which could do this with a lot less thinking on the human's part. But what happens once you figure out all of the semicolons in Java? Everything has to run through an assembler which puts it in assembly language. This is then compiled into the lovely 1's and 0's of machine code. As a Computer Engineer, it is important to know about some of the things that run "under the hood." This really ties in everything: registers, the ALU, MUX's, and even logic gates. Plus, I imagine that my friends will think me knowing Assembly is a lot cooler than the cyber guys who get scared to go past the keyboard.

No Documentation outside of general work in class.

ece281_ce4's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.