4.6 Subroutines4 Schedule4.4 Flow of Control4.5 Bit fields, rotate instructions, and shift instructions

4.5 Bit fields, rotate instructions, and shift instructions

 

4.5.1 Reading and Web Sites

  1. Bit numbering. See Figure 3-4 page 3-10 Vol. 1
  2. Bit numbering. See Figure 3-7 page 3-13 Vol. 1
  3. Instructions rcl, rcr, rol & ror Read IA-32 Volume 2b [5]
  4. Instructions sal, sar, shl & shr Read IA-32 Volume 2b [5]
  5. Bit instructions: bt, btc, btr & bts Read IA-32 Volume 2a [4]
  6. For the lab take a look at Moris Code or the Radiotelegraph Code.

4.5.2 Notes

4.5.3 Lab Assignment, Bit fields

 

In this lab you will decode some numbers and print the results. The numbers represent a coded Moris Code. Moris Code, the 8086/Pentium instruction set, the code used in this lab, and data compression techniques use variable length codes.

  1. Print your name, the date, and the lab's number & name.
  2. Input a number. AND off the low 8 bits. If the number is zero exit.
  3. If the sign bit is a zero (0), print a "_".
  4. If the sign bit is a one (1), print a ".".
  5. Left shift the number one bit. If only the sign bit is set print out a new line character and exit. Otherwise branch back to step three (3).

Test your program with the following numbers:

  1. 0 (Should exit)
  2. 256 (Should exit)
  3. 255 (7 dots)
  4. 64 (_) - A letter
  5. 160
  6. 120
  7. 192
  8. 176
  9. 196
  10. 252
  11. 4

Turn in a printed error free listing and the output of your program for all of the requested tests. If the Moris Code doesn't contain something related to the class, one of us did something wrong!


Instructor: Louis Taber, ltaber at uml dot lt dot Tucson dot AZ dot us (520) 206-6850
My new web Home site in Cleveland, OH
The Pima Community College web site

4.6 Subroutines4 Schedule4.4 Flow of Control4.5 Bit fields, rotate instructions, and shift instructions