lec15 - Computer Programming I TA C162 Todays Agenda...

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

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 13/02/07 Today’s Agenda Assembly Language Programming LC-3 Assembly Language Syntax Assembly Directives Programming Examples
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Computer Programming I TA C162 13/02/07 Human-Readable Machine Language Computers like ones and zeros… Humans like symbols… Assembler is a program that turns symbols into machine instructions. ISA-specific: Close correspondence between symbols and instruction set Mnemonics for opcodes Labels for memory locations Additional operations for allocating storage and initializing data ADD R6,R2,R6 ; increment index reg. 0001110010000110
Background image of page 2
3 Computer Programming I TA C162 13/02/07 LC-3 Assembly Language Syntax Each line of a program is one of the following: An instruction An assembler directive (or pseudo-op) A comment Whitespace (between symbols) and case are ignored . Comments (beginning with “;”) are also ignored. An instruction has the following format: LABEL OPCODE OPERANDS ; COMMENTS optional mandatory
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Computer Programming I TA C162 13/02/07 Opcodes and Operands Opcodes Reserved symbols that correspond to LC-3 instructions ex: ADD , AND , LD , LDR , … Operands Registers -- Specified by Rn, where n is the register number Numbers -- Indicated by # (decimal) or x (hex) Label -- Symbolic name of memory location separated by comma
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/14/2010 for the course CS SS ZG653 taught by Professor Shanta during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 14

lec15 - Computer Programming I TA C162 Todays Agenda...

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

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