Create a program that functions as simple boolean calculator

Assignment Help Assembly Language
Reference no: EM132222134

Simple Addition (1)
Write a program that clears the screen, locates the cursor near the middle of the screen, prompts the user for two integers, adds the integers, and displays their sum.

Simple Addition (2)
Use the solution program from the preceding exercise as a starting point. Let this new program repeat the same steps three times, using a loop. Clear the screen after each loop iteration

Filling an Array
Create a procedure that fills an array of doublewords with N random integers, making sure the values fall within the range j...k, inclusive. When calling the procedure, pass a pointer to the array that will hold the data, pass N, and pass the values of j and k. Preserve all register values between calls to the procedure. Write a test program that calls the procedure twice, using different values for j and k. Verify your results using a debugger.

College Registration
Using the College Registration example below as a starting point, do the following:

.data
TRUE = 1
FALSE = 0
gradeAverage WORD 275 ; test value
credits WORD 12 ; test value
OkToRegister BYTE   ?
.code
     mov okToRegister,FALsE
        .IF gradeAverage > 350
            mov OkToRegister, TRUE
        .ELSEIF (gradeAverage > 250) && (credits <= 16)
             mov OkToRegister, TRUE

        .ELSEIF (credits c= 12)
              mov okToRegister,TRuE

        . ENDIF

– Recode the logic using CMP and conditional jump instructions (instead of the .IF and .ELSEIF directives).
– Perform range checking on the credits value; it cannot be less than 1 or greater than 30. If an invalid entry is discovered, display an appropriate error message.
– Prompt the user for the grade average and credits values.
– Display a message that shows the outcome of the evaluation, such as "The student can register" or "The student cannot register". (The Irvine32 library is required for this solution program.)

Boolean Calculator (1)

Create a program that functions as a simple boolean calculator for 32-bit integers. It should display a menu that asks the user to make a selection from the following list:
1.x AND y
2.x OR y
3.NOT x
4.x XOR y
5.Exit program
When the user makes a choice, call a procedure that displays the name of the operation about to be performed. You must implement this procedure using the Table-Driven Selection technique, shown in Section 6.5.4. (below)
.data
CaseTable BYTE 'A' ; lookup value
DWORD Process_A; address of procedure
BYTE 'B'
DWORD Process_B
(etc.)
(You will implement the operations in Exercise 6.) (The Irvine32 library is required for this solution program.)

Boolean Calculator
Continue the solution program from Boolean Calculator (1) by implementing the following procedures:
– AND_op: Prompt the user for two hexadecimal integers. AND them together and display the result in hexadecimal.
– OR_op: Prompt the user for two hexadecimal integers. OR them together and display the result in hexadecimal.
– NOT_op: Prompt the user for a hexadecimal integer. NOT the integer and display the result in hexadecimal.
– XOR_op: Prompt the user for two hexadecimal integers. Exclusive-OR them together and display the result in hexadecimal. (The Irvine32 library is required for this solution program.)

Encryption Using Rotate Operations
Write a procedure that performs simple encryption by rotating each plaintext byte a varying number of positions in different directions. For example, in the following array that represents the encryption key, a negative value indicates a rotation to the left and a positive value indicates a rotation to the right. The integer in each position indicates the magnitude of the rotation:

key BYTE -2, 4, 1, 0, -3, 5, 2, -4, -4, 6

Your procedure should loop through a plaintext message and align the key to the first 10 bytes of the message. Rotate each plaintext byte by the amount indicated by its matching key array value. Then, align the key to the next 10 bytes of the message and repeat the process. Write a program that tests your encryption procedure by calling it twice, with different data sets.

Prime Numbers
Write a program that generates all prime numbers between 2 and 1000, using the Sieve of Eratosthenes method. You can find many articles that describe the method for finding primes in this manner on the Internet. Display all the prime values.

Bitwise Multiplication
Write a procedure named BitwiseMultiply that multiplies any unsigned 32-bit integer by EAX, using only shifting and addition. Pass the integer to the procedure in the EBX register, and return the product in the EAX register. Write a short test program that calls the procedure and displays the product. (We will assume that the product is never larger than 32 bits.) This is a fairly challenging program to write. One possible approach is to use a loop to shift the multiplier to the right, keeping track of the number of shifts that occur before the Carry ?ag is set. The resulting shift count can then be applied to the SHL instruction, using the multiplicand as the destination operand. Then, the same process must be repeated until you find the last 1 bit in the multiplier.

FindLargest Procedure
Create a procedure named FindLargest that receives two parameters: a pointer to a signed doubleword array, and a count of the array's length. The procedure must return the value of the largest array member in EAX. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. Write a test program that calls FindLargest and passes three different arrays of different lengths. Be sure to include negative values in your arrays. Create a PROTO declaration for FindLargest.

Chess Board
Write a program that draws an 8 8 chess board, with alternating gray and white squares. You can use the SetTextColor and Gotoxy procedures from the Irvine32 library. Avoid the use of global variables, and use declared parameters in all procedures. Use short procedures that are focused on a single task

FindThrees Procedure
Create a procedure named FindThrees that returns 1 if an array has three consecutive values of 3 somewhere in the array. Otherwise, return 0. The procedure's input parameter list contains a pointer to the array and the array's size. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. Write a test program that calls FindThrees several times with different arrays.

Note: Must be completed in the Microsoft environment. Only need to submit the ASM file.

Reference no: EM132222134

Questions Cloud

Idea of corporate social responsibility : Compare and contrast "stakeholder theory" with the idea of "corporate social responsibility." What are some similarities? Differences?
Configure IoT Device to Registration Server for Smart Office : ITC560 Internet of Thing - Charles sturt university - Packet Tracer - Connect and Configure IoT Devices to a Registration Server for a Smart Office
Locate example of innovative compensation : Locate an example of an innovative compensation or benefits program from within or outside the health care industry.
Write improved mission statement for the company : Identify the company’s existing vision, mission, objectives and strategies. Write an improved mission statement for the company
Create a program that functions as simple boolean calculator : Write a program that clears the screen, locates the cursor near the middle of the screen, prompts the user for two integers, adds the integers, and displays
Description of the rifle industry in birmingham : Read the following description of the rifle industry in Birmingham, England during the early part of the 20th century.
Different people-societies are different-possibly conflict : Moral relativism states that basic ethical beliefs of different people and societies are different and possibly conflict.
Customer relationship management system : Evaluate how Apple can gain business intelligence through the implementation of a customer relationship management system.
Required to create survey that their potential employees : Students are required to create a survey that their potential employees might be asked to complete which would evaluate their management performance.

Reviews

Write a Review

Assembly Language Questions & Answers

  Determine how many of the values in the locations

Determine how many of the values in the locations with addresses $2000 to $2009 are less than $50, how many are equal to $50 and how many are greater than $50.

  Write assembly language program that write out two strings

Write an Assembly Language program that will write out two strings. The first string will be defined in the data segment.

  Write a complete well documented assembly language

write a complete well documented assembly language program (starts at $C000) that counts the number of 1s in each byte in a list. The LIST_IN starts at $C100 and it has 12 bytes ( create your own random bytes for the list). The results (count of 1s) ..

  Prepare a assembly program of given code

Please submit assembly program-This program is supposed to set R0 = 1 if there a 5 in one of ten memory locations, starting at x3100. Else it should set R0 to 0

  What is difference between instruction and pseudoinstruction

What is the difference between an instruction and a pseudoinstruction? What is the difference between the instruction location counter and the program counter, if any?

  Program [hcs12 assembly language] to compute the average

Write a program [HCS12 assembly language] to compute the average of an array of N 8-bit numbers and store the result at $1000

  Program that requests n as input

Write a program that requests N as input and computes the left-hand and the right-hand sides of the equation, verifies that they are equal, and displays the result.

  Multiply by using shift and add instructionsyou have

multiply by using shift and add instructionsyou have studied shift and rotate instructions. when a number is shifted

  Problems does an assembler have to overcome

What problems does an assembler have to overcome in order to produce complete binary code with only one pass over the source code? How would code written for a one-pass assembler be different from code written for a two-pass assembler?

  Write a function that accepts a char array

Write a function that accepts a char array, its size and a char to search for in the given array. Use PROTO, INVOKE and LOCAL keywords - Find four different ways to reset eax other than "mov eax, 0"

  Convert an integer decimal number to a binary number

You can convert an integer decimal number to a binary number by a recurrsive algorithm. Binary(X) Simple cases: If X is 0, the binary of X is 0. If X is 1, the binary of X is 1.

  Writing monorail emulator in assembly programming language

COMP2121 Project: A Monorail Emulator. You will be writing a monorail emulator in AVR assembly programming language running on the AVR board

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd