Pc based digital clock via parallel port using assembly language in tasm

Click For Summary
SUMMARY

The forum discussion centers on a project involving a PC-based digital clock utilizing assembly language in TASM, specifically designed to interface with a parallel port. The primary issues identified are that the hour display is non-functional, while the minute display shows an incorrect time, advanced by one minute. The provided assembly code includes procedures for reading the system time and displaying it on a connected device, but requires debugging to resolve the display issues.

PREREQUISITES
  • Understanding of assembly language programming, specifically in TASM.
  • Familiarity with parallel port communication and I/O operations.
  • Knowledge of real-time clock (RTC) interfacing and time retrieval methods.
  • Basic electronics knowledge for circuit assembly and troubleshooting.
NEXT STEPS
  • Debug the assembly code to ensure accurate hour retrieval and display.
  • Research parallel port programming techniques in assembly language.
  • Learn about real-time clock (RTC) interfacing and its implications on time accuracy.
  • Explore circuit design principles for interfacing microcontrollers with external displays.
USEFUL FOR

This discussion is beneficial for assembly language programmers, electronics hobbyists, and anyone involved in interfacing hardware with software for real-time applications.

maonin
Messages
2
Reaction score
0
hi, i 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

so here's the code:
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:
http://postimage.org/image/2egfc6wsk/
 
Physics news on Phys.org
please help.
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 10 ·
Replies
10
Views
14K
  • · Replies 4 ·
Replies
4
Views
10K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 7 ·
Replies
7
Views
7K