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

  Develop the assembly language version for the arm

COSC 2440 Computer Organization and Architecture Programming Assignment. Develop the assembly language version for the ARM ISA for this code

  Program that prints your full name on the screen

write an assembly language program that prints your full name on the screen

  Prepare an assembly language program

Prepare an assembly language program that prints your full name on the screen. Use .ASCII pseudo-op to store the characters at the top of your program.

  Write a complete well documented assembly language program

Write a complete well documented assembly language program (starts at $C000) that counts the number of 1s in each byte in a list.

  Write a sequence of two instructions

Write a sequence of two instructions that copies the inter in 4-7 from the AL registers into bits 0-3 of the Bl register. The upper 4 bits of AL will be cleared as will the upper 4 bits of BL. (Microsoft Assembly Language)

  Assembly language program to find all prime numbers between

Write a 68000 assembly language program to find all prime numbers between 1 and a specified upper value, inclusive, using the Sieve of Erathosthenes. The specified upper value may be as low as 3 or as high as 1023. Proceed as follows

  Decimal floating point number

What decimal floating point number does this IEEE 754 single precision number represent: 0x47C0_E6B7?

  Write code for an assembly language function

Write code for an assembly language function named rot_left which rotates a given integer (provided in R6 by a value given in R12. The result should be returned in R4.

  Implement the function in arm assembly language

Implement the function in ARM assembly language. Assume all registers and constants are defined as 32-bit(doubleword) values.

  Write a set of assembly codes in uvision

Write a set of assembly codes in uVision that performs the function described below. Begin with the assumption that 10 randomly selected integer numbers (data) are stored at 0x20002000 to 0x20002024 in sequence in the memory region.

  In this project you will build an 8088 assembler the job

in this project you will build an 8088 assembler. the job of your assembler is to turn 8088 assembly code i.e. the

  Write the following marie assembly language equivalent

Write the following MARIE assembly language equivalent of the following machine language instructions

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