QUESTIONS AND PROBLEMS ON PROGRAMMING THE MICROPROCESSOR.

QUESTIONS AND PROBLEMS

1. The assembler converts a source file to a(n) file.

2. What files are generated from the source file TEST.ASM if it is processed by ML.EXE?

3. The linker program links object files and files to create an execution file.

4. What does the PUBLIC directive indicate when placed in a program module?

5. What does the EXTRN directive indicate when placed in a program module?

6. What directive appears with labels defined as external?

7. Describe how a library file works when it is linked to other object files by the linker program.

8. What assembler language directives delineate a macro sequence?

9. What is a macro sequence?

10. How are parameters transferred to a macro sequence?

11. Develop a macro called ADD32 that adds the 32-bit contents of DX-CX to the 32-bit con- tents of BX-AX.

12. How is the LOCAL directive used within a macro sequence?

13. Develop a macro called ADDLIST PARA1,PARA2 that adds the contents of PARA1 to PARA2. Each of these parameters represents an area of memory. The number of bytes added are indicated by register CX before the macro is invoked.

14. Develop a macro that sums a list of byte-sized data invoked by the macro ADDM LIST,LENGTH. The label LIST is the starting address of the data block and LENGTH is the number of data added. The result must be a 16-bit sum found in AX at the end of the macro sequence.

15. What is the purpose of the INCLUDE directive?

16. Modify the function in Example 8–12 so that it filters the numbers 0 through 9 from only the keyboard and not the keypad and ignores all other characters.

17. Modify the function in Example 8–12 so that it generates a random 8-bit number in class variable char Random. (Hint: To accomplish this, increment Random each time that the KeyDown function is called.)

18. Modify the software you developed in question 17 so that it generates a random number between 9 and 62.

19. Modify the function listed in Example 8–15 so that the hexadecimal numbers use lowercase letters a through f instead of the uppercase letters.

20. Modify Example 8–16 so it will shift/rotate left or right. This is accomplished by adding a pair of radio buttons to select the direction.

21. What event handlers are used to access the mouse in the Visual C++ programming environ- ment and what event causes each handler to be called?

22. How is the right mouse button detected in a program?

23. How is a double-click detected with the mouse?

24. Develop software that detects when both the right and left mouse buttons are pressed simultaneously.

25. How is a color selected in a program using Visual C++?

26. What is the purpose of the ForeColor property?

27. When a number is converted from binary to BCD, the instruction accomplishes the conversion, provided the number is less than 100 decimal.

28. How is a large number (over 100 decimal) converted from binary to BCD?

29. How could a binary number be displayed as an octal number?

30. A BCD digit is converted to ASCII code by adding a(n) .

31. An ASCII-coded number is converted to BCD by subtracting .

32. Develop a function that reads an ASCII number from a textbox control as keys are typed (use KeyDown) on the keyboard and returns it as an unsigned int. The number in the textbox is an octal number that is converted to binary by the function.

33. Explain how a three-digit ASCII-coded number is converted to binary.

34. Develop a function that converts all lowercase ASCII-coded letters into uppercase ASCII- coded letters. Your procedure may not change any other character except the letters a–z and must return the converted character as a char.

35. Develop a lookup table that converts hexadecimal data 00H–0FH into the ASCII-coded characters that represent the hexadecimal digits. Make sure to show the lookup table and any software required for the conversion. It is suggested that a function is created to perform the conversion.

36. Explain the purpose of a boot sector, FAT, and root directory in the FAT system.

37. Explain the purpose of the MFT in the NTFS file system.

38. The surface of a disk is divided into tracks that are further subdivided into .

39. What is a bootstrap loader and where is it found?

40. What is a cluster?

41. The NTFS file system often uses cluster of bytes in length.

42. What is the maximum length of a file?

43. What code is used to store the name of a file when long file names are in use?

44. DOS file names are at most characters in length.

45. How many characters normally appear in an extension?

46. How many characters may appear in a long file name?

47. Develop a program that opens a file called TEST.LST, reads 512 bytes from the file into memory area Array, and closes the file.

48. Show how to rename file TEST.LST to TEST.LIS.

49. What is the purpose of the File Move member function?

50. What is a control?

51. Write a program that reads any decimal number between 0 and 2G and displays the 32-bit binary version on the video display.

52. Write a program that displays the binary powers of 2 (in decimal) on the video screen for the powers 0 through 7. Your display shows 2n = value for each power of 2.

53. Using a timer to generate a random number, develop a program that displays random num- bers between 1 and 47 (or whatever) for your state’s lottery.

54. Modify the program in Example 8–28 so it also displays the letters A, b, C, d, E, and F for a hexadecimal seven-segment display.

55. Modify Example 8–42 to encrypt the message using an algorithm of your own design.

56. Develop a Decryption function (for a String) to accompany the encryption of question 55.

Leave a comment

Your email address will not be published. Required fields are marked *