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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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. Simple Assembly Language Programs Step 1: Here is a simple routine designed to search a specified region in memory for a target byte. It provides a good example of the use of indexed addressing. The routine also illustrates how to name and save a program to disk for later use. Use the cmd interface to access DEBUG. Then write and execute the following program: Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\SCRATCH>debug
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online