;FILENAME:   STLAB081.ASM
;DATE:       March 16, 1996
;TITLE:      Digital to analog voltage conversion
;HARDWARE:   MLAB-121

; Pin Interface
PB_8255  EQU    0FA01H  ;8255 port b
CTL_8255 EQU    0FA03H  ;8255 control port

;Program 1: Digital to analog voltage conversion
;
        ORG     8100H
MAIN:
        LCALL  INIT_8255
LOOP1:
        MOV    A,#00H
        MOV    DPTR,#PB_8255
LOOP2:
        MOVX   @DPTR,A
        INC    A
        MOV    R2,#05H
LOOP3:
        MOV    R3,#00H
        DJNZ   R3,$
        DJNZ   R2,LOOP3
        SJMP   LOOP2
;
; Initial 8255 mode of operation
;
INIT_8255:
        MOV     DPTR,#CTL_8255  ;Init 8255 mode
        MOV     A,#80H          ;PC(low) = in PC(high) = out
        MOVX    @DPTR,A
        RET
;
        END
