Exercise_10 - Exercise 10 A&EP 264 Spring `07 Assembly...

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

Exercise 10, A&EP 264, Spring ‘07 Assembly Language Read the documents “ Using Assembly Language ” and “ Using DOS interrupts and the ASCII character set ” posted on the blackboard. Boolean Algebra AND (a) Type the following code in DEBUG mov bx,0200 mov al,[bx] and al,[bx+1] mov [bx+2],al int 20 Now use the DEBUG "e" (enter) command to store some hexadecimal numbers at offsets 0200 and 0201. Run the program with the "g" command and examine the results with the "d200" command. Verify by hand, by translating from hexadecimal to binary notation that the AND operation was done correctly. Use starting numbers so that the entire AND truth table is verified. (b) The AND operation may also be used to set particular bits to 0. Try the program with 0xFE in offset 0200. OR (a) Rewrite the program using the OR instruction in place of the AND. Run the program and write out in binary form the resulting byte in offset 0202. Use starting numbers to verify the entire OR truth table. (b) An important use of the OR operation is to set a particular bit to 1. Try the program with 0x01 at offset 0200. XOR Write a program with DEBUG that inverts bit 6 of the data stored at the offset 0201 and leaves the other bits unchanged. Run it and demonstrate this property by displaying and printing out the contents of offset 0201 before and after running with several initial values.
Image of page 1

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

NOT The assembler instruction NOT AL will invert the bits in the AL register. Write a program using DEBUG that inverts the data at offset 0200. Load bytes and examine the results.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern