PIC16F84A Questions

PIC16F84A Questions

Postby alp6 » Thu Nov 17, 2022 8:35 am

Hello everyone, I have couple questions which I couldn't solve. I would be very grateful if anyone could help me with the questions I shared below.

1- Assume X1 and X2 are 24 bit numbers. In your program, for each number allocate 3 bytes in RAM. Define a number for X1 greater than X2. Subtract X2 from X1.

2- Write an assembly program that counts the number of 1s in an 8-bit number, Y1. In your program, define the test value Y1 and hold the number of 1s in a register called RESULT.

3- Write a program that checks whether a number stored in Z1 is even or odd. If Z1 is even set a register R to 1 and otherwise, clear it.

Thanks. :)
alp6
 
Posts: 1
Joined: Thu Nov 17, 2022 8:24 am
PIC experience: EE Student

Re: PIC16F84A Questions

Postby ric » Thu Nov 17, 2022 11:22 pm

This does look a lot like homework.
We won't just do it for you, but if you show what you have attempted, and explain which bit is a problem, we can guide.
Is this all to be in assembly language? Only the second one mentions a language.
If you are writing in assembly language, we need to know which version of MPLAB or MPLABX you are using. The syntax changed a lot when Microchip changed from MPASM to PIC-AS in MPLABX version 5.40
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 643
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products


Return to MPLAB X IDE

Who is online

Users browsing this forum: No registered users and 1 guest