Skip to content Skip to navigation

Connexions

You are here: Home » Content » 2.3 - Lab 2: Introduction to Assembly Language

Navigation

Content Actions

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Rice University OCW

    This module is included inLens: Rice University OpenCourseWare
    By: OpenCourseWare ConsortiumAs a part of collection:"Introduction to the Texas Instruments ez430"

    Click the "Rice University OCW" link to see all content affiliated with them.

  • TI MSP430

    This module is included inLens: Texas Instruments MSP430
    By: Texas Instruments

    Comments:

    "Basic instructions and code for assembly programming."

    Click the "TI MSP430" link to see all content affiliated with them.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

2.3 - Lab 2: Introduction to Assembly Language

Module by: Naren Anand Based on: Lab 3: Introduction to Assembly Language by CJ Ganier

Summary: A lab that introduces a student to assembly language programming.

In this lab you will be asked to write simple assembly statements, follow already written assembly statements, and finally to reproduce the SOS light blinking program from Lab 1 in assembly.

Problem 1

Formulate instructions to do the following things:

  1. Set bit 3 to 1 at the memory address 0xd640 while leave bits 0-2 and 4-16 unaffected.
  2. Jump to the instruction labeled POINT if the carry bit is set.
  3. Shift register R6 right one place while preserving the sign.

Problem 2

Examine this loop:


... more instructions... 	
Mov.w  &I,  R4  
Cmp.w  #0x0000, R4 
JZ    After_loop

Start_loop:
Dec.w   #0x0001, R4	 
JZ  After_loop
BR #Start_loop

After_loop:
...more instructions...
  1. How many times will this loop execute?
  2. Why do we use the BR instruction with a #Start_loop, but with the JZ we use a plain After_loop?
  3. What does the first JZ instruction do? If we did not have this initial Cmp and JZ, what (possibly) inadvertent effect might occur?

Problem 3

Re-write the blinking light program from Lab 1 using assembly code instead. As you may recall, the program must blink "SOS" (which is "... --- ...") and conform to the following Morse Code standards:

  • The ammount of time of a dash is equivalent in length to 3 dots.
  • The ammount of time between parts of a letter is equivalent in length to one dot.
  • The ammount of time between letters is equivalent in length to 3 dots.
  • The ammount of time between words (assume each SOS is a word) is equivalent to 5 dots.

Comments, questions, feedback, criticisms?

Send feedback