aLec24_arrays_math

# aLec24_arrays_math - Introduction to Embedded Microcomputer...

This preview shows pages 1–3. Sign up to view the full content.

Introduction to Embedded Microcomputer Systems Lecture 24.1 Jonathan W. Valvano Recap I/O synchronization Interrupts Output compare periodic interrupts Overview Arrays, Table lookup Extended math Proper ways to acknowledge (software makes C3F zero) ldaa #\$08 staa TFLG1 movb #\$08,TFLG1 TFLG1 = 0x08; These attempts have no effect on TFLG1 ldaa #\$00 staa TFLG1 clr TFLG1 TFLG1 = 0; These attempts clear all bits C7F, C6F… C0F in TFLG1 bset TFLG1,#\$08 movb #\$FF,TFLG1 TFLG1 |= 0x08; TFLG1 = 0xFF; Multiply instructions mul unsigned A*B into D emul unsigned D*Y into 32-bit Y:D emuls signed D*RegY into RegY:D Divide instructions idiv unsigned D/X into X, D remainder idivs signed D/X into X, D remainder fdiv unsigned (D:0)/X into X, D remainder ediv unsigned (Y:D)/X into Y, D remainder edivs signed (Y:D)/X into Y, D remainder Example Count (0 to 199) = 9 5 ×Angle(0 to 359) * Count =(5*Angle)/9 ldd Angle ldy #5 emul ;(Y:D)= 5*Angle ldx #9 ediv ;Y=(5*Angle)/9 sty Count Example Angle (0 to 359) = 5 9 ×Count(0 to 199) * Angle =(9*Count)/5 (65536*Count)/36409 ldd Count ldx #36409 fdiv stx Angle

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

View Full Document
Introduction to Embedded Microcomputer Systems Lecture 24.2 Jonathan W. Valvano Example Column (0 to 6) = 7 256 × Xpos (0 to 255)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern