Juju

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

TITLE aps(.asm) Include Irvine16.inc .

data ESCkey = 1Bh delay5 = 4FFFh delay6 = 0D000h delay3 = 4FFFh delay4 = 0D000h delay1 = 07FFh delay2 = 0D000h nilai7seg db 0 nilai7segdown db 99h portdata = 0378h portcontrol = 037Ah portstatus = 0379h datcont db 0Ch,00h,06h,05h datstat db 38h,58h,68h,70h control db 0 status db 0 counter dw 0 .code main PROC mov ax,@data mov ds,ax mov al,00h mov dx,portcontrol out dx,al or al,0Bh mov control,al out dx,al start: push ax mov ax,delay1 call delayku pop ax call cekkeyboard mov al,control and al,0F0h mov bx,offset datcont mov si,counter or al,[bx+si] mov control,al mov dx,portcontrol out dx,al mov dx,portstatus in al,dx and al,78h mov status,al mov ax,counter cmp al,00h jz baris1 cmp al,01h jz baris2 cmp al,02h jz baris3 cmp al,03h jz baris4 selesaicek: inc counter

cmp counter,4 jb selesai mov counter,0 selesai: jmp start baris1: mov ah,status mov bx,offset datstat cmp ah,[bx+0] jz cek1status1 cmp ah,[bx+1] jz cek1status2 cmp ah,[bx+2] jz cek1status3 cmp ah,[bx+3] jz cek1status4 endcheck1: jmp selesaicek cek1status1: push ax xor ax,ax mov dx,378h out dx,al pop ax jmp endcheck1 cek1status2: pop ax jmp endcheck1 cek1status3: pop ax jmp endcheck1 cek1status4: pop ax jmp endcheck1 baris2: mov ah,status mov bx,offset datstat cmp ah,[bx+0] jz cek2status1 cmp ah,[bx+1] jz cek2status2 cmp ah,[bx+2] jz cek2status3 cmp ah,[bx+3] jz cek2status4 endcheck2: jmp selesaicek cek2status1: push ax mov al,9 xor ah,ah call clrscr mov dx,1010h call gotoxy

call writedec pop ax jmp endcheck2 cek2status2: push ax mov dx,378h out dx,al pop ax jmp endcheck2 cek2status3: pop ax jmp endcheck2 cek2status4: pop ax jmp endcheck2 baris3: mov ah,status mov bx,offset datstat cmp ah,[bx+0] jz cek3status1 cmp ah,[bx+1] jz cek3status2 cmp ah,[bx+2] jz cek3status3 cmp ah,[bx+3] jz cek3status4 endcheck3: jmp selesaicek cek3status1: pop ax jmp endcheck3 cek3status2: pop ax jmp endcheck3 cek3status3: mov dx,378h xor ax,ax mov al,99h out dx,al mulai1: mov dl,nilai7segdown mov dh,dl and dl,0Fh and dh,0F0h mov al,dl sub al,dh push dx mov dx,378h out dx,al call writedec

pop dec cmp jnz mov sub

dx dl dl,0FFh akhir dl,09h dh,10h

akhir1: mov al,dl add al,dh mov nilai7segdown,al call cekkeyboard push ax mov ax,delay5 call delay2ku pop ax jmp mulai1 delay2ku PROC push cx mov cx,ax delay2ku1:push cx mov cx,delay6 delay2ku2:loop delay2ku2 pop cx loop delay2ku1 pop cx ret delay2ku ENDP

pop ax jmp endcheck3 cek3status4: jmp endcheck3 baris4: mov ah,status mov bx,offset datstat cmp ah,[bx+0] jz cek4status1 cmp ah,[bx+1] jz cek4status2 cmp ah,[bx+2] jz cek4status3 cmp ah,[bx+3] jz cek4status4 endcheck4: jmp selesaicek cek4status1: push ax mov al,3 xor ah,ah call clrscr mov dx,1010h call gotoxy call writedec

pop ax jmp endcheck4 cek4status2: pop ax jmp endcheck4 cek4status3: pop ax jmp endcheck4 cek4status4: mov dx,378h xor ax,ax mov al,00h out dx,al mulai: mov dl,nilai7seg mov dh,dl and dl,0Fh and dh,0F0h mov al,dl add al,dh push dx mov dx,378h out dx,al call writedec pop dx inc dl cmp dl,0Ah jnz akhir mov dl,00h add dh,10h akhir: mov al,dl add al,dh mov nilai7seg,al call cekkeyboard push ax mov ax,delay3 call delay1ku pop ax jmp mulai delay1ku PROC push cx mov cx,ax delay1ku1:push cx mov cx,delay4 delay1ku2:loop delay1ku2 pop cx loop delay1ku1 pop cx ret delay1ku ENDP pop ax

jmp endcheck4 delayku PROC push cx mov cx,ax delayku1:push cx mov cx,delay2 delay1ku2:loop delay1ku2 pop cx loop delayku1 pop cx ret delayku ENDP cekkeyboard PROC push ax mov ah,11h int 16h jz outbound mov ah,10h int 16h cmp al,ESCkey je kuit outbound: pop ax ret kuit:exit cekkeyboard ENDP main ENDP END main

You might also like