;********************************************************************* ; Output Test: 8255 Centurion Laser Eyes ; PPI Port B output only. ;********************************************************************* ; We'll use the slow clock circuit. The crystal oscillator/resonator is just too fast at 1MHz ; to see the LEDs strobe back and forth. ; The PPI ports will be assigned addresses starting with the base address of $08 given to the PPI. PPIbase:.EQU $08 ; UART = $00, PPI = $08, next1 = $10, next2 = $18. PortA: .EQU PPIbase + 0 ; ($08) Port A address. PortB: .EQU PPIbase + 1 ; ($09) Port B address. PortC: .EQU PPIbase + 2 ; ($0A) Port C address. CWR: .EQU PPIbase + 3 ; ($0B) Control Word Register. CWRCfg: .EQU $80 ; Control word: 1000 0000 ; Active, Mode 0, A & B & C outputs. ; Bit D7: Mode is active. ; Bits D6 to D3: Group A. ; Bits D6 & D5: Mode 0: basic input/output. ; Bit D4: Port A output ; Bit D3: Port C upper output. ; Bits D2 to D0: Group B. ; Bit D2: Port C lower output. ; Bit D1: Port B output. ; Bit D0: Port C lower output. .ORG $0000 NOP ; Safety filler NOP. LD A, CWRCfg ; Set CWR so all 3 ports are output. OUT (CWR), A ; Send control word 0x80 to CWR. LD A, 1 ; D0 bit selected. Left: OUT (PortB), A ; Output the bit on the databus to the 8255 port B. RLCA ; Shift the bit left to the next bit position. CP 128 ; Has the bit rotated left to bit position 7? JR Z, Right ; If yes, change direction by going to Right. JR Left ; Else no, keep rotating Left. Right: OUT (PortB), A ; Output the bit on the databus to the 8255 port B. RRCA ; Shift the bit right to the next bit position. CP 1 ; Has the bit rotated right to bit position 0? JR Z, Left ; If yes, change direction by going to Left. JR Right ; Else no, keep rotating Right. .END