I have a PIC32 configured running at 80MHz clock rate. As a test, I tried to toggle a DIO pin with

```
while(1) {        
    LATFbits.LATF4 = !LATFbits.LATF4;
}

```

It's only toggling DIO at 625kHz according to the scope. Looking at the dissembled listing

```
9D000118  8C446160   LW A0, 24928(V0)
9D00011C  30840010   ANDI A0, A0, 16
9D000120  2C840001   SLTIU A0, A0, 1
9D000124  8C436160   LW V1, 24928(V0)
9D000128  7C832104   INS V1, A0, 4, 1
9D00012C  AC436160   SW V1, 24928(V0)
9D000130  0B400046   J 0x9D000118

```

It's not that many instructions. Why is it so slow?

==============

finally get 20MHz (4 instructions) with assembly 

```
#include<p32xxx.h>

.text
.set    noreorder
.set    nomacro

.global toggle
.ent    toggle

toggle:

# void toggle(int mask)

# $a0 - mask
# performs toggles in an infinite loop (never returns)

# la $t0, 0xbf886160  # LATF base address 04:clear 08:set 12:inv

la $t0,LATF

loop:
sw  $a0,  4($t0)        # write mask to clear 
sw  $a0,  8($t0)        # write mask to set
j loop
nop

.end toggle

```