;---------------------------------------------------------------- ; LD222.ASM Wait for the pattern xxFF hex at input port 1. ; C.P. Diduch, September 28, 2004. ;---------------------------------------------------------------- .ORG 0x8000 ; ROM ; void main(void) { ADDL R2, NULL, 0xAAAA ; outport(2, 0xAAAA); STOREP 2, R2 ; ; M0: LOADP R0, 1 ; while(((0x00FF & inport(1))==0x00FF) {} ANDL R1, R0, 0x00FF ; SUBL NULL, R1,0x00FF ; JMPZ M0 ; ; ADDL R2, NULL, 0x0505 ; outport(2, 0x0505); STOREP 2, R2 ; M1: JMP M1 ; do {}; // Graceful termination. ; }