0% found this document useful (0 votes)
21 views6 pages

Activity On Interfacing 8086

The document contains assembly language programs for the EMU8086 simulator, demonstrating interfacing with external devices such as LED displays and timers. The LED display program outputs values to a specified port in an infinite loop, while the timer program displays characters at set intervals and includes routines for setting video mode and clearing the screen. Both programs illustrate basic assembly language concepts and hardware interaction using the 8086/8088 architecture.

Uploaded by

evie.hart90
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

Activity On Interfacing 8086

The document contains assembly language programs for the EMU8086 simulator, demonstrating interfacing with external devices such as LED displays and timers. The LED display program outputs values to a specified port in an infinite loop, while the timer program displays characters at set intervals and includes routines for setting video mode and clearing the screen. Both programs illustrate basic assembly language concepts and hardware interaction using the 8086/8088 architecture.

Uploaded by

evie.hart90
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Activity on interfacing 8086/8088

1. Create an Assembly Language using EMU8086 External Add on Devices. Displaying LED Display.

Sample output program

#start=led_display.ex
e#

#make_bin#

name "led"

mov ax, 1234


out 199, ax

mov ax, -5678


out 199, ax

; Eternal loop to
write
; values to port:
mov ax, 0
x1:
out 199, ax
inc ax
jmp x1

hlt
2. Create an Assembly Language using EMU8086 External Add on Devices. Displaying a TIMER.

Sample output program

name
"timer
"

#make_boot#
org 7c00h

; set the segment registers


mov ax, cs
mov ds, ax
mov es, ax

call set_video_mode
call clear_screen
next_char:
cmp count, 0
jz stop

; print char:
mov al, c1
mov ah, 0eh
int 10h

; next ascii char:


inc c1
dec count

; set 1 million microseconds interval (1 second)


mov cx, 0fh
mov dx, 4240h
mov ah, 86h
int 15h

; stop any error:


jc stop

jmp next_char

stop:

; print message using bios int 10h/13h function


mov al, 1
mov bh, 0
mov bl, 0010_1111b
mov cx, msg_size
mov dl, 4
mov dh, 15
mov bp, offset msg
mov ah, 13h
int 10h

; wait for any key...


mov ah, 0
int 16h

int 19h ; reboot

count db 10
c1 db 'a'

msg db "remove floppy disk and press any key to


reboot..."
msg_size = $ - msg

; set video mode and disable blinking (for


compatibility).
set_video_mode proc
mov ah, 0
mov al, 3 ; text mode 80x25, 16 colors, 8 pages
int 10h
; blinking disabled for compatibility with dos,
; emulator and windows prompt do not blink anyway.
mov ax, 1003h
mov bx, 0 ; disable blinking.
int 10h
ret
set_video_mode endp
; clear the screen by scrolling entire screen
window,
; and set cursor position on top.
; default attribute is changed to black on white.
clear_screen proc near
push ax ; store registers...
push ds ;
push bx ;
push cx ;
push di ;

mov ax, 40h


mov ds, ax ; for getting screen
parameters.
mov ah, 06h ; scroll up function id.
mov al, 0 ; scroll all lines!
mov bh, 1111_0000b ; attribute for new
lines.
mov ch, 0 ; upper row.
mov cl, 0 ; upper col.
mov di, 84h ; rows on screen -1,
mov dh, [di] ; lower row (byte).
mov di, 4ah ; columns on screen,
mov dl, [di]
dec dl ; lower col.
int 10h

; set cursor position to top


; of the screen:
mov bh, 0 ; current page.
mov dl, 0 ; col.
mov dh, 0 ; row.
mov ah, 02
int 10h

pop di ; re-store registers...


pop cx ;
pop bx ;
pop ds ;
pop ax ;

ret
clear_screen endp

You might also like