Question: 1. Write a program that add 0x13 for 100 times by itself and store it in 0x30 and 0x31 of the file register: 2. Write
1. Write a program that add 0x13 for 100 times by itself and store it in 0x30 and 0x31 of the file register:
2. Write a program that search through the following 20 hex numbers and store the smallest number at address 0x30 and largest number at address 0x31 and compute the Range (max min) and store the result in the address 0x40.
0x20,0x34,0xa2,0x4b,0xc2
0x12,0xc2,0xb2,0x9b,0xe2
0x29,0x90,0x02,0x8b,0xca
0xF2,0xb4,0x2c,0x9a,0x82
How many times the following loop will be executed calculate the delay for a 4 MHZ oscillator.
myreg equ 0x88
delay movlw 0x00 ; 1 instr cycle
movwf myreg ; 1 instr cycle
again nop ; 1 instr cycle
nop ; 1 instr cycle
nop ; 1 instr cycle
nop ; 1 instr cycle
decf myreg, f ; 1 instr cycle
bnz again ; 2 instr cycle
return ; 1 instr cycle
3. Write a code that makes the PORTB as output and PORTA as input. Check for the status of S2 (bit 4 on PORTA) if the switch is pressed turn on all of the LEDs attached to PORTBs with enough delay.
4. (Extra Credit) Write a piece of code that counts from zer0 to 99 using four digit 7 segments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
