Category : Assembly Language Source Code
Archive   : ZAD.ZIP
Filename : TRAFFIC.SRC

 
Output of file : TRAFFIC.SRC contained in archive : ZAD.ZIP
ORG 1800
INIT: NOP

SCAN EQU 0FEBH

LED1 EQU 1F1CH
LED2 EQU 1F1DH
LED3 EQU 1F1EH
LED4 EQU 1F1FH


STATE0 EQU 1E00H
;STATE1 EQU 1E02H BIT ASSIGNMENTS
;STATE2 EQU 1E04H AT THESE ADDRESSES
;STATE3 EQU 1E06H (SEVEN-SEGMENT)
;STATE4 EQU 1E08H
;STATE5 EQU 1E0AH

NEXTSTATE0 EQU 1E0CH ; CAR/NO CAR TR. TABLE


LD HL, STATE0
LD (HL), 254 ; G FOR GREEN
INC HL
LD (HL), 3 ; R FOR RED

INC HL
LD (HL), 246 ; Y FOR YELLOW
INC HL
LD (HL), 3 ; R FOR RED

INC HL
LD (HL), 133 ; L FOR LEFT
INC HL
LD (HL), 3 ; R FOR RED

INC HL
LD (HL), 246 ; Y FOR YELLOW
INC HL
LD (HL), 3 ; R FOR RED

INC HL
LD (HL), 3 ; R FOR RED
INC HL
LD (HL), 254 ; G FOR GREEN

INC HL
LD (HL), 3 ; R FOR RED
INC HL
LD (HL), 246 ; Y FOR YELLOW


LD HL, NEXTSTATE0 ; STATE 0 W/O CAR
LD (HL), 02H
INC HL
LD (HL), 1EH
INC HL ; STATE 0 WITH CAR
LD (HL), 02H
INC HL
LD (HL), 1EH

INC HL ; STATE 1 W/O CAR
LD (HL), 04H
INC HL
LD (HL), 1EH
INC HL ; STATE 1 WITH CAR
LD (HL), 04H
INC HL
LD (HL), 1EH

INC HL ; STATE 2 W/O CAR
LD (HL), 06H
INC HL
LD (HL), 1EH
INC HL ; STATE 2 WITH CAR
LD (HL), 06H
INC HL
LD (HL), 1EH

INC HL ; STATE 3 W/O CAR
LD (HL), 00H
INC HL
LD (HL), 1EH
INC HL ; STATE 3 WITH CAR
LD (HL), 08H
INC HL
LD (HL), 1EH

INC HL ; STATE 4 W/O CAR
LD (HL), 0AH
INC HL
LD (HL), 1EH
INC HL ; STATE 4 WITH CAR
LD (HL), 0AH
INC HL
LD (HL), 1EH

INC HL ; STATE 5 W/O CAR
LD (HL), 00H
INC HL
LD (HL), 1EH
INC HL ; STATE 5 WITH CAR
LD (HL), 00H
INC HL
LD (HL), 1EH

LD HL, LED1 ;STATE0 LOADED
LD (HL), 254
LD HL, LED3
LD (HL), 254 ;MANUALLY INTO SEGMENT
LD HL, LED2
LD (HL), 3 ;VECTORS PRIOR TO LOOP
LD HL, LED4
LD (HL), 3

LD HL, STATE0 ; INITIAL CONDIONS
LD A, 0H ; FOR PROGRAM LOOP




LOOP1: CALL SCAN
CP 06H ; ZERO?
JP Z, ZERO
CP 05H ; ONE?
JP Z, ONE
CP 22H ; CHANGE,ACTUALLY "NEXT"
JP Z, CH_LITE
BRK0: JP LOOP1

CH_LITE: JP MOVEPTR ; INCREMENTS HL TO TR. TABLE
BRK1: CP 1
JP Z,CAR
BRK2: LD E, (HL) ;LOADS ADDRESS OF NEXT
INC HL ; STATE INTO DE
LD D, (HL)
LD H, D ;COPIES DE INTO HL
LD L, E
LD A, (HL) ;LOADS LED CODE INTO A
LD HL, LED1
LD (HL), A ; AND INTO LEDS 1 & 3
LD HL, LED3
LD (HL), A
LD H, D
LD L, E
INC HL
LD A, (HL) ; LOADS SECOND LED CODE
LD HL, LED2
LD (HL), A ; INTO LEDS 2 & 4
LD HL, LED4
LD (HL), A
LD A, 0 ;RESETS A FOR CAR VARIABLE
JP LOOP1


ZERO: LD A, 0 ; STORE INPUT
JP LOOP1
ONE: LD A, 1 ; STORE INPUT
JP LOOP1
CAR: INC HL
INC HL
JP BRK2
MOVEPTR: LD B, 12
INC HL
DEC B
JP NZ, MOVEPTR
JP BRK1


  3 Responses to “Category : Assembly Language Source Code
Archive   : ZAD.ZIP
Filename : TRAFFIC.SRC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/