Documents

Microprocessor program

Description
Description:
Categories
Published
of 6
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Transcript
  7-SEGMENT DISPLAY INTERFACE - DISPLAY MESSAGES FIRE AND HELP.   .MODEL SMALL   .DATA   PA EQU 0CD00H   ; Port address for ESA Module.   PB EQU 0CD01H   PC EQU 0CD02H   CR EQU 0CD03H   CW DB 80H   ; Port-B Out, Port-C Out, Mode 0 I/O.   MSG1 DB 13,10, 7-SEGMENT DISPLAY INTERFACE - DISPLAY MESSAGES FIRE AND HELP... ,'$'   MSG2 DB 13,10, Press any key to Exit.$   STR1 DB 8EH, 0F9H, 0AFH, 86H   ; F I r E   STR2 DB 89H, 86H, 0C7H, 8CH   ; H E L P   .CODE   START: MOV AX, @DATA   MOV DS, AX   LEA DX, MSG1   ; To display MSG1.   MOV AH, 09H   INT 21H   LEA DX, MSG2   ; To display MSG2.   INT 21H   MOV AL, CW   MOV DX, CR   OUT DX, AL  AGAIN: LEA SI, STR1   ; Get base address of STR1(FlrE},   CALL DISP_STR   ; to display string on SSD.   CALL DELAY   ; Wait.   LEA SI, STR2   ; Get base address of STR2(HELP),   CALL DISP_STR   ; to display message on SSD.   CALL DELAY   ; Wait   MOV AH, 1   ; Press any key to exit.   INT 16H   JZ AGAIN   MOV AH, 4CH   ; Terminate.   INT 21H   DISP_STR PROC   ; Procedure to display strings.   DISP_STR PROC   ; Procedure to display strings.   MOV CX, 4   ; Total number of characters per string.   NCHAR: MOV BL, 8   ; Total number of bits in SSC.      MOV AL, [SI]   ; Get the first SSC.   NXTBIT: ROL AL, 1   ; Bring B7 to B0, i.e., B6B5B4B3B2B1B0B7.   MOV DX, PB   OUT DX, AL   ; Send bit (0/1) through PB0.   PUSH AX   MOV AL, 00H   ; For Clock.   MOV DX, PC   OUT DX, AL   ; Send bit 0 through PC0.   MOV AL, 01H   ; Send bit 1 through PC0.   MOV DX, PC   OUT DX, AL   POP AX   DEC BL   ; Reduce bits counter.   JNZ NXTBIT   ; Is counter =0? If no, repeat.   INC SI   ; Update pointer.   LOOP NCHAR   ; Repeat till CX=0.   RET   DISP_STR ENDP   DELAY PROC   ; Procedure for delay.   MOV BX, 011FFH   ; Outer counter.   B2:   MOV CX, 0FFFFH   ; Inner counter.   B1:   LOOP B1   ; Repeat till inner counter = 0.   DEC BX   JNZ B2   ; Repeat till outer counter = 0.   RET   DELAY ENDP   END START   .model small .stack 20 .data base_address equ 20c0h control equ base_address+03h ;control port porta equ base_address+00h ;porta address  portb equ base_address+01h ;portb address portc equ base_address+02h ;portc address blanks db 0,0,0,0,0,0 fire db 0,0,79h,50h,06h,71h help db 73h,38h,79h,76h,0,0 .code start: mov ax,@data mov ds,ax mov al,80h mov dx,control out dx,al ;----------display fire --------------------------------------- up: mov di,150 fir: mov si,offset fire call display dec di  jnz fir ;----------display blank ------------------------------------- mov di,300 blnk: mov si,offset blanks   call display dec di  jnz blnk ;----------display help --------------------------------------- mov di,150 hlp: mov si,offset help call display dec di  jnz hlp ;----------display blank ------------------------------------- mov di,300 blnk1: mov si,offset blanks call display dec di  jnz blnk1 ;----------keep looping till any key is pressed----------- mov ah,0bh int 21h or al,al  jz up ;----------terminate-------------------------------------------
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x