pc digital clock via parallel port using assembly language in tasm

hi, we have this project and we already have a code and the circuit but it is not working..
it's supposed to display the hours and minutes
the problems are:
1. the hour display is not displaying anything
2. the minute displays but it is advanced by one minute
please help us.


so here's the code:
TITLE CLOCK.ASM
DOSSEG
.MODEL SMALL
.STACK 0100H
.DATA
    PRINTERPORTBASEADDRESS equ 378h

.CODE
MAIN        PROC
    MOV AX, @DATA
    MOV DS, AX
    CALL RTIME    ; READ TIME
    CALL DisplayTime     ;DISPLAY TIME    
    
    MOV AX, 4C00H
    INT 21H
MAIN         ENDP
RTIME         PROC
    MOV AH, 02H
    INT 1AH
    RET
    ; CH - HOUR
    ; CL - MINUTES
    ; DH - SECONDS
RTIME        ENDP
DisplayTime PROC
    push     DX    ; was DH
    push     CX    ; was CL
;
    mov      AL,CH
    mov      DX,PRINTERPORTBASEADDRESS
    out        DX,AL
    mov      AL,01h
    mov      DX,PRINTERPORTBASEADDRESS+2
    out        DX,AL    ; enable display
    call       Delay
;
    mov      AL,00h
    mov      DX,PRINTERPORTBASEADDRESS+2
    out        DX,AL
    pop       AX    ; pop CL (minutes)
    mov      DX,PRINTERPORTBASEADDRESS
    out        DX,AL
    mov      AL,02h
    mov      DX,PRINTERPORTBASEADDRESS+2
    out        DX,AL    ; enable display
    call       Delay
;
    mov      AL,00h
    mov      DX,PRINTERPORTBASEADDRESS+2
    out        DX,AL
    pop       AX    ; pop DH (seconds)
    mov    AL,AH
    mov      DX,PRINTERPORTBASEADDRESS
    out        DX,AL
    mov      AL,08h
    mov      DX,PRINTERPORTBASEADDRESS+2
    out        DX,AL    ; enable display
    call       Delay
;
    mov      DX,PRINTERPORTBASEADDRESS+2
    mov      AL,00h
    out        DX,AL
    ret
DisplayTime ENDP
Delay Proc
        MOV CX, 00100h
    X:  PUSH CX
        MOV CX, 0FFFFh
    Y:  LOOP Y
        POP CX
        LOOP X
        RET
Delay ENDP
END
and the circuit:
#-Link-Snipped-#

Replies

  • maonin
    maonin
    please help. 😔

You are reading an archived discussion.

Related Posts

These guides from GlobalSpecs are not advertisements for any specific product. They give helpful technical info, which will help engineers select appropriate products. CR4 - Blog: How to Select Industrial...
Salary Under HSE’s current pay arrangements, subject to an effective level of performance, staff progress annually towards the maximum of their pay scale. The maximum of the pay range for...
Some engineers feel that Engineers and designers have been degraded into glorified CAD people. It is all about money and cost control now, [not] design engineering. I have noticed that...
Hey, I'm Nikhil. Currently in 5th Semester and A Future Mechanical Engineer[Well, Thats the Plan for now 😉 ] Me and few of my Friends are planning for M.S and...
Free Fortune Cookie Message Generator - Create, Print Personalized Cookie Fortunes