Microprocessor and Microcontroller Lab 8 | Read Now

Microprocessor and Microcontroller Lab 8

8]

  • a] Design and develop an assembly program to demontrate BCD up-down counter (00-99) on the logic controller interface.
  • b] Design and develop an assembly program to read the status of two 8-bit inputs ( X & Y ) from the logic controller interface and display X*Y

8] Program code(lab8a.asm)

.model small
.stack  20
.data
pa equ 0e880h
pb equ 0e881h
pc equ 0e882h
ctrl equ 0e883h

.code
mov ax,@data
mov ds,ax
mov al,80h
mov dx,ctrl
out dx,al
mov al,00h

aa: add al,00h
    daa
    mov dx,pa
    out dx,al
    mov bx,5fffh

bb: mov cx,8fffh

cc: loop cc
    dec bx
    jnz bb
    add al,01h
    cmp al,9ah
    jnz aa

mov ah,4ch
int 21h
int 3
end

8] Program code(lab8b.asm)

.model small
.stack 18
.data
pa equ 0e880h
pb equ 0e881h
pc equ 0e882h
ctrl equ 0e883h

.code
mov ax,@data
mov ds,ax

  mov al,8ah
  mov dx,ctrl
  out dx,al

  mov dx,pb
  in al,dx
  mov bl,al

  mov dx,pc
  in al,dx
  mov cl,04h

  ror al,cl
  mul bl
  mov dx,pa
  out dx,al

mov ah,4ch
int 21h
int 3
end


Leave a Reply

Your email address will not be published. Required fields are marked *

WhatsApp Icon Join For Job Alerts