1 / 7

ENGR 330: Today’s Class

ENGR 330: Today’s Class. Homework More LC-3 Assembly Language Revisit the Assembler Basic programming constructs Assignment 4. Homework Issues. Programming problems? Tool problems?. Revisit the Assembler.

selma
Download Presentation

ENGR 330: Today’s Class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ENGR 330: Today’s Class • Homework • More LC-3 Assembly Language • Revisit the Assembler • Basic programming constructs • Assignment 4 R. Smith - University of St Thomas - Minnesota

  2. Homework Issues • Programming problems? • Tool problems? R. Smith - University of St Thomas - Minnesota

  3. Revisit the Assembler • Goal: produce a pattern of words to store in RAM, usually including machine instructions • Language has 3 parts • Instructions – 1 word each • Directives that adjust things • .ORIG to set starting address • .BLKW to set aside a block of words • .FILL to fill a word with a specific value • .END to mark the end • Labels – column 1 – stand for RAM addresses R. Smith - University of St Thomas - Minnesota

  4. Two Pass Assembly • Without it, you can’t do forward branches • WHY? • Because the first pass defines ALL RAM address labels • Pass 1 • Counts the number of words being assembled • One per instruction; one per .FILL • .BLKW may use many • Assigns values to RAM address labels • Pass 2 • Really translate the instructions into bit patterns • Convert RAM address labels to numbers as needed R. Smith - University of St Thomas - Minnesota

  5. Basic programming constructs • What to our classic languages provide • Java, C, Ada, Pascal, Basic, Visual Basic, etc. ? • Assignment statements • Arithmetic calculations • Conditional execution (IF statements) • Looping (Do, For, While, Repeat, ...) • We can do any of these, but we construct them out of multiple instructions R. Smith - University of St Thomas - Minnesota

  6. Assignment 4 • Add up a list of numbers • List is prefixed by a count of how many to add • Problem: how do we do a counting loop? • Leading decision vs trailing decision • Boundary conditions and condition codes R. Smith - University of St Thomas - Minnesota

  7. The Programming Process • Identify the details of the problem: what are the inputs, what are the results, what working storage do you need • Write out a list of computer steps to solve the problem – one step = the work of 1 or 2 instructions, no more or less • Translate each step into the actual instructions R. Smith - University of St Thomas - Minnesota

More Related