Why? To be smarter than average, probably :-). ADD isn't faster than EOR, so this trick is as useless as this one
LDAA PORTH ;// PORTH ^= 0x80
SUBA #$80
STAA PORTH
Your successor will like it..., or maybe not
Okay THX!!!!
Here is the whole code:
include <stdio.h>
#include <mc912d128.h>
void delay1ms(void) {
asm("ldy #2666"); //2666 in Y-Register laden
asm("dbne y,."); // Decrement, bis Y=0 ist /
//3cyc x 125ns x 2666 = 0,99975ms
}
void wait(int duration)
{
while(duration--)
delay1ms();
}
void main(void) {
asm("LDAA #$80"); //DDRH |= 0x80;
asm("STAA $002B");
while(1){
asm("LDAA #$80"); //PORTH ^=0x80;
asm("ADDA $0029");
asm("STAA $0029");
wait(1000);
}
}
Program is ICC12!
THX to all of you for helping hands!