loading...

Message on seven segment display interface using ALP

The following program displays a given message on the seven segment display interface for a suitable period of time.

assume cs:code,ds:data
DATA SEGMENT
firstcode db 86h,88h,0f9h,8eh
seccode db 8ch,0c7h,86h,89h
pa equ 0d880h
pb equ 0d881h
pc equ 0d882h
cw equ 0d883h
Data ends
CODE SEGMENT
Start:      mov ax,data
            mov ds,ax
            mov dx,cw
            mov al,80h
            out dx,al
again:      mov si,offset firstcode
            call display1
            call delay
            mov si,offset seccode
            call display1
            call delay
            mov ah,0bh
            int 21h
            OR al,al
            jz again
            mov ah,4ch
            int 21h
display1 proc
            mov cx,04h
loop2:
            mov bl,08h
            mov al,[si]
next:       rol al,01h
            mov dx,pb
            out dx,al
            push ax
            mov bh,al
            mov al,0ffh
            mov dx,pc
            out dx,al
            mov al,00h
            out dx,al
            dec bl
            pop ax
            jz next1
            mov al,bh
            jmp next
next1:      inc si
            loop loop2
            ret
display1 endp
delay proc
          push ax
          push cx
          mov cx,0faa0h
loop1:
          mov ax,0ffffh
loop3:
          dec ax
          jnz loop3
          loop loop1
          pop cx
          pop ax
          ret 
          delay endp
          Code ends
          end Start



The output of the above code is –

Output:
It displays the message
    FIRE HELP
The 1st string is FIRE
The 2nd string is HELP

 

0 1

Leave a Reply

Your email address will not be published.