10_LC3_Assembly

10_LC3_Assembly - LC-3 Assembly Language (Ch7) CMPE12 1...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPE12 Cyrus Bazeghi 1 LC-3 Assembly Language (Ch7)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPE12 Cyrus Bazeghi 2 Has 8 general registers Has a flat 16-bit addressing range Has a 16-bit word size Load variables from memory to register LC-3 Assembly Language LC-3 is a load/store RISC architecture
Background image of page 2
CMPE12 Cyrus Bazeghi 3 LC-3 has 2 basic data types Integer Character Both take 16-bits of space (a word) though a character is only 8-bits in size. One instruction, declaration per line •Comments are anything on a line following “;” Comments may not span lines Syntax of LC-3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPE12 Cyrus Bazeghi 4 Labels Symbolic names that are used to identify memory locations Location for target of a branch or jump Location for a variable for loading and storing Can be 1-20 characters in size LC-3 Syntax
Background image of page 4
CMPE12 Cyrus Bazeghi 5 Directives give information to the assembler. All directives start with „.‟ (period) LC-3 Syntax Directive Description .ORIG Where to start in placing things in memory .FILL Declare a memory location .BLKW Reserve a group of memory locations .STRINGZ Declare a group of characters in memory .END Tells assembly where your program source ends
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPE12 Cyrus Bazeghi 6 .ORIG LC-3 Syntax Tells simulator where to put your code in memory Only one allowed per program PC gets set to this address at start up •Similar to the “main” in “C”
Background image of page 6
CMPE12 Cyrus Bazeghi 7 “C” type varname; “LC - 3” varname .FILL value type is int (integer) char (character) float (floating point) value is required the initial value LC-3 Syntax
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2009 for the course CMPE 12/l taught by Professor Bazeghi during the Fall '09 term at UCSC.

Page1 / 29

10_LC3_Assembly - LC-3 Assembly Language (Ch7) CMPE12 1...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online