ברוכים הבאים לאתר תחרויות קודגורו! › פורומים › אקסטרים › 007Ninja
- This topic has תגובה 1, משתתף 1, and was last updated לפני 17 שנים, 9 חודשים by Spiritus.
-
מאתתגובות
-
25 בפברואר 2007 בשעה 08:43 #76957Spiritusמשתתף
Our survivor code:(compiles with nasm)
;007Ninja1
%define jumpOff 0x800
@code:
mov [si], word 0x1000
mov cx, cs
mov es, cx
mov bl, 0xEA
mov ch, 00
mov [si], ax
and ax, 0x0FFF
mov bh, al
mov cl, ah
add cl, 0xE0 ;to get proper address in seg 200
mov ax, 0xFEEB
int 0x87call @here
@here:pop ax
mov dx, ss
mov es, dx
mov si, ax
add si, @Shurikan-@here
mov cx, (@end-@Shurikan+1)/2
rep movswmov ds, dx
mov dx, cs
mov ss, dxsub ax, 0x1700+@here-@code
and al, 0x7
sub al, 0x8
mov dl, al
mov bh, ah ;store ah
mul dh ;multiplies al by ch(=0x10 from line 29(mov cx, cs=0x1000))
mov dh, 0x0F ;we want ch to be 0x0F, which is 0x10-1
mov ah, bh ;restore ah
mov sp, ax
mov al, 0xA3 ;movsw – 2
xor bh, bh ;bl is 0xEA, from line 10
mov [bx], ax
mov [bx+2], dx
mov di, ax
sub sp, 0x100-0xA3-jumpOff ;movsw – 2mov es, dx
xor si, si
mov ax, 0xCCCC
mov dx, axsub di, 0x200
int 0x86
int 0x86mov ax, 0x1FFF ;call far [bx]
stosw
dec dimov bp, jumpOff
call far [bx]@Shurikan:
movsw
movsw
mov cl, (@ShuEnd-@ShuMid)/2
rep movsw
@ShuMid:
sub [bx], bp
mov di, [bx]
movsw
dec di
xor si, si
call far [bx]
@ShuEnd:
call far [bx]
@end:;007Ninja2
%define opNum (jumpOff/4+shu1Num-shu2Num)/2
%define shu1Num 15
%define shu2Num 25
%define jumpOff 0x800
%define shootOff0 0x27D0
%define startOff0 ((opNum*(shootOff0-0x4)) % 0x10000)
%define shootOffd 0x160
%define startOffd (opNum*shootOffd)@code:
mov es, [si]
mov ax, 0xCC3D
mov dx, 0x75CC
mov bx, 0xFEEB
int 0x87xchg ax, [si]
mov bx, ax
and bx, 0x0FFF
call @here@zombStart:
mov si, word 0x0000
@putSI:
mov ax, word jumpOff+0x800
@putAX:
mov cl, 18
@a:
loop @a
jmp @start@here:
pop si
mov [bx], byte 0xEA ;jmp far …
mov [bx+1], si
mov [bx+3], word 0x1000
add [si+(@putSI-@zombStart)-2], si
add [si+(@putAX-@zombStart)-2], ax
mov [bx+1], word 0xCCCC
@start:
mov dx, ss
mov es, dx
add si, @Shurikan-@zombStart
xor di, di
mov cx, (@end-@Shurikan+1)/2
rep movswmov ds, dx
mov cx, cs
mov ss, cxsub ax, 0x500
and al, 7
sub al, 8
mov ch, 0x0F
mov cl, al
shl al, 1
shl al, 1
shl al, 1
shl al, 1
mov sp, ax
mov al, 0xA5-(@end-@ShuEnd) ;movsw
mov bx, 0x100
mov [bx], ax
mov [bx+2], cx
mov di, ax
sub sp, 0x100-0xA5+startOff0 ;movswmov es, cx
xor si, si
mov ax, 0xCCCC
mov dx, axint 0x86
int 0x86
sub di, 0x200mov ax, 0xD401 ;add sp, dx
stosw
mov ax, 0x1FFF ;call far [bx]
stosw
sub di, byte 3mov ax, startOff0+jumpOff-0x4
mov dx, shootOff0mov bp, jumpOff
xor cx, cx
call far [bx]
@Shurikan:
movsw
movsw
mov cl, (@ShuEnd-@ShuMid)/2
rep movsw
@ShuMid:
sub [bx], bp
add ax, startOffd
sub sp, ax
add dx, shootOffd
mov di, [bx]
movsw
movsw
sub di, byte 3
xor si, si
call far [bx]
@ShuEnd: ;this – ShuMid must be even
add sp, dx
call far [bx]
@end:We expect others to send their codes as well^^
25 בפברואר 2007 בשעה 08:48 #78376SpiritusמשתתףSorry, wrong version^^
;007Ninja1
%define jumpOff 0x800
@code:
mov [si], word 0x1000
mov cx, cs
mov es, cx
mov bl, 0xEA
mov ch, 00
mov [si], ax
and ax, 0x0FFF
mov bh, al
mov cl, ah
add cl, 0xE0 ;to get proper address in seg 200
mov ax, 0xFEEB
int 0x87call @here
@here:pop ax
mov dx, ss
mov es, dx
mov si, ax
add si, @Shurikan-@here
mov cx, (@end-@Shurikan+1)/2
rep movswmov ds, dx
mov cx, cs
mov ss, cxsub ax, 0x1700+@here-@code
and al, 0x7
sub al, 0x8
mov ch, 0x0F
mov cl, al
shl al, 1
shl al, 1
shl al, 1
shl al, 1
mov sp, ax
mov al, 0xA3 ;movsw – 2
mov bx, 0x100
mov [bx], ax
mov [bx+2], cx
mov di, ax
sub sp, 0x100-0xA3 ;movsw – 2mov es, cx
xor si, si
mov ax, 0xCCCC
mov dx, 0xCCCC
std
int 0x86
int 0x86
cld
add di, 0x200mov ax, 0x1FFF ;call far [bx]
stosw
dec dimov bp, jumpOff
add sp, bp
xor cx, cx
call far [bx]@Shurikan:
movsw
movsw
mov cl, (@ShuEnd-@ShuMid)/2
rep movsw
@ShuMid:
sub [bx], bp
mov di, [bx]
movsw
dec di
xor si, si
call far [bx]
@ShuEnd:
call far [bx]
@end:;007Ninja2
%define opNum (jumpOff/4+shu1Num-shu2Num)/2
%define shu1Num 15
%define shu2Num 25
%define jumpOff 0x800
%define shootOff0 0x27D0
%define startOff0 ((opNum*(shootOff0-0x4)) % 0x10000)
%define shootOffd 0x160
%define startOffd (opNum*shootOffd)@code:
mov es, [si]
mov ax, 0xCC3D
mov dx, 0x75CC
mov bx, 0xFEEB
int 0x87xchg ax, [si]
mov bx, ax
and bx, 0x0FFF
call @here@zombStart:
mov si, word 0x0000
@putSI:
mov ax, word jumpOff+0x800
@putAX:
mov cx, 17
@a:
loop @a
jmp @start@here:
pop si
mov [bx], byte 0xEA ;jmp far …
mov [bx+1], si
mov [bx+3], word 0x1000
add [si+(@putSI-@zombStart)-2], si
add [si+(@putAX-@zombStart)-2], ax
mov [bx+1], word 0xCCCC
@start:
mov dx, ss
mov es, dx
add si, @Shurikan-@zombStart
xor di, di
mov cx, (@end-@Shurikan+1)/2
rep movswmov ds, dx
mov cx, cs
mov ss, cxsub ax, 0x500
and al, 7
sub al, 8
mov ch, 0x0F
mov cl, al
shl al, 1
shl al, 1
shl al, 1
shl al, 1
mov sp, ax
mov al, 0xA5-(@end-@ShuEnd) ;movsw
mov bx, 0x100
mov [bx], ax
mov [bx+2], cx
mov di, ax
sub sp, 0x100-0xA5+startOff0 ;movswmov es, cx
xor si, si
mov ax, 0xCCCC
mov dx, 0xCCCC
int 0x86
int 0x86
sub di, 0x200mov ax, 0xD401 ;add sp, dx
stosw
mov ax, 0x1FFF ;call far [bx]
stosw
sub di, byte 3mov ax, startOff0+jumpOff-0x4
mov dx, shootOff0mov bp, jumpOff
xor cx, cx
call far [bx]
@Shurikan:
movsw
movsw
mov cl, (@ShuEnd-@ShuMid)/2
rep movsw
@ShuMid:
sub [bx], bp
add ax, startOffd
sub sp, ax
add dx, shootOffd
mov di, [bx]
movsw
movsw
sub di, byte 3
xor si, si
call far [bx]
@ShuEnd: ;this – ShuMid must be even
add sp, dx
call far [bx]
@end: -
מאתתגובות
- יש להתחבר למערכת על מנת להגיב.