Program to Divide two 8bit Numbers using PIC18F MCU in MPLAB IDE using Embedded C Atharva Satyendra Agrawal May 08, 2022 Atharva Satyendra Agrawal Program: #include <xc.h> void main(void) { PORTA = 0x50; // 80 PORTB = 0x02; // 02 TRISA = 0; TRISB = 0; TRISC = 0; TRISD = 0; PORTD = PORTA%PORTB; // 80/2 = 40 in 28 Hex PORTC = PORTA/PORTB; return; } Output: Tweet Share Share Share Related Post