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

In summary, the conversation is about a project that involves a code and circuit to display hours and minutes, but is currently not working. The specific issues are that the hour display is not showing anything and the minute display is advanced by one minute. The code provided is for a clock program and the circuit is shown in an image. The person is asking for help with fixing the issues.
  • #1
maonin
2
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
  • #2
please help.
 

1. How does a PC based digital clock work?

A PC based digital clock uses the parallel port of a computer to communicate with an external device, such as an LED display. The assembly language code written in TASM (Turbo Assembler) is responsible for sending and receiving signals through the parallel port to control the display of time.

2. What is the advantage of using assembly language in TASM for a digital clock?

Assembly language is a low-level programming language that allows for precise control over hardware and memory. This makes it ideal for creating a digital clock that needs to accurately track time and display it on an external device. TASM, specifically, is a popular assembly language compiler that is easy to use and widely available.

3. Can the digital clock be customized to display time in different formats?

Yes, the assembly language code can be modified to display time in different formats, such as 12-hour or 24-hour format, depending on the user's preference. This can be achieved by making changes to the code that handles the conversion of time data into a displayable format.

4. Is it possible to add additional features to the digital clock?

Yes, additional features such as an alarm or stopwatch can be added to the digital clock by modifying the assembly language code. These features will require additional code to handle their functionality, but the basic structure of the digital clock program will remain the same.

5. Can the digital clock be used on any computer with a parallel port?

Yes, as long as the computer has a parallel port, the digital clock program written in assembly language using TASM can be executed on it. However, the clock may need to be calibrated for the specific hardware and operating system of the computer it is being used on.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
20
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Programming and Computer Science
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
13K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
3K
  • Programming and Computer Science
Replies
7
Views
6K
Back
Top