Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

maonin

Newbie level 2
Joined
Oct 14, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
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
 

Attachments

  • d23251f6bce2cff1749b459c45d66c861e50aa46acd4f0180e373c629f220c126g.jpg
    d23251f6bce2cff1749b459c45d66c861e50aa46acd4f0180e373c629f220c126g.jpg
    76 KB · Views: 60

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top