40 2 code segment writinga write an assembly code segment

Assignment Help Electrical Engineering
Reference no: EM13358270

(40) 2. Code Segment Writing.

a) Write an assembly code segment that calls the subroutine New Function if bits 5 and 6 of PORTD equal 1.  

b) Write the same code segment in part (a) using structured assembly constructs.  

c) Write an assembly code segment to toggle bit 4 of FORMBYTE, leaving the remaining bits unchanged.

d) Write an assembly code segment to form from the value of the char variable TEMPB a new value of  TEMPB of the form 000øbbbl2 where bbbb represents the original four most significant bits of TEMPB.  

e) Assume that WREG contains a number of the form 00000b2b1b0. Using a sequence of the three  instruction- xorwf, andlw, xorwf -‚ update the lower three bits of PORTB with the b2bb0 bits in WREG,  while leaving, the upper five bits of PORTB unchanged.   

 (20) 3. LCD Control and Display.

a) What is the cursor-position code, expressed as a hex number, that you would employ in a display string to center a two-character message in the top row of your 8x2 character display?

b) Write a code segment that displays the two character message "Hi" starting at the position you identified in part (a). Assume that the character string is residing in program memory and that the PIC microcontroller is initialized for a 4-bit interface LCD. (Accurate code is not required, rather, identify the required instruction steps.

(20) 4. a) Analyze the following assembly code segment:

MOVLF 60,COUNT

REPEAT_

btg PORTA,RA4

decf COUINT, F

UNTIL _.Z.  

b) Assuring that the internal clock rate of the microcontroller is 2.5MHz. What should the Bignum value for the LoopTime subroutine be to make it count with a scale of 2,500 cyclesto generate precisely a imillisecond delay between every rollover of TMROIF?

Reference no: EM13358270

Questions Cloud

Question 1 of 2 exchange ratesintroductionsuppose the us : question 1 of 2 exchange ratesintroductionsuppose the u.s. federal government adopts the policy of whats good for
Information system design and trainingi am taking the role : information system design and trainingi am taking the role of the assistant cio for a company. the company ceo does not
Important information about too much informationresponse : important information about too much informationresponse for both these questions relative to the role of a
Important information about right to privacywhat are the : important information about right to privacywhat are the limits to an employees right to privacy at work in regards to
40 2 code segment writinga write an assembly code segment : 40 2. code segment writing.a write an assembly code segment that calls the subroutine new function if bits 5 and 6 of
Computer security softwareby using computer security : computer security softwareby using computer security software and hacker tools to protect company systems employees
Important information about new economyyou have been asked : important information about new economyyou have been asked to visit a local company to talk to an information systems
Question about enterprise resource planning erp : question about enterprise resource planning erp systemsexplained four advantages of erp within an organization. provide
Important information about workflow database technologyhow : important information about workflow database technologyhow woulddoes a healthcare radiology organization utilize

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Why the digital multimeter should have infinite resistance

Suppose we have a circuit in which a current source of 5 amperes is connected to 3 resistances in parallel.If you need to calculate voltage difference across current source EXPLAIN USING KCL why is that the digital multimeter should have infinite ..

  Write the code and test bench for a 4 bit shift register

Using verilog, write the code and test bench for a 4 bit shift register where if L=1 the register is loaded with R. When L goes low the contents of the registers are shifted towards the right and the MSB of the register is loaded with W.

  What is the maximum distance allowed in kilometers

You are repairing a guided transmission system made up oftransmitter module, coaxial link and a receiver. The receiver'serror rate has jumped dramatically recently after an electrical storm when several repairs were made to the system.

  How fast can a telephone channel carry data

Telephone channels have a bandwidth of about 3.1khz. do the following in excel. A) If a telephone channel signal to noise ratio is 1000, how fast can a telephone channel carry data?

  At what rate is thermal energy generated in that loop

If 50.0 cm of copper wire (diameter 1.00 mm) is formed into a single circular loop and placed perpendicular to the uniform magnetic field that is increasing at a constant rate of 10.0 mT/s, at what rate is thermal energy generated in that loop.

  Find the temperature of the hot filament

A certain lightbulb has a tungsten filament with a resistance of 21.9  when at 20.0°C and 145 when hot. Assume the resistivity of tungsten varies linearly with temperature even over the large temperature range involved here.

  Calculate the power in each resistor

If R2 = 2R1, R3 = 3R1 and the total power taken by the circuit is 480 watts. Calculate the power in each resistor

  Write a program that asks the user to enter the numbers

Write a program that asks the user to enter the numbers from 1 to 16 (in any order) and then display the numbers in a 4 by 4 arrangement, followed by the sums of rows, columns and diagonals.

  What is the range of no-load voltage vt as r adj

The magnetization graph taken at 1800 rpm of a 6 kW, 120 V, 50 A, 1800 rpm, dc generator is attached below. Field resistance is 20 ohms and armature resistance is .18 ohms. Find: As a seperately excited generator

  Determine the z0 of the line and the phase velocity

The input impedance of a 31cm long lossless transmission line of unknown characteristic impedance was measured at 1 MHz. With the line terminated in a short circuit, the measurement yielded an input impedance equivalent

  Design synchronous sequential ckt by flip flop excitation

Design a synchronous sequential circuit with one input line and one output line that recognizes the input string x = 1111. The circuit is also required to recognize overlapping sequence such that if the input string is x = 1101111111010

  Which design of counter allows the user to set the pwm value

Using counters and state machines, use one slide switch to either read the switches that would set the duty cycle (count up to value) or cause the PWM to be running. If the slide switch is a ‘0' then the design allows the user to set the PWM valu..

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