Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Assembly Language Instruction Details Here, we provide more detailed descriptions and examples of a few of the assembly language instructions to help you better

Problem Assembly Language Instruction Details

Here, we provide more detailed descriptions and examples of a few of the assembly language instructions to help you better understand the terminology and the naming conventions.

For example, BCF PORTB, 1 makes bit 1 in PORTB go low (where PORTB is a constant containing the address of the PORTB file register). If PORTB contained the hexadecimal (hex) value FF (binary 11111111) originally, the final value would be hex FC (binary 11111101). If PORTB contained the hex value A8 (binary 10101000) originally, the value would remain unchanged.

MOVLW k

(Read MOVLW as move literal to W)

Stores the literal constant k in the accumulator (the W register)

For example, MOVLW 0xA8 would store the hex value A8 in the W register. In assembly language, hexadecimal constants are identified with the 0x prefix

RLF f, d

(Read RLF as rotate f left)

shifts the bits in file register f to the left 1 bit, and stores the result in f if d is 1 or in the accumulator (the W register) if d is 0. The value of the LSB will become 0, and the original value of the MSB is lost.

For example, if the current value in PORTB is hex 1F (binary 00011111), then RLF PORTB, 1 would change the value to hex 3E (binary 00111110)

SWAPF f, d

(read SWAPF as swap nibbles in f )

exchanges the upper and lower nibbles (a nibble is 4 bits or half a byte)

of file register f and stores the result in f if d is 1

or in the accumulator (the W register) if d is 0

For example, if the memory location at address hex 10 contains the value hex AB, then SWAPF 0x10, 0 would store the value hex BA in the W register. SWAPF 0x10, 1 would change the value at address hex 10 from hex AB to hex BA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Usability

Authors: Jakob Nielsen, Raluca Budiu

1st Edition

0133122131, 9780133122138

More Books

Students also viewed these Programming questions