<< Chapter < Page Chapter >> Page >
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.

Formulate instructions to do the following things:

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

Examine this loop: ... more instructions... Mov.w&I, R4 Cmp.w #0x0000, R4JZ After_loop Start_loop:Dec.w #0x0001, R4 JZ After_loopBR #Start_loop After_loop:...more instructions...

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

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.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to the texas instruments ez430. OpenStax CNX. Jun 19, 2006 Download for free at http://cnx.org/content/col10354/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to the texas instruments ez430' conversation and receive update notifications?

Ask