-

start: mov ds,cs ;data segment same as code segment
jmp goahd ;go ahead jump around defines

filename: db 'ex020100.log',0 ;8 = fundamental file name December 2001.
no0: db ' Test 24 hours Microsoft Counter number of various hits',0
no1: db ' Number of index page hits in Microsoft Counts is: ',0
no2: db ' Press the ESC or the A key to return the DOS> prompt.',0
no3: db ' Number of zipped downloads in Microsoft Counts is: ',0
no4: db ' Press two keys 01 to 31 for the day of the month: ',0
no5: db ' Three speaker beeps if NO SUCH file & start over ',0

dezmal: db 18 dup(0) ;save counts in CX to ASCII
savds: dw 0 ;save data segment 5K to 9K
count: dw 0 ;counts from segments 5K - 9K
inseg: dw 0ffffh ;do ALL 8 SEGS 65535

goahd: mov ax,3 ;reset video to text mode
int 10h ;to clear the screen
call cursof ;turn off the cursor
mov es,0b800h ;text mode video memory
call blakpaj ;black background
mov di,no0 ;message 0 above
mov si,180 ;2nd line of video from top
call display ;display it
mov di,no1 ;message 1 above
mov si,500 ;4th line of video from top
call display ;display it
mov di,no3 ;message 3 above
mov si,820 ;6th line of video
call display ;display it
mov di,no2 ;message 2 above
mov si,1140 ;8th line of video from top
call display ;display it
mov di,no5 ;message 5 above
mov si,1780 ;10th line of video from top
call display ;display it

setup: call clrmem ;zero out seg 5K 6K 7K 8K 9K
call getdic ;ex000xxx.log file to segs 5K-9K
call countdex ;count number of index. in log file
; call zountzip ;count number of .zip in log file
jmp setup

countdex: mov ax,0 ;zero
mov [count],ax ;zero out count
mov ax,0 ;make
mov [count],ax ;sure
jmp $+2 ;slow down
call clrdez ;zero out dezmal stash
mov bp,8 ;search 8 segments for index. files
mov dx,1 ;add 1 to counts
mov si,2000h ;start segment
mov [savds],si ;save start in segment 2000h
mov ds,si ;set data segment
count1: mov di,0 ;start at zero
mov cs:cx,[inseg] ;number to search minus 1 in segment
mov bl,65h ;e as in index
mov bh,78h ;x as in index
coundex: mov ax,[di] ;get word
inc di ;next one
cmp ax,bx ;ex ?
if nz jmp count2 ;if nz ignore
mov al,2eh ;period .
cmp [di+1],al ;period ex. ? as in index. <----
if z add cs:[count],dx ;if so add it to count
count2: loop coundex ;continue till CX = zero
dec bp ;5 segments counter 5K 6K 7K 8K 9K
cmp bp,0
jz count3
add cs:[savds],1000h ;next 65K segment
mov ds,cs:[savds] ;save data segment
jmp count1 ;continue counting
count3: mov ds,cs ;data segment = code segment
call clrvid1 ;erase previous index count
mov cx,[count] ;number of .htm page found
call ascii ;convert CX to ASCII
mov di,dezmal ;stash ASCII number in dezmal
mov si,608 ;video mem to display number
call display ;display number
mov [inseg] w,0ffffh
ret ;all done

zountzip: mov ax,0 ;zero
mov cs:[count],ax ;zero out
mov ax,0
mov [count],ax
call clrdez ;zero out dezmal stash
mov bp,8 ;search 8 segments for .zip files
mov dx,1 ;add 1 to count:
mov si,2000h ;start segment
mov [savds],si ;save start in segment 2000h
mov ds,si ;set data segment
zount1: mov di,0 ;start at zero in segment
mov cx,0ffffh ;number to search minus 1 in segment
mov bl,7ah ;z as in .zip
mov bh,69h ;i as in .zip
zountht: mov ax,[di] ;get word
inc di ;next one
cmp ax,bx ;zi ? as in zip
if nz jmp zount2 ;if nz ignore
mov al,70h ;p as in .zip
cmp [di+1],al ;test p as in zip <----
if z add cs:[count],dx ;if so add it to count
zount2: loop zountht ;continue till CX = zero
dec bp ;5 segments counter 5K 6K 7K 8K 9K
cmp bp,0
jz zount3 ;if zero = all done
add cs:[savds], 1000h ;next 65K segment
mov ds,cs:[savds] ;save data segment
jmp zount1 ;continue counting
zount3: mov ds,cs ;data segment = code segment
call clrvid2 ;clear number in video memory
mov cx,[count] ;number of .zip found
call ascii ;convert CX to ASCII
mov di,dezmal ;stash number in dezmal
mov si,928 ;video mem to display number
call display ;display number
ret ;all done

clrdez: mov di,dezmal ;convert cx to ascii stash
mov cx,7 ;4 words = 8 bytes
mov ax,0 ;zero out
clrd: mov [di],ax ;2 bytes
add di,2 ;next 2
loop clrd ;continue til cx zero
ret ;return whence called

clrvid1: mov si,606 ;608
jmp clrvid

clrvid2: mov si,926 ;928 ;video memory location
clrvid: mov al,20h ;space
mov ah,7 ;black background
mov es:[si],ax ;set it
mov es:[si+2],ax ;set it
mov es:[si+4],ax ;set it
mov es:[si+6],ax ;set it
ret ;all done



clrmem: mov ds,2000h ;zero out segments 2K-9K
mov cx,32768
mov di,0
mov ax,0
clr2: mov [di],ax
add di,2
loop clr2
mov ds,3000h
mov cx,32768
mov di,0
clr3: mov [di],ax
add di,2
loop clr3
mov ds,4000h
mov cx,32768
mov di,0
clr4: mov [di],ax
add di,2
loop clr4
mov ds,5000h
mov cx,32768 ;ALL of segment 9K
mov di,0
clr5: mov [di],ax
add di,2
loop clr5
mov ds,6000h
mov cx,32768
mov di,0
clr6: mov [di],ax
add di,2
loop clr6
mov ds,7000h
mov cx,32768
mov di,0
clr7: mov [di],ax
add di,2
loop clr7
mov ds,8000h
mov cx,32768
mov di,0
clr8: mov [di],ax
add di,2
loop clr8
mov ds,9000h
mov cx,32768 ;ALL of segment 9K
mov di,0
;clr9: mov [di],ax
; add di,2
; loop clr9
mov ds,cs
ret ;all done

blakpaj: mov cx,2000 ;number bytes per screen - does x2
mov ah,0 ;black
mov al,20h ;space
mov di,0 ;start at top
b2: mov es:[di],ax ;display it
add di,2 ;next video location
loop b2 ;continue till cx zero
ret ;all done

exit2: popa ;adjust stack exit to DOS> prompt
exit: call beep ;beep the PC speaker
call delay ;delay 2 seconds to demo delay
call curson ;restore the cursor
mov ax,3 ;reset video =
int 10h ;clear the screen
mov ax,4c00h ;exit pointer
int 21h ;return to DOS> prompt

display: mov al,[di] ;get ASCII byte
cmp al,0 ;the end ?
if z ret ;return after call if all done
mov ah,7h ;black backgnd w/med. white letter
inc di ;next byte to display
mov es:[si],ax ;display byte and attribute on video
add si,2 ;requires 2 bytes
jmp display ;go do next one

curson: mov cx,11 ;cursor video bios display
curs: mov bh,0 ;this part
mov ah,1 ;of video
int 10h ;do it
ret ;return to instruction after call
cursof: mov cx,0e00h ;cursor video move out of sight
jmp curs ;continue

delay: pusha ;save registers
mov ah,0 ;read time of day counter
int 1ah ;get time of day counter
add dx,36 ;duration of delay = about 2 seconds
mov bx,dx ;bx = dx
l1: int 1ah ;get counter
cmp dx,bx ;compare delay
jne l1 ;wait till equal
popa ;restore registers
ret ;return whence called

delay2: pusha ;save registers
mov ah,0 ;read time of day counter
int 1ah ;get time of day counter
add dx,9 ;duration of delay=about 1/2 second
mov bx,dx ;bx = dx
l1: int 1ah ;get counter
cmp dx,bx ;compare delay
jne l1 ;wait till equal
popa ;restore registers
ret ;return whence called

;old 1981 subroutine
beep: pusha ;internal PC speaker LOUD beep
cli ;clear interrupts
mov dx,535 ;beep loudness - higher = quieter
mov al,0b6h ;10110110 binary
out 43h,al ;program. int timer ctl word port
mov al,dl ;al = dl
out 42h,al ;program. int timer misc. reg port
mov al,dh ;al = dh
out 42h,al ;program. int timer misc. reg port
in al,61h ;read port 61h 8042 ctrl reg
mov ah,al ;ah = al
or al,3 ;or al 00000011 binary
out 61h,al ;write port 61h 8042 ctrl reg
mov ah,0 ;set read time of day counter
int 1ah ;get time of day counter
add dx,4 ;duration of beep
mov bx,dx ;bx = dx
l3: int 1ah ;get counter
cmp dx,bx ;compare delay
jne l3 ;wait till equal
mov al,ah ;al = ah
out 61h,al ;write port 61h 8042 ctrl reg
sti ;set interrupts
eep: mov ah,1 ;wait for key release
int 16h ;test key pressed
jnz releez ;nz = key still pressed
popa ;restore stack
ret ;return
releez: mov ah,0 ;clear
int 16h ;key buffer
jmp eep ;go test again

NOSUPR: DB 0

ASCII: PUSHA ;CONV CX TO ASCII DECIMAL STRING
MOV DS,CS ;old 1977 Z80 converted to Intel
MOV DI,DEZMAL ;study it
MOV SI,MULT1
Z1: XOR AL,AL
MOV DH,[SI+1]
MOV DL,[SI]
Z2: OR AL,AL
SUB CX,DX
JC >Z3
INC AL
JMP Z2
Z3: ADD CX,DX
ADD AL,48
CMP AL,48
JZ SUPRES
PUSH AX
MOV AL,1
MOV [NOSUPR],AL
Z4: POP AX
MOV [DI],AL
INC DI
Z5: ADD SI,2
MOV AL,1
CMP AL,DL
JZ >Z6
JMP Z1
Z6: MOV AL,[NOSUPR]
CMP AL,0
IF Z CALL ZEROIT
XOR AL,AL
MOV [DI],AL
MOV [NOSUPR],AL
POPA
RET
SUPRES: PUSH AX
MOV AL,[NOSUPR]
CMP AL,0
JZ >Z7
JMP Z4
Z7: POP AX
JMP Z5
ZEROIT: MOV DI,DEZMAL
MOV [DI] B,48
INC DI
RET
MULT1: DW 10000
DW 1000
DW 100
DW 10
DW 1

;God damned crappy Microsoft NT Counter's results of everthing+kitchen sink

GETDIC: PUSHA ;SAVE EVERYTHING & KITCHEN SINK ON STACK
mov dx,0 ;zero
mov cs:[count],dx ;zero out count
MOV bp,7 ;8 ;UP TO NINE SEGMENTS WRITE - 1K thru 9K

mov di,no4 ;press two keys 01 to 31 for day of month
mov si,1460 ;display at video mem location
call display ;display it
mov ah,0 ;await first
int 16h ;key press
cmp ah,1 ;ESC key?
if z jmp exit2 ;go to DOS> prompt
cmp ah,1eh ;a or A key?
if z jmp exit2 ;go to DOS> prompt
cmp al,30h ;'0'
if b jmp nosuch ;3 beeps on speaker & start over
cmp al,33h ;'3'
if a jmp nosuch ;3 beeps pn speaker & start over
mov bl,al ;first digit
mov ah,7
mov es:[1566],ax

mov ah,0 ;await second
int 16h ;key press
cmp ah,1 ;ESC key?
if z jmp exit2 ;go to DOS> prompt
cmp ah,1eh ;a or A key?
if z jmp exit2 ;go to DOS> prompt
cmp al,30h ;'0'
if b jmp nosuch ;3 beeps on speaker & start over
mov bh,al ;second digit
mov ah,7 ;black background
mov es:[1568],ax ;video mem display number

ok1: mov si,filename
mov [si+6],bx

pusha ;all
call beep ;beep speaker
popa ;restore all registers

MOV DX,FILENAME ;FUNDAMENTAL FILE DATE FOR MONTH
MOV AX,3D02H ;OPEN FILE
INT 21H ;DO IT
IF C JMP NOSUCH ;IF CARRY DISPLAY "NO SUCH FILE"
MOV BX,AX ;HANDLE IN BX
MOV [SAVDS],2000H ;START AT SEGMENT 2000H
GETD: CALL LOADIT ;LOAD'EM INTO MEMORY - ALL 65,536 BYTES
ADD CS:[SAVDS],1000H ;USE UP TO PART SEGMENT 9000H
DEC BP ;SEGMENT COUNTER
JNZ GETD ;GET NEXT SEGMENT
MOV DS,CS ;PUSH CS - POP DS SETS DATA SEG = CODE SEG
POPA ;RESTORE ALL
call delay ;2 second delay
RET ;ALL DONE

LOADIT: MOV DS,CS:[SAVDS] ;GET NEXT SEGMENT
MOV CX,0FFFFH ;ALL BUT LAST BYTE OF SEGMENT
MOV DX,0 ;START AT BEGINNING OF SEGMENT
MOV AX,3F00H ;READ FILE AND WRITE TO MEM INSTRUCTION
INT 21H ;DO IT
NOP ;SLOW DOWN
MOV AX,3F00H ;READ FILE AND WRITE TO MEM
MOV CX,1 ;ONLY 1 BYTE
MOV DX,0FFFFH ;READ FILE LAST BYTE AND
INT 21H ;WRITE IT TO LAST BYTE IN THE SEGMENT
RET ;RETURN WHENCE CALLED

NOSUCH: POPA
MOV DS,CS
CALL BEEP
CALL DELAY2
CALL BEEP
CALL DELAY2
CALL BEEP
JMP SETUP


elfin: ;the end in Espanol
michael kors cyber monday uggs cyber monday michael kors black friday michael kors black friday michael kors black friday michael kors cyber monday michael kors cyber monday uggs cyber monday michael kors cyber monday uggs cyber monday uggs black friday uggs black friday uggs black friday uggs cyber monday uggs black friday uggs black friday north face black friday north face black friday north face cyber monday north face black friday michael kors black Friday michael kors black Friday uggs cyber monday uggs black friday uggs black friday uggs black friday uggs black friday uggs cyber monday uggs cyber monday uggs cyber monday north face black friday michael kors cyber Monday michael kors cyber Monday beats by dre cyber Monday beats by dre black friday beats by dre black Friday beats by dre cyber Monday north face black friday michael kors black friday north face black friday north face black friday uggs black friday michael kors cyber Monday uggs black friday michael kors black Friday michael kors cyber Monday beats by dre black Friday sale Uggs cyber monday north face cyber monday deals michael kors black Friday uggs cyber monday north face cyber monday Designer handbags black friday michael kors black Friday beats by dre cyber Monday Oakley black Friday canada goose black friday north face cyber monday deals uggs black friday bose cyber monday canada goose black friday michael kors cyber Monday michael kors black Friday beats by dre black Friday uggs black friday north face cyber monday lululemon cyber monday michael kors cyber Monday uggs black friday canada goose black friday tory burch black Friday uggs cyber monday uggs black friday michael kors cyber Monday black friday jordans moncler black friday uggs cyber monday uggs cyber monday uggs black friday the north face black friday michael kors black Friday nike black friday nike black friday michael kors cyber Monday uggs black friday michael kors black Friday beats by dre black Friday sale michael kors black Friday nike cyber monday north face black friday michael kors black friday michael kors cyber monday uggs black Friday michael kors black friday uggs cyber monday north face cyber Monday coach black Friday uggs black friday coach black Friday louis vuitton cyber monday uggs black Friday louis vuitton cyber monday uggs black friday canada goose cyber monday coach cyber monday uggs black friday beats by dre black Friday louis vuitton black friday michael kors cyber monday michael kors black Friday hollister black friday Abercrombie and fitch cyber monday moncler cyber monday hollister black friday hollister black friday Oakley black friday Ray Ban cyber monday Tiffany black friday tory burch cyber monday Babyliss black friday michael kors black friday michael kors Black Friday michael kors black friday michael kors Black Friday michael kors Black Friday michael kors Black Friday legend blue 11s legend blue 11s jordan 11 legend blue black infrared 23 13s legend blue 11s black infrared 13s black infrared 23 13s jordan 11 legend blue legend blue 11s legend blue 11s jordan 11 legend blue legend blue 11s jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue legend blue 11s jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue legend blue 11s jordan 11 legend blue legend blue 11s jordan 13 black infrared 23 jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue legend blue 11s jordan 11 legend blue jordan 13 black infrared 23 jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue legend blue 11s black infrared 13s jordan 11 legend blue legend blue 11s legend blue 11s jordan 11 legend blue jordan 11 legend blue