Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Programming - Introduction to Microprocessor Systems - Lecture Sli, Lecture notes of Computer Science

These are the Lecture Slides of Introduction to Microprocessor Systems which includes Microprocessor, Organization, Programming, Programming Language Characteristics, High Level Language, Assembly Language, Machine Language, Assembler Functions, Mnemonic etc. Key important points are: Programming, Branches and Loops, Structured Programming, Flowcharts, Stacks, Hardware, Memory Stacks, Stack Management, Embedded System, Nonvolatile Memory

Typology: Lecture notes

2012/2013

Uploaded on 03/23/2013

dhruv
dhruv 🇮🇳

4.3

(12)

203 documents

1 / 14

Toggle sidebar

Related documents


Partial preview of the text

Download Programming - Introduction to Microprocessor Systems - Lecture Sli and more Lecture notes Computer Science in PDF only on Docsity! • ARM7TDMI Programming – LUTs – Branches and Loops • Structured Programming – Flowcharts • Stacks – Hardware versus Memory Stacks – ARM7TDMI Stack Management Topics Docsity.com Look-Up Tables • In an embedded system, the code area is usually in nonvolatile memory (ROM) • Data in the code area will also be placed in ROM – so the data is constant • Look-up tables (LUTs) are used to translate a value from one domain to another when… – There is no convenient mathematical relationship between the two domains – The calculations are too expensive for the application constraints Docsity.com Conditional Branches and Looping • Conditional branches allow program flow to change in response to conditions – Action is based on current state of flags – Prior instruction must be used to set flags • Can use backwards conditional jumps to create a loop that can be terminated - – By a condition – After a predetermined number of iterations – Or a combination of both • Looping examples – Incrementing loops – Decrementing loops Docsity.com Implementing Structured Programming Constructs • Structured programming basics – One entry point, one exit point per subroutine – Based on three basic control structures • Sequence • Selection – If, If/Else, Switch/Case • Repetition – While – Do-While • Flowchart Basics • Programming Exercise Docsity.com Stack Implementation • The stack is a LIFO data structure • What is the stack used for? • Two basic stack operations – PUSH – POP (aka PULL) • Hardware stacks vs. memory stacks – Hardware stack – Memory stack • Stack pointer (SP) • Stack topologies and SP operation Docsity.com PIC16F84 Hardware Stack FIGURE 1-1: PIC16F84A BLOCK DIAGRAM DataBus 8 13, Program Counter EEPROM Data Memory FLASH Program Memory RAM EEPROM 8 Level Stack =p} EEDATA >| Data Memory| 1K x14 ean File Registers a Mer 68x8 Program ‘t Bus 4|"4 EEADR Instruction Register TMRO RAA/TOCKI 8 Power-up , Thnor VO Ports Instruction Oscillator L Decode & K—=> | Start-up Timer contro Power-on RA3:RAO ase me Timing Watchdog =X] Re7:R81 Generation >} Timer b a DX] Reoant OSC2/CLKOUT MCLR — Vbb, Vss OSC1/CLKIN Docsity.com Jump Tables start MOV R0, ??? ; assume index is in R0 ADR R1, jmptbl ; get base address LDR R0, [R1,R0,LSL #2] ; do look-up BX R0 ; branch to target ; task0 ; stub NOP B start ; task1 ; stub NOP B start ; jmptbl DCD task0, task1; ... Docsity.com B Instruction Reference • Syntax – B{<cond>} <target_address> • RTL – if (cond is true) • PC  PC + offset • Flags are not affected 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cond 1 0 1 0 signed_immediate_24 Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved