Search This Blog

Tuesday, July 12, 2011

vtu 4th sem microprocessors hardware programs

program 2.b as per syllebus

.model small
.code
        mov dx,0e803h
        mov al,80h
        out dx,al
        mov al,0
        mov dx,0e800h
     up:out dx,al
        call delay
        add al,1
        daa
        call stop
        cmp al,99
        jne up
   down:out dx,al
        call delay
        add al,99
        daa
        call stop
        cmp al,0
        jne down
   stop:push ax
        mov ah,1
        int 16h
        jnz exit
        pop ax
        ret
   exit:mov ah,4ch
        int 21h
   delay:mov si,2fffh
   ret2: mov di,0ffffh
   ret1: dec di
         jnz ret1
         dec si
         jnz ret2
         ret
         end

No comments:

Post a Comment