反汇编的3D迷宫源码
.386
.model tiny
code segment
assume cs:code, ds:code
org 100h
public start
start proc near
finit
mov al, 13h
int 10h ; - VIDEO -
mov si, 1F0h
fild word ptr [si-5Dh]
fld st
fld st
mov dx, 3C8h
xor ax, ax
out dx, al
inc dx
@118:
out dx, al
out dx, al
out dx, al
inc al
jnz short @118
mov di, 200h
xor bx, bx
@124:
mov ax, bx
inc bx
shl al, 4
shr ax, 4
bt [si], ax
rcl al, 1
jb short @13B
mov cx, 10h
rep stosb
jmp short @124
@13B:
push 0A000h
pop es
assume es:nothing
@13F:
mov dx, 3DAh
@142: ; Video status bits:
in al, dx ; 0: retrace. 1=display is in vert or horiz retrace.
; 1: 1=light pen is triggered; 0=armed
; 2: 1=light pen switch is open; 0=closed
; 3: 1=vertical sync pulse is occurring.
and al, 8
jz short @142
mov di, 13Eh
@14A:
mov ax, di
sub ax, 0A0h
mov [si], ax
fild word ptr [si]
fidiv word ptr [si-2]
fadd st, st(1)
fsincos
fld1
fadd st, st
fdiv st(1), st
fdivp st(2), st
fld st(4)
fld st(4)
mov cx, 1
@169:
fist word ptr [si]
mov bl, [si]
fadd st, st(2)
fxch st(1)
fist word ptr [si]
mov bh, [si]
fadd st, st(3)
fxch st(1)
inc cx
test byte ptr [bx], 1
jz short @169
fcompp st(1), st
fcompp st(1), st
add bl, bh
shl bl, 3
mov ax, 1000h
cwd
div cx
cwd
shl cx, 2
sub ax, 64h
jle short @19B
imul ax, cx
xchg ax, dx
@19B:
push di
@19C:
xor bh, bh
or ax, ax
jl short @1AE
mov bh, 80h
cmp dh, bh
ja short @1AE
mov bh, dh
add dx, cx
xor bh, bl
@1AE:
shr bh, 2
inc ax
mov es:[di], bh
add di, 140h
jnb short @19C
pop di
dec di
jnz short @14A
in al, 60h ; AT Keyboard controller 8042.
pusha
mov ax, 0C00h
int 21h ; DOS - CLEAR KEYBOARD BUFFER
; AL must be 01h, 06h, 07h, 08h, or 0Ah.
popa
cmp al, 4Bh
jnz short @1CF
fsub dword ptr [si-6]
@1CF:
cmp al, 4Dh
jnz short @1D6
fadd dword ptr [si-6]
@1D6:
cmp al, 48h
jnz short @1E2
fld st
fsincos
faddp st(3), st
faddp st(3), st
@1E2:
cmp al, 1
jz short locret_1E9
jmp @13F
locret_1E9:
retn
start endp
db 0Ah, 0D7h, 23h, 3Dh, 97h, 1, 2 dup(0FFh)
db 11h, 80h, 0C5h, 9Bh, 71h, 98h, 1Dh, 8Dh
db 31h, 0AAh, 5, 80h, 2 dup(0FFh)
code ends
end start