 ;***********************************************
;* MDA-8086 Dot-Matrix EXPERIMENT * ;* *
;* “Scrolling a vertical line of 8-lit LEDs” * ;***********************************************
; ; FILENAME : MATRIX_1.ASM
; PROCESSOR : I8086
CODE SEGMENT
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE ;

;thes values obtined as mensined in the prelab

PPIC_C EQU  1EH  ; control register

PPIC EQU   1CH 
 
PPIB EQU  1AH

PPIA EQU 18H ;

ORG 1000H 
MOV AL, 80h   ;  the control word is 80H since the mode of operation is IO mode 

OUT PPIC_C,AL 

MOV AL,0FFH          ; send all ones to Port-A 

OUT PPIA,AL


 
L1: 
 MOV SI ,OFFSET DATA
MOV AH,01H               ; Task-5: Enable Column zero (C0)

 L2:
MOV AL,AH
OUT PPIC ,AL
MOV AL,BYTE PTR CS:[SI]  
OUT PPIB ,AL



CALL TIMER 

CLC

INC SI
ROL AH,1

; Task-6: Add one instruction to enable the 
; next column


JNC L2

JMP L1
       
INT 3         

TIMER: MOV CX,0FFH; this is a 16 bit counter
 
TIMER1: 
NOP
NOP 
NOP
NOP 
LOOP TIMER1

RET 

DATA: DB 11111111B ; the left most column. All dots are off 
DB 10111101B ; the next column with the top 2 dots being off 
DB 11011011B 
DB 11100111B 
DB 11100111B  
DB 11011011B
DB 10111101B 
DB 11111111B ; the right most column
CODE ENDS 
END