1 / 6

Quiz 4 .1

Quiz 4 .1. Four LEDs are attached to Port 4, bits 0 thru 3. Indicate which LEDs are ON/OFF/Undefined after each instruction to the left is executed. P4.3. P4.2. P4.1. P4.0. mov.b #0x0f,& P4DIR and.b #0xf0,& P4OUT bis.b # 0x09,& P4OUT xor.b # 0x0f,& P4OUT bic.b # 0x06,& P4OUT

hannah-peck
Download Presentation

Quiz 4 .1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Quiz 4.1 Four LEDs are attached to Port 4, bits 0 thru 3. Indicate which LEDs are ON/OFF/Undefined after each instruction to the left is executed. P4.3 P4.2 P4.1 P4.0 • mov.b #0x0f,&P4DIR • and.b #0xf0,&P4OUT • bis.b #0x09,&P4OUT • xor.b #0x0f,&P4OUT • bic.b #0x06,&P4OUT • add.b #0x03,&P4OUT

  2. Quiz 4.2 • Given a 1.2 MHz processor, what value for DELAY would result in a 1/4 second delay? ? DELAY .equ mov.w #DELAY,r12 ; 2 cycles delay1: mov.w #1000,r15 ; 2 cycles delay2: sub.w #1,r15 ; 1 cycle jne delay2 ; 2 cycles sub.w #1,r12 ; 1 cycle jne delay1 ; 2 cycles

  3. Quiz 4.3 • ALU • Clocks • Control • I/O • Memory • Peripherals • Registers • Address space • Execution speed • External devices • Fast memory • Finite State Machine • Memory mapped • Word length • Match the following terms:

  4. Quiz 4.4 • add.w tab(r10),r9 • and.w &mask,r12 • bis.b #0x08,r6 • mov.b cnt,r11 • mov.w r4,r5 • mov.w #100,r14 • sub.w @r4+,r5 • xor.b @r8,r15 • Absolute • Constant • Immediate • Indexed register • Indirect auto-increment • Indirect register • Register • Symbolic • Match the following source operand modes:

  5. Quiz 4.5 Present the destination operand of the following instruction to the ALU: add.w r4,cnt ; M[cnt] += r4 Memory CPU PC PC PC PC ADDER Registers IR 0x5480 PC 0x5480 0x0218 R4 cnt ALU

  6. Quiz 4.6 Show how to retrieve a PC-relative destination operand from memory and present to the ALU:

More Related