;Bit Toggling of P2.7 on MDE 8051 Trainer ;Tested by Mazidi ;Modified from Example 4-2 of 8051 Microcontroller book by Mazidis & McKinlay ;Connect the P2.7 to an LED to see the toggling. ORG 0 CLR P2.7 ;P2.7 as output BACK: CPL P2.7 ACALL SDELAY ;one sec delay SJMP BACK ;------------------------- ;One sec. delay for DS89C4x0 with MDE8051 Trainer ;XTAL=11.0592 MHz on MDE8051 ;45 x 255 x 243 x 4 x 90 ns = 999.7 msec ;Notice DS89C4x0 uses 4 clocks for Machine Cycle. SDELAY: MOV R5, #45 H3: MOV R4, #242 H2: MOV R3, #255 H1: DJNZ R3, H1 DJNZ R4, H2 DJNZ R5, H3 RET END