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

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division 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