Paste: aaa

Author: aaa
Mode: assembly-x86
Date: Sat, 17 Jan 2009 17:19:20
Plain Text |
lee_puertoCOM proc near
	push es ax
	mov ax,40h
	mov es,ax
	mov ax,es:[0]
	mov puerto,ax
	pop ax es
	ret
lee_puertoCOM endp

inhabilita_ints proc near
	push ax dx
	mov dx,puerto
	inc dx
	in al,dx
	mov interrs,al
	pop dx ax
	ret
inhabilita_ints endp

restaura_ints proc near
	push ax,dx
	mov dx,puerto
	inc dx
	mov al,interrs
	out dx,al
	pop dx ax
	ret
restaura_ints endp

sacar_bloqueCOM proc near
	push ax cx dx si
	xor si,si
	mov cx,tam_leido
seg
sacar_bloqueCOM endp

lee_bloque proc
	push ax cx dx si ds
	mov ax,data
	mov ds,ax
	xor si,si ;indice
	mov dx,puerto
	add dx,5	;LSR
seg6:
	in al,dx
	test al,00100000b ;THR vacio?
	jz seg6
	mov dx,puerto ; THR 
	mov al,CTRL_Q ; envia el emisor
	out dx,al
	mov cx,a_escribir
	dec cx
	mov dx,puerto
seg7:
	add dx,5 ;LSR
seg8:
	in al,dx	;leo estado
	test al,00000001b	; dato recibido
	jz seg8
	mov dx,puerto	;rdr
	in al,dx	;leo buffer lectua
	mov ds:[si],al
	inc si
	loop seg7
	mov dx,puerto
	add dx,5	;lsr
seg9:
	in al,dx
	test al,00100000b ;thr vacio
	jz seg9
	mov dx,puerto	;thr
	mov al, ctrl_s	;para el emisor
	out dx,al
	mov dx,puerto	;lsr
	add dx,5
segA:
	in al,dx
	test al,0000001b
	jz segA
	mov dx,puerto ;rdr
	in al,dx
	mov ds:[si],al
	pop ds si dx cx ax
	ret
lee_bloque endp

New Annotation

Summary:
Author:
Mode:
Body: