News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Assembly Language Problems. Need Help!

Started by ray_stacruz, October 16, 2005, 06:50:17 PM

Previous topic - Next topic

ray_stacruz

Dear Friends and Programmers,

  Hi! I am Ray of Philippines. I am a beginner user an Assembl language (MASM and Debug of Windows). I have an assignment and I need to have codes for these problems. Can you help me?

  Here are the problems:

1. Write an assembly language program that will clear the contents of the block of memory. The starting address of the block has an offset of ALPHA and the ending address of the block has an offset of OMEGA. These addresses have random contents. Clearing these location means that all the memory locations should become zero.

2. Write an assembly language program that will clear 100 memory lcoations starting at offset ALPHA.

3. Write an assembly language program that will move the contents of memory block1(C100H to C120H) to memory block2(C150 to C170H). This means that the contents of C100H will move to location C150H and overwrite them and so on. After executing the program. The contents of twp blocks should be the same.

4. Write an assembly langauge program that checks if ASCII "A" (41H) exist in a list. The list is stored in memory starting at memory location ALPHA. The list is terminated with a sentinel number FFH(note that the sentinel number is not part of the list). If ASCII "A" is not found in the list, then initialize memory location STAT with 00H, else initialize it with FFH.

5. Write an assembly language program that checks if all 100 elements in the list are ASCII "A" (41H). The list is stored at memory location ALPHA. If all 100 elements in the list are ASCII "A", then initialize memory location STAT with 0H, else initialize it with FFH.

6. Write an assembly language program that counts the number of odd and even numbers in a list that is stored in memory starting at memory location ALPHA. The list is terminated with a sentinel number FFH(note that the sentinel number is not part of the list). Place the odd number count in memory location ODD and the even number count in memory location EVEN. Assume that there is a possibility of an empty list.

7. Write an assembly language program that counts the number of positive and negative numbers in the list. The list contains byte size signed numbers and is stored at memory location ALPHA. The list is terminated with a sentinel number FFH(note that the sentinel number is not part of the list). Place the postive number count in memory location POS and the negative number count in memory location NEGA.

8. Write an assembly langauge instruction that gets the highest and the lowest numbers in a list. The list contains byte-size signed numbers and is stored at memory location ALPHA. The list is terminated with a sentinel number FFH(note that the sentinel number is not part of the list). Place the highest number in memory location HIGH and the lowest number in memory location LOW. Assume that there is at least one element is the list.

9. Write an assembly language program that adds the elements in a list. The list contains byte-sized signed numbers and is stored at memory location ALPHA. The number of elements in the list is stored at byte memory location COUNT. Place the result in memory location SUM. Assume that there is at least one element in the list.

10. Write an assembly language program that reads a byte from memory location INPUT. The program should then examine this byte to determine which bit is a logic 1. If the first bit (b0) is a logic 1, then the program should load 01H to memory location OUTPUT. If the second bit (b1) is logic 1, then the program should load 02H to memory location OUTPUT. And so on and so forth. If the byte is equal to 00H(there is no bit equal to logic 1), then the program should terminate. ASsume that only one of the bits (b0 to b7) can be equal to 1.

11. Write an assembly language program that adds two 32-bit numbers and stores the result in memory location GAMMA. The first 32-bit number is located at memory location ALPHA, while the second 32-bit number is located at memory location BETA.

ALPHA: 78H    BETA: 11H    GAMMA: 89H

12. Write an assembly language program that adds two 64-bit numbers and stores the result at memory location GAMMA. The first 64-bit number is located at memory location ALPHA, while the second 64-bit number is located at memory location BETA.

Hope you can help me with these problem. Can I also get an explanation why does the codes is like that.

Thank you and God bless.

RAY

hutch--

Ray,

Welcome on board. A couple of things, do not multiple post in this forum, I have deleted the duplicate post in the workshop but please do not do it again.

Wha you have posted so far is a list of your school assignments which no-one will do for you so asking for code is no purpose here and we have a "No Homework" rule to prevent it. If you are willing to start learning assembler programming members in here will help you if they can but you must do your own work.

Let us know if you are learning 16 bit or 32 bit assembler and your post will be moved to te right subforum.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php