Demo entry 6684644

4

   

Submitted by anonymous on Dec 16, 2017 at 15:18
Language: NASM. Code size: 1.1 kB.

data segment
io8255a equ 28ah
io8255b equ 28bh
io8255c equ 288h
led	db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh;¶ÎÂë
buffer1 db 0,0
bz	dw ?
data ends
code segment
assume cs:code,ds:data
	start:mov ax,data
	 	mov  ds,ax
		mov dx,io8255b	
		mov al,80h
		out dx,al
		mov di,offset buffer1
	loop1:  mov cx,030h
	loop2:  mov bh,02
	s111: 	mov byte ptr bz,bh
		push di
		dec di
		add di,bz
		mov bl,[di]
		pop di
		mov bh,0
		mov si,offset led
		add si,bx
		mov al,byte ptr [si]
		mov dx,io8255c
		out dx,al
		mov al,byte ptr bz
		mov dx,io8255a
		out dx,al
		push cx
		mov cx,100
	delay:  loop delay
		pop cx
		mov al,00h
		out dx,al
		mov bh,byte ptr bz
		shr bh,1
		jnz s111
		loop loop2
		mov ax,word ptr [di]
		cmp ah,09
		jnz set
		cmp al,09
		jnz set
		mov ax,0000
		mov [di],al
		mov [di+1],ah
		jmp loop1
	set:    mov ah,01
		int 16h
 		jne exit
		mov ax,word ptr [di]
		inc al
		aaa
		mov [di],al
		mov [di+1],ah
		jmp loop1
	exit:  	mov dx,io8255a
		mov al,0
		out dx,al
		mov ah,4ch
		int 21h
code ends
	end start
		

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).