-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTRIBUTE.ASM
113 lines (113 loc) · 1.33 KB
/
TRIBUTE.ASM
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
use16
org 0x100
MOV AX,0x0003
INT 0x10
MOV AX,0x21E0
MOV CX,AX
MOV AL,182
OUT 43H,AL
MOV AX,CX
OUT 42H,AL
MOV AL,AH
OUT 42H,AL
IN AL,61H
OR AL,03H
OUT 61H,AL
MOV SI,PAYLOAD
PUSH WORD 0x0B800
POP ES
XOR DI,DI
MOV CX,0x03BF
PUSH SI
XOR DX,DX
JCXZ Done
XOR AX,AX
CLD
LOOPA:LODSB
CMP AL,32
JC ForeGround
STOSW
Next:LOOP LOOPA
JMP Done
ForeGround:
CMP AL,16
JNC BackGround
AND AH,0F0H
OR AH,AL
JMP Next
BackGround:
CMP AL,24
JZ NextLine
JNC FlashBitToggle
SUB AL,16
ADD AL,AL
ADD AL,AL
ADD AL,AL
ADD AL,AL
AND AH,8FH
OR AH,AL
JMP Next
NextLine:
ADD DX,160
MOV DI,DX
JMP Next
FlashBitToggle:
CMP AL,27
JC MultiOutput
JNZ Next
XOR AH,128
JMP Next
MultiOutput:
CMP AL,25
MOV BX,CX
LODSB
MOV CL,AL
MOV AL,32
JZ StartOutput
LODSB
DEC BX
StartOutput:
XOR CH,CH
INC CX
REP STOSW
MOV CX,BX
DEC CX
LOOPNZ LOOPA
Done:
mov cx,0x0020
new_shot:
push cx
mov dx,0140h
mov bx,0100h
in al,061h
and al,11111100b
fire_shot:
xor al,2
out 061h,al
add dx,09248h
mov cl,3
ror dx,cl
mov cx,dx
and cx,01FFh
or cx,10
shoot_pause:
loop shoot_pause
dec bx
jnz fire_shot
and al,11111100b
out 061h,al
mov bx,0002h
xor ah,ah
int 1Ah
add bx,dx
shoot_delay:
int 0x1A
cmp dx,bx
jne shoot_delay
pop cx
loop new_shot
mov AX,0x0003
int 0x10
MOV AX,0x4C00
INT 0x21
PAYLOAD FILE 'PAYLOAD.BIN'