;---------------------------------------------------------------- ; LD261.ASM This program generates the stepper sequence. It ; will be used to demonstrate the operation of Trap and ; softare interrupts. You must append the Monitor.asm file and ; insert the appropriate initializations as you had done in ; an earlier experiment. C.P. Diduch, November 16, 2004. ;---------------------------------------------------------------- ; MAIN PROGRAM ; void main(void) { ; .EQU Tmp R0 ; #define Tmp R0 .EQU M R1 ; #define M R1 .EQU S R2 ; #define S R2 .EQU Old R3 ; #define Old R3 .EQU New R4 ; #define New R4 ; .ORG 0x8000 ; main { ; ADD S, NULL, NULL ; S = 0; ADDL M, NULL, 1 ; M = 1; LOADP Tmp, 0 ; Old = 0x0001 & inport(0); ANDL Old, Old, 1 ; M0: ; do { LOADP Tmp, 0 ; New = 0x0001 & inport(0); ANDL New, Tmp, 1 ; SUB NULL, Old, New ; if (Old != New) { JMPZ M1 ; XORL M, M, 0x0011 ; M = M ^ 0x0011; ADD Old, NULL, New ; Old = New; ; } M1: XORL M, M, 0x0011 ; M = M ^ 0x0011; XOR S, S, M ; S = S ^ M; INT 1 ; Software Breakpoint STOREP 2, S ; outport(Stepper, S); JMP M0 ; } ;----------------------------------------------------------------