BME303_lecture11 - 1 BME303 Intro. to Computing 1...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 1 BME303 Intro. to Computing 1 Programming Languages Generally, programming languages describe programs at various levels of detail, where the coarsest classification distinguishes high level languages (e.g., C, C++, Fortran, Pascal, etc.) low level languages which are much closer to the underlying ISA Whatever the level, a program written in that language must be translated to a program in machine language (ML) , i.e., its instructions are in the computers ISA. Problem Language Machine (ISA) Architecture Algorithms Micro-architecture Circuits Devices Human Analytical thinker Programmer Compiler, Assembler Electrons BME303 Intro. to Computing 2 Chapter 7: Assembly Language High-level Language Program Assembly Language Program Machine Language Program Compiler Assembler Programmer Programmer Computer Computer Computer Instead of writing in machine code we can write our programs using a more "friendly programming language: Assembly language (now) C++, MATLAB, LabVIEW (later) System software provides us with software tools to translate programs into machine code: Assembler Compiler 2 BME303 Intro. to Computing 3 Chapter 7: Assembly Language High-level Language Program Assembly Language Program Machine Language Program Compiler Assembler Programmer Programmer Computer Computer Computer Outline: Assembly Language (Instructions) Assembly process Style BME303 Intro. to Computing 4 The Instruction Mnemonics Mnemonic: A system to develop or improve the memory. Better term: Symbolic Name ADD, AND, NOT, LD, LDI, LDR, LEA , ST, STI, STR, BR, TRAP, JMP, JSR/JSSR, RTI Still have a one-to-one correspondence with Machine Language Instructions 3 BME303 Intro. to Computing 5 Weve seen mnemonics already: Address Instruction Comments x30F6 1110 001 111111101 LEA R1 #-3 PC +1 = x30F7 R1 PC +1 3 = x30F4 x30F7 0001 010 001 1 01110 ADD R2 R1 #14 R2 R1 + 14 = x3102 x30F8 0011 010 111111011 ST R2 #-5 PC +1 5 = x30F9 5 = x30F4 M[0x30F4] R2 x30F9 0101 010 010 1 00000 AND R2 R2 #0 R2 AND x0000 = x0000 R2 0 x30FA 0001 010 010 1 00101 ADD R2 R2 #5 R2 R2 + 5 = 5 BME303 Intro. to Computing 6 Instruction Format In the LC-3 assembly language, instead of instructions being 16-bit words, they have the following format: LABEL OPCODE OPERANDS ;COMMENTS The OPCODE and OPERAND parts are mandatory ; the LABEL and COMMENTS parts are optional OPCODE is a symbolic name for the 4-bit opcode of the corresponding LC-3 machine language (ML) instruction OPERANDS are likewise symbolic names 4 BME303 Intro. to Computing 7 Labels and Comments Labels are symbolic names that identify memory locations referred to explicitly in the Assembly Language Program (APL), e.g., the location contains the target of a branch instruction a value that is loaded or stored The optional comments part of the instruction (begins with a leading semi-colon) consists of...
View Full Document

Page1 / 26

BME303_lecture11 - 1 BME303 Intro. to Computing 1...

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