Download Experiment No. 11 Date: / /2015
Document related concepts
no text concepts found
Transcript
Group B Experiment No. 11 Date: / /2015 Name: Roll No. Year: 2014-15 -----------------------------------------------------------------------------------------------------------------Aim: Write a TSR program in 8086 ALP to implement Real Time Clock (RTC). Read the Real Time from CMOS chip by suitable INT and FUNCTION and display the RTC at the bottom right corner on the screen. Access the video RAM directly in your routine. -----------------------------------------------------------------------------------------------------------------.MODEL TINY .CODE ORG 100H PTR_IVT DD? MOV AX, 02 INT 10H ; Initialize Video Driver PUSH CS POP DS MOV AH, 35H ; Get Interrupt Vector MOV AL, 08H ; interrupt number INT 21H MOV WORD PTR PTR_IVT, BX MOV WORD PTR PTR_IVT+2, ES MOV DX, OFFSET START_ISR MOV AH, 25H ; Set Interrupt Vector MOV AL, 08H ; interrupt number INT 21H MOV AH, 31H ; Terminate-and-stay-resident MOV AL, 00 MOV DX, 200 ; DOS allocated memory to reserve INT 21H START_ISR: PUSH AX PUSH BX PUSH CX PUSH DX PUSH ES PUSH SS PUSH SI PUSH DI PUSH DS PUSH CS POP DS MOV AX, 0B800H ; Es to Start Of Vram MOV ES, AX MOV BX, 1000 ; Location of Timer on Video Display MOV AH, 02H ; Get the System Time INT 1AH MOV AL, CH CALL PROC_VRAM CALL PROC_COLON MOV AL, CL CALL PROC_VRAM CALL PROC_COLON MOV AL,DH CALL PROC_VRAM POP DS POP DI POP SI POP SS POP ES POP DX POP CX POP BX POP AX JMP CS: PTR_IVT PROC_VRAM PROC NEAR MOV DL,AL MOV AH,CL MOV CL,04H SHR DL,CL MOV CL,AH ADD DL,30H MOV ES:[BX],DL INC BX MOV BYTE PTR ES: [BX], 6CH INC BX MOV DL, AL AND DL, 0FH ADD DL, 30H MOV ES:[BX],DL ; attribute of the Character like Color INC BX MOV BYTE PTR ES: [BX], 6CH INC BX RET ENDP PROC_COLON PROC NEAR MOV DL,':' MOV ES: [BX], DL INC BX MOV BYTE PTR ES: [BX], 6CH INC BX RET ENDP END Output C:\TASM> tasm tsr1.asm Turbo Assembler Version 3.0 Copyright (c) 1988, 1991 Borland International Assembling file : tsr1.asm Error messages : None Warning messages : None Passes : 1 Remaining memory : 475k C:\TASM>tlink tsr1 Turbo Link Version 2.0 Copyright (c) 1988, 1991 Borland International Warning : no stack C:\TASM>tsr1