Write lock and unlock in assembly language

Assignment Help Assembly Language
Reference no: EM13869487

To make it possible to implement semaphores on a computer with multiple CPUs that share a common memory, computer architects often provide a Test and Set Lock in- struction. TSL X tests the location X. If the contents are zero, they are set to 1 in a sin- gle, indivisible memory cycle, and the next instruction is skipped. If it is nonzero, the TSL acts like a no-op. Using TSL it is possible to write procedures lock and unlock with the following properties. lock(x) checks to see if x is locked. If not, it locks x and re- turns control. If x is already locked, it just waits until it becomes unlocked, then it locks x and returns control. unlock releases an existing lock. If all processes lock the semaphore table before using it, only one process at a time can fiddle with the variables and pointers, thus preventing races. Write lock and unlock in assembly language. (Make any reasonable assumptions you need.)

Reference no: EM13869487

Questions Cloud

Gunpowder corp.''s board of directors approved a : On November 6, 2009, Gunpowder Corp.'s board of directors approved a share option plan for key executives. On January 2, 2010, a specific number of share options were granted.
Will the idea work if three or more processes use semaphore : In this way, programs that feel it is immoral to block can first inspect the semaphore to see if it is safe to do a down. Will this idea work if three or more processes use the semaphore? If two processes use the semaphore?
Identify which boundary is best described by each family : Identify which boundary is best described by each family in the scenario above. Identify which boundary inadequacies are present in each family, if applicable. Explain how each boundary and boundary inadequacy manifests itself
How is a substance use disorder diagnosed : What category of substances do cocaine and amphetamine fall under, and what are the implications of this category on the body? Be sure to give the classification, DEA schedule, and physical effects. How is a substance use disorder diagnosed
Write lock and unlock in assembly language : If all processes lock the semaphore table before using it, only one process at a time can fiddle with the variables and pointers, thus preventing races. Write lock and unlock in assembly language.
What management organization and technology issues : What management, organization, and technology issues were addressed in building Wine.com's Web site?
Which are the two biggest factors in marketing : Which are the two biggest factors in marketing? When an organization competes by providing unique products with features that customers value, perceive as different, and are willing to pay a premium price for, it is using a strategy of
Describe carefully what changes are made in directory system : Suppose that the UNIX system call unlink(¢¢/usr/ast/bin/game3¢¢) were executed in the context. Describe carefully what changes are made in the directory system.
Assignment on brookdale senior living solutions : Brookdale Senior Living Solutions

Reviews

Write a Review

Assembly Language Questions & Answers

  Register address machine

Express the statement X= (A*B)-(C*D)-E in the assembly language of each of 0- memory address machine, 3-register address machine with 3 registers R1,R2,R3, and 2-memory-register-address machine with three registers R1,R2, R3. Your solution should use..

  Create a macro named mwriteint

Create a macro named mWriteInt that writes a signed integer to standard output by calling the WriteInt procedure. The argument passed to the macro can be a byte, word, or double word. Use conditional operators in the macro so it adapts to the size..

  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.

  Modify the single-cycle mips processor

Modify the single-cycle MIPS processor to implement one of the following instructions. Sec Appendix B for a definition of the instructions. Mark up a copy to indicate the changes to the datapath. Name any new control signals.

  Write an assembly language program using the pep8 assembler

Write an assembly language program using the PEP8 assembler (free download) that corresponds to the following C++ program

  Create a short assembly program

You need to create a short assembly program named char_int, stored in file char_int.asm, that prompts the user for a character, and then for an integer.

  Implement a simple 32 bit calculator program

Operand A  and  Operand B  have to be  signed  32 bit integers. So an operand can be a negative number. For example, if you input is (-1 + 3), it should return 2. Operator  must be one of the characters(' + ', ' - ', ' * ', ' / ', ' % ')

  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.

  Prepare an assembly program that reads in a number of cents

prepare an assembly program that reads in a number of cents. the program will write out the number of dollars and cents

  Problem 1 square root for this problem you will write a

problem 1 square root for this problem you will write a short assembly program that computes the integral square root

  Pseudo-code in assembly language

Implement the following pseudo-code in assembly language (assume unsigned numbers). Declare Apple and Pear as byte sized variables.

  What would be the ieee 754 double precision binary

What would be the IEEE 754 double precision binary representation of the floating point value 2.71828×10-13? Express your final answer as a 16-hexdigit number and explain how your answer was obtained for full credit.

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