; Compilado con el MASM 5.0 de microsoft
; Muestra el código hexadecimal y decimal de un segmento deseado
; Funciona creando un fichero .exe con el LINK de microsoft luego de compilado con el
; MASM.
;
;Para más información caribbeansoft@excite.com
page 200,80
alfa segment para public 'code'
org 0100h
assume cs:alfa,es:alfa,ds:alfa,ss:alfa
inicio proc near
jmp muestra
reservados db 30 ('a')
char1:
mov bx,0b800h
mov ds,bx
pos7: mov [si],ax ;imprime un caracter tantas veces CX
inc si ;el codigo en ah y atributo en al
inc si
loop pos7
retornar:
ret
;******************************************************
muestra:
mov ax,0003h
int 10h
mov si,0016h
mov cx,0010h
pos68: push cx
mov bx,0010h
xchg bx,cx
sub cx,bx
mov ax,cx
xchg ah,al
call hexaBYTE
pop cx
inc si
inc si
loop pos68
mov cx,0050h
mov si,00a0h
mov ax,1e3dh
call char1
cld
; mov es,cs:begin
xor ax,ax
mov es,ax ; SEGMENTO DESEADO A OBSERVAR
pos105:
mov di,0000h
posw2:
mov si,0140h
mov cx,0015h
CALL POS70
denuevo:
call readKEY
jcxz denuevo
cmp ch,48h
jz llamarmovUP
cmp ch,50h
jz llamarmovDOW
cmp ch,51h
jz pgdn
cmp ch,49h
jz pgup
chequeo1:
cmp ch,3ch
jz exit
cmp ch,3dh
jnz denuevo
exit:
mov ax,4c00h
int 21h
llamarmovUP:
; push es
; push di
call movUP
; pop di
; pop es
mov cx,0001h
sub di,160h
push di
; inc si
; inc si
mov si,0140h
call pos70
pop di
add di,150h
jmp denuevo
PGUP:
sub di,02a0h
PGDN:
mov cx,0015h
mov si,0140h
call pos70
jmp denuevo
llamarmovDOW:
; push es
; push di
call movDOW
; pop di
; pop es
mov cx,0001h
mov si,0dc0h
; sub si,00a0h
call POS70
jmp denuevo
hexaBYTE:
mov cx,0002h
call hexa
RET
hexaWORD:
mov cx,0004h
call hexa
RET
hexa:
mov dx,0b800h
mov ds,dx
pos65: push cx
mov dx,ax
mov cl,4
and dx,0f000h
shr dh,cl
cmp dh,09h
jg suma
call print10
bucleHEXA:
shl ax,cl
pop cx
loop pos65
RET
suma:
add dh,37h
call print16
jmp bucleHEXA
print10:
add dh,30h
print16:
mov [si],dh
inc si
inc si
RET
;_____________________________________________________________________
; Verifica si se pulso una ,en caso + lee esa tecla(getKEY)
readkey:
mov ah,01h
int 16h
jnz getKEY ;se pulso una tecla
xor cx,cx
RET
getKEY:
mov ah,00
int 16h
mov cx,ax
RET
;_______________________________________________________________
;borra la primera linea de la pantalla al desplazar esta hacia
;arriba rellenando la ultima linea de espacios en blanco
movDOW:
mov ax,0601h
mov cx,0200h
mov dx,164fh
mov bh,17h
int 10h
ret
;_____________________________________________________________
;abajo y rellena la primera de espacios en blanco
movUP:
mov ax,0701h
mov cx,0200h
mov dx,164fh
mov bh,17h
int 10h
ret
mov bx,0b800h
mov es,bx
mov ds,bx
std
mov si,0dbeh ;efe e5e
mov di,0e5eh ;f9e efe
mov cx,0640h ;(780) 6e0
pos42: movsw
loop pos42
mov di,01deh ;(9e)
mov cx,0050h
mov ax,1720h
pos43: stosw
loop pos43
RET
;_______________________________________________________________
; Imprime CX veces lineas en la pantalla ,donde cada linea
; comienza con seg:offset , seguido del contenido de las primeras
; 16 posiciones a partir de ese offset ,seguido del contenido de
; cada posicion en decimal ,ademas en (SI) la posicion de la
; pantalla donde comenzara a imprimirse lo descrito anteriormente
; y en DI de donde leera a paritir de esa posicion indicando ES
;el segmento a rastrear y DS con B800h
pos70: push cx
push si
; mov ax,cs:begin
mov ax,0000h
call hexaWORD
mov dh,3ah
call print16
mov ax,di
call hexaWORD
inc si
inc si
inc si
inc si
push di
mov cx,0010h
push cx
pos66: push cx
mov ah,es:[di]
call hexaBYTE
pop cx
inc di
inc si
inc si
loop pos66
pop cx
pop di
inc si
inc si
inc si
inc si
pos67: mov dh,es:[di]
call print16
inc di
loop pos67
pop si
add si,00a0h
pop cx
loop pos70
RET
inicio endp
alfa ends
end inicio
Comentarios sobre la versión: Versión 1 (0)
No hay comentarios