-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSKEETER.ASM.OLD.TXT
57 lines (55 loc) · 1.57 KB
/
SKEETER.ASM.OLD.TXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; setup block
use16
org 100h
mov cx,0x0004
; end
; this code block harvested from an old dos virus
new_shot:
push cx ; Save the current count
mov dx,0x0BBE ; DX holds pitch
mov bx,0xCCFB ; BX holds shot duration
in al,061h ; Read the speaker port
and al,11111100b ; Turn off the speaker bit
fire_shot:
xor al,2 ; Toggle the speaker bit
out 061h,al ; Write AL to speaker port
mov cl,3 ;
ror dx,cl ; Figure out the delay time
mov cx,dx ;
and cx,01FFh ;
or cx,10 ;
shoot_pause:
loop shoot_pause ; Delay a bit
dec bx ; Are we done with the shot?
jnz fire_shot ; If not, pulse the speaker
and al,11111100b ; Turn off the speaker bit
out 061h,al ; Write AL to speaker port
mov bx,0002h ; BX holds delay time (ticks)
xor ah,ah ; Get time function
int 1Ah ; BIOS timer interrupt
add bx,dx ; Add current time to delay
shoot_delay:
int 1Ah ; Get the time again
cmp dx,bx ; Are we done yet?
jne shoot_delay ; If not, keep checking
pop cx ; Restore the count
loop new_shot ; Do another shot
; end sound block
; never the same color routine
mov ax,0x0003 ; RESET VIDEO MODE
int 0x10 ; RESET VIDEO MODE
xor ax,ax
int 1Ah
xchg dx,bx
mov ah,0x06 ; ah to 6h
xor cx,cx ; cx to zero
mov dx,0x184f
int 10h
; end
; print and exit
mov dx,text
mov ah,0x09
int 21h
ret
text db "Fuck, man! Shit! Mosquitoes!",0x24
; EOF