www.pudn.com > schddog.zip > ZKPASS1.ASM


.MODEL tiny 
.CODE 
DISKIO equ 13h 
VIDEO equ 10h 
      org 200h 
GetPassWord proc 
PassBegin: 
MyRoutine: 
     push cs 
     pop ds 
     mov di,offset HeadMsg 
     call Put_Str 
     mov cx,10000 
$l1: 
     nop 
     loop $l1 
     ret 
Put_Str proc 
     mov al,cs:[di] 
     cmp al,"$" 
     je A1 
     mov ah,0eh 
     mov bx,0003h 
     int video 
     inc di 
     jmp Put_Str 
A1:  ret 
Put_Str endp 
     HeadMsg db "Waking up Babysoft-HDDOG... ok.",0ah,0dh,0ah,0dh,'$' 
PassTail: 
     PassLen equ 1024-(PassTail-PassBegin) 
             db PassLen dup(0) 
GetPassword endp 
     org 600h 
GetPass Proc 
PBegin: 
     push ax 
     push cx 
     push ds 
     push es 
     push si 
     push di 
     mov ax,9f80h 
     mov ds,ax 
     mov es,ax 
     mov di,offset PSWBuffer 
     call ReadStr 
     mov si,offset PSWBuffer 
     mov di,offset Password 
     mov cl,byte ptr [di] 
     mov ch,byte ptr [si] 
     cmp cl,ch 
     jnz $t1 
     xor ch,ch 
     repe cmpsb 
     mov ax,1075 
     mov cx,5 
     jz Right2 
$t1: 
     add ax,200 
     call Music 
     call Delay 
     loop $t1 
     call NoSound 
     pop di 
     pop si 
     pop es 
     pop ds 
     pop cx 
     pop ax 
     stc 
     ret 
Right2: 
     mov ax,2275 
$t4: 
     sub ax,200 
     call Music 
     call Delay 
     loop $t4 
     call NoSound 
     pop di 
     pop si 
     pop es 
     pop ds 
     pop cx 
     pop ax 
     clc 
     ret 
ReadStr proc near 
     push es 
     push di 
     inc di 
     mov Plength,0 
Next: 
     cmp PLength,15 
     jge @l1 
     mov ah,1 
     int 16h 
     jz Next 
     mov ax,0 
     int 16h 
     cmp al,0 
     je next 
     cmp al,08 
     je @l2 
     cmp al,13 
     je @l1 
     sub al,20 
     or al,80h 
     stosb 
     inc PLength 
     jmp next 
@l2: 
     cmp PLength,0 
     je next 
     dec di 
     mov al,00h 
     stosb 
     dec PLength 
     dec di 
     jmp next 
@l1: 
     pop di 
     mov al,byte ptr PLength 
     mov byte ptr [di],al 
     pop es 
     ret 
ReadStr endp 
timer2 equ 42h 
tim_ctr equ 43h 
port_b equ 61h 
Music Proc 
      push ax 
      mov al,10110110b  
      out tim_ctr,al 
      pop ax 
      out timer2,al 
      mov al,ah 
      out timer2,al 
      in al,port_b 
      or al,00000011b 
      out port_b,al 
      ret 
Music EndP 
NoSound proc 
      in al,port_b 
      and al,11111100b 
      out port_b,al 
      ret 
NoSound Endp 
Delay Proc 
      push si 
      mov si,0a000h 
@j1: 
      dec si 
      cmp si,0 
      jnz @j1 
      pop si 
      ret 
Delay Endp 
PLength db 0 
Ptail: 
RestLen equ 200h-(Ptail-PBegin)-32 
        db RestLen dup(0) 
        org PBegin+200h-32 
PASSWORD db 0,15 dup(0) 
PSWBuffer db 0,15 dup(1) 
GetPass endp 
	END