Computer Systems Class Notes 2012/03/26


Mon Mar 26 11:04:47 CDT 2012

IT_Keyboard
Lines 1
Coum 8
And last option: 6

Not on exam:
*Direct memory access controller.
*LCD information

Important:
* Sect 4.3 Write Subroutine which parameters are passed via registers, memory, and stack.

* Address passing: diff between passing a value -vs- and address.
Difference between passing data and addresses (4-3-4).
* Sect 4-2: What happens when we use subroutine instructions when bsr/jsr/rts are executed.
* Never jump out of a subroutine using branch instructions.
* Implement the following C-code in assembly:
// (from Chapter 3):
while( m < n ) {
k = k+1;
if(k > 5){
m=k^2;
}else{
m=n/4;
}
// assume m,n,k are unsigned.
// assume all fit in 8-bits.
while:
ldaa m
cmpa n
bhs done
inc k ;k=k+1
ldaa k
cmpa #5
bhi k-gt_5
ldaa n
lsra
lsra
staa m
bra while

k-gt_5:
tab
mul
stab m
bra while

done:


** Write a program to compute the following functions:

var1 = minimum(4l,5)
var2 = maximum(4l,10)
where 0 <= l <= 15

ldaa l
lsla
lsla ;a = 4l
cmpa #5
blt min_4l
movb #5,var1
bra next


min_4l:
staa var1

next:
suba #3 ;4l-3
cmpa #10
bgt max_4l-3
movb #10,var2

max_4l-3:
staa var2

done:


** Important things to know from Section M5:
* Name ports and the modules to which they are connected.
* 8 IO Ports (Pg 4,5 on M5 doc)
* (5-1) What happens if you read an output port?
- Whatever you are outputting, you'll get back as input.
* (5-3) Write a polling loop to... i.e. checking a specific bit, etc.
* (5-4) Interrupts:
- Name N types of interrupts:, i.e. int/ext/timer (Pg 14 on doc).
- (Which of the following are valid interrupts?)
* (5-1/3?) Set up ports as inputs or outputs.
- DDR will be given?
- Just do a bset or movb with a mask %00001111.
* (5-4-7) Example where an interrupt was generated whenever a car passed by and we updated the count.
- Write an ISR.
* (5-4-3) Interrupt vector table. ( **Pg 23!!!! )
* (5-4-4)
* (5-4-2) Interrupt sequence. What happens when an interrupt occurs? (Pg 19)
* (5-4-1) How to enable and disable interrupts.
-cli (clear interrupt)
-sei (set interrupt)
* (5-4-8) What does WAI do? Why use it?
* (5-4-8) Software interrupt instructions?
- What is the 'swi' typically used for? (Pg 32)
* (6-1) Timers:
- When is the Timer Over Flow (TOF) set?
- How to clear the TOF?
- How to compute the delay or # of TOF
- What's the difference between using the TOF for polling and interrupting. (Slide M6, Pg 6)
- Blah...

* Remember shifting and rotating, etc.

(6-1-7) Is the last slide we need to know.

Comments

Popular posts from this blog

Using Audacity as an Oscilloscope

Using Google Command Line Tools to post my Computer Systems Notes

Store Script Passwords Securely in Mac OS X