Vous êtes sur la page 1sur 21

Fanda Lena Ayunda Muslimah

2016-11-176

ANIMASI 1 (LED MENYALA DARI KIRI KANAN MENUJU KE TENGAH)

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H

start: jmp mulai


porta equ 00h
portb equ 01h
portc equ 02h
cw equ 03h

mulai:
mov al,80h
mov dx,cw
out dx,al
putar:
mov al,129
mov dx,portc
out dx,al
call delay

mov al,66
mov dx,portc
out dx,al
call delay

mov al,36
mov dx,portc
out dx,al
call delay

mov al,24
mov dx,portc
out dx,al
call delay

delay proc near


push cx
mov cx,0ffffh
loop $
pop cx
ret
delay endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

ANIMASI 2 (LAMPU MENYALA DARI KANAN KE KIRI MULAI DARI L8)

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H

start: jmp mulai


porta equ ooh
portb equ 01h
portc equ 02h
cw equ 03h

mulai:
mov al,80h
mov dx,cw
out dx,al
ulang:
mov al,128
mov cx,8
putar:
mov dx,portc
out dx,al
call delay

shr al,1
shr al,1
loop putar
jmp ulang

delay proc near


push cx
mov cx,0ffffh
loop $
pop cx
ret
delay endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

PIPO (11-176)

CODE_SEG SEGMENT

ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H

start: jmp mulai

porta equ 00h


portb equ 01h
portc equ 03h
cw equ 03h

mulai:
mov al,80h
mov dx,cw
out dx,al

call blank
putar:
mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01011111b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111000b
out dx,al
call pulse
call delay

mov dx,portb
mov al,00000001b
out dx,al
call pulse
call delay

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

blank proc near


mov cx,8
off:
mov al,01111111b
mov dx,portb
out dx,al
call pulse
loop off
ret
blank endp

delay proc near


push cx
mov cx,0fffh
loop $
pop cx
ret
delay endp

pulse proc near


or al,128
out dx,al
ret
pulse endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

PIPO (11-182)

CODE_SEG SEGMENT

ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H

start: jmp mulai

porta equ 00h


portb equ 01h
portc equ 03h
cw equ 03h

mulai:
mov al,80h
mov dx,cw
out dx,al

call blank
putar:
mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01011111b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,00000000b
out dx,al
call pulse
call delay

mov dx,portb
mov al,00001010b
out dx,al
call pulse
call delay

blank proc near

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov cx,8
off:
mov al,01111111b
mov dx,portb
out dx,al
call pulse
loop off
ret
blank endp

delay proc near


push cx
mov cx,0fffh
loop $
pop cx
ret
delay endp

pulse proc near


or al,128
out dx,al
ret
pulse endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

PIPO (11-173)

CODE_SEG SEGMENT

ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H

start: jmp mulai

porta equ 00h


portb equ 01h
portc equ 03h
cw equ 03h

mulai:
mov al,80h
mov dx,cw
out dx,al

call blank
putar:
mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01011111b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111100b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01111000b
out dx,al
call pulse
call delay

mov dx,portb
mov al,01010000b
out dx,al
call pulse
call delay

blank proc near

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov cx,8
off:
mov al,01111111b
mov dx,portb
out dx,al
call pulse
loop off
ret
blank endp

delay proc near


push cx
mov cx,0fffh
loop $
pop cx
ret
delay endp

pulse proc near


or al,128
out dx,al
ret
pulse endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

LCD ( FANDA ELEKTRO-176)

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H
start: jmp mulai
DISPCLR EQU 00000001B
FUNCSET EQU 00111000B
ENTRMOD EQU 00000110B
DISPON EQU 00001100B
pa equ 00h
pb equ 01h
pc equ 02h
cw equ 03h
awal db ?
data db ?
akhir db ?

mulai:
Mov AX,CS
Mov DS,AX
Xor AX,AX
Mov ES,AX
Mov SS,AX
Lea SI,Awal
Lea CX,Akhir
Mov DI,SI
Sub CX,SI
Cld
Rep Movsb
Mov SP,2000h
Xor AX,AX
Mov DS,AX

mov dx,cw
mov al,82h
out dx,al

call init_LCD
mov data,85h
call control_out
mov data,46h
call data_out

mov data,86h
call control_out
mov data,41h
call data_out

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov data,87h
call control_out
mov data,4Eh
call data_out

mov data,88h
call control_out
mov data,44h
call data_out

mov data,89h
call control_out
mov data,41h
call data_out

mov data,0C2h
call control_out
mov data,45h
call data_out

mov data,0C3h
call control_out
mov data,4Ch
call data_out

mov data,0C4h
call control_out
mov data,45h
call data_out

mov data,0c5h
call control_out
mov data,4Bh
call data_out

mov data,0c6h
call control_out
mov data,54h
call data_out

mov data,0c7h
call control_out
mov data,52h
call data_out

mov data,0c8h
call control_out
mov data,4Fh
call data_out

mov data,0CAh
call control_out
mov data,31h
call data_out

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov data,0CBh
call control_out
mov data,37h
call data_out

mov data,0cCh
call control_out
mov data,36h
call data_out

lagi:
jmp lagi

Init_LCD proc near


mov data,DISPCLR
call control_out
call delay

mov data,FUNCSET
call control_out
call delay

mov data,ENTRMOD
call control_out
call delay

mov data,DISPON
call control_out
call delay

ret
init_LCD endp

Control_out proc near


mov dx,pa
mov al,00000000b ;E = 0, RS = 0
out dx,al
call delay

mov dx,pa
mov al,10000000b ;E = 1, RS = 0
out dx,al
call delay

mov dx,pa
mov al,data
out dx,al
call delay

mov dx,pa
mov al,00000000b ;E = 0, RS = 0
out dx,al

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

call delay
ret
control_out endp
data_out proc near
mov dx,pa
mov al,01000000b ;E = 0, RS = 1
out dx,al
call delay

mov dx,pa
mov al,11000000b ;E = 1, RS = 1
out dx,al
call delay
mov dx,pa
mov al,data
out dx,al
call delay

mov dx,pa
mov al,01000000b ;E = 0, RS = 1
out dx,al
call delay
ret
data_out endp

delay proc near


push cx
mov dx,0fffh
loop $
pop cx
ret
delay endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

LCD(GIOF ELEKTRO-183)

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H
start: jmp mulai
DISPCLR EQU 00000001B
FUNCSET EQU 00111000B
ENTRMOD EQU 00000110B
DISPON EQU 00001100B
pa equ 00h
pb equ 01h
pc equ 02h
cw equ 03h
awal db ?
data db ?
akhir db ?

mulai:
Mov AX,CS
Mov DS,AX
Xor AX,AX
Mov ES,AX
Mov SS,AX
Lea SI,Awal
Lea CX,Akhir
Mov DI,SI
Sub CX,SI
Cld
Rep Movsb
Mov SP,2000h
Xor AX,AX
Mov DS,AX

mov dx,cw
mov al,82h
out dx,al

call init_LCD
mov data,85h
call control_out
mov data,47h
call data_out

mov data,86h
call control_out
mov data,49h
call data_out

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov data,87h
call control_out
mov data,4Fh
call data_out

mov data,88h
call control_out
mov data,46h
call data_out

mov data,0C2h
call control_out
mov data,45h
call data_out

mov data,0C3h
call control_out
mov data,4Ch
call data_out

mov data,0C4h
call control_out
mov data,45h
call data_out

mov data,0c5h
call control_out
mov data,4Bh
call data_out

mov data,0c6h
call control_out
mov data,54h
call data_out

mov data,0c7h
call control_out
mov data,52h
call data_out

mov data,0c8h
call control_out
mov data,4Fh
call data_out

mov data,0CAh
call control_out
mov data,31h
call data_out

mov data,0CBh
call control_out
mov data,38h
call data_out

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov data,0cCh
call control_out
mov data,32h
call data_out

lagi:
jmp lagi

Init_LCD proc near


mov data,DISPCLR
call control_out
call delay

mov data,FUNCSET
call control_out
call delay

mov data,ENTRMOD
call control_out
call delay

mov data,DISPON
call control_out
call delay

ret
init_LCD endp

Control_out proc near


mov dx,pa
mov al,00000000b ;E = 0, RS = 0
out dx,al
call delay

mov dx,pa
mov al,10000000b ;E = 1, RS = 0
out dx,al
call delay

mov dx,pa
mov al,data
out dx,al
call delay

mov dx,pa
mov al,00000000b ;E = 0, RS = 0
out dx,al
call delay
ret
control_out endp
data_out proc near
mov dx,pa

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov al,01000000b ;E = 0, RS = 1
out dx,al
call delay

mov dx,pa
mov al,11000000b ;E = 1, RS = 1
out dx,al
call delay
mov dx,pa
mov al,data
out dx,al
call delay

mov dx,pa
mov al,01000000b ;E = 0, RS = 1
out dx,al
call delay
ret
data_out endp

delay proc near


push cx
mov dx,0fffh
loop $
pop cx
ret
delay endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

LCD (FACHMI ELEKTRO-173)

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H
start: jmp mulai
DISPCLR EQU 00000001B
FUNCSET EQU 00111000B
ENTRMOD EQU 00000110B
DISPON EQU 00001100B
pa equ 00h
pb equ 01h
pc equ 02h
cw equ 03h
awal db ?
data db ?
akhir db ?

mulai:
Mov AX,CS
Mov DS,AX
Xor AX,AX
Mov ES,AX
Mov SS,AX
Lea SI,Awal
Lea CX,Akhir
Mov DI,SI
Sub CX,SI
Cld
Rep Movsb
Mov SP,2000h
Xor AX,AX
Mov DS,AX

mov dx,cw
mov al,82h
out dx,al

call init_LCD
mov data,85h
call control_out
mov data,46h
call data_out

mov data,86h
call control_out
mov data,41h
call data_out

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov data,87h
call control_out
mov data,43h
call data_out

mov data,88h
call control_out
mov data,48h
call data_out

mov data,89h
call control_out
mov data,4Dh
call data_out

mov data,8Ah
call control_out
mov data,49h
call data_out

mov data,0C2h
call control_out
mov data,45h
call data_out

mov data,0C3h
call control_out
mov data,4Ch
call data_out

mov data,0C4h
call control_out
mov data,45h
call data_out

mov data,0c5h
call control_out
mov data,4Bh
call data_out

mov data,0c6h
call control_out
mov data,54h
call data_out

mov data,0c7h
call control_out
mov data,52h
call data_out

mov data,0c8h
call control_out
mov data,4Fh
call data_out

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

mov data,0CAh
call control_out
mov data,31h
call data_out

mov data,0CBh
call control_out
mov data,37h
call data_out

mov data,0cCh
call control_out
mov data,33h
call data_out

lagi:
jmp lagi

Init_LCD proc near


mov data,DISPCLR
call control_out
call delay

mov data,FUNCSET
call control_out
call delay

mov data,ENTRMOD
call control_out
call delay

mov data,DISPON
call control_out
call delay

ret
init_LCD endp

Control_out proc near


mov dx,pa
mov al,00000000b ;E = 0, RS = 0
out dx,al
call delay

mov dx,pa
mov al,10000000b ;E = 1, RS = 0
out dx,al
call delay

mov dx,pa
mov al,data
out dx,al

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

call delay

mov dx,pa
mov al,00000000b ;E = 0, RS = 0
out dx,al
call delay
ret
control_out endp
data_out proc near
mov dx,pa
mov al,01000000b ;E = 0, RS = 1
out dx,al
call delay

mov dx,pa
mov al,11000000b ;E = 1, RS = 1
out dx,al
call delay
mov dx,pa
mov al,data
out dx,al
call delay

mov dx,pa
mov al,01000000b ;E = 0, RS = 1
out dx,al
call delay
ret
data_out endp

delay proc near


push cx
mov dx,0fffh
loop $
pop cx
ret
delay endp

ORG 20F0H
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN
Fanda Lena Ayunda Muslimah
2016-11-176

STEPPER ( detak 4121 berlawan arah)


CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG
ORG 100H

start: jmp mulai

porta equ 00h


portb equ 01h
portc equ 02h
cw equ 03h

mulai:
mov al,80h
mov dx,cw
out dx,al

putar:
mov al,7
mov dx,porta
out dx,al
call delay

mov al,7
mov dx,porta
out dx,al
call delay

mov al,7
mov dx,porta
out dx,al
call delay

mov al,1
mov dx,porta
out dx,al
call delay

mov al,12
mov dx,porta
out dx,al
call delay

jmp putar

delay proc near


push cx
mov cx,0fffh
loop $
pop cx
ret
delay endp

ORG 20F0H
reset
DB 0EAH
DW 0100H
DW 0FDF0H

CODE_SEG ENDS
END START

LABORATORIUM MIKROPROSESOR
STT-PLN

Vous aimerez peut-être aussi