level 7
_width equ 001Ehcode SEGMENT PARA ASSUME cs:code, ds:codeorg 100h .386start: mov al, 012hint10hmovbh, 0a0hmoves, bx@0109: mov di, bx movdl, 0c0h@0124: mov cx, 0141h@0127: lodsb stosb loop @0127 mov ah, 1 int 16h jne @quit1 dec dx jnz @0124 jmp @0109@quit1: xor ax, ax int 16h mov ax, 13h int 10h ;VGApush0a000hpopesmovdl, 00040hPutPix: mov bx, si ;(X,Y) = (DX,CX) imul di, bx, 320adddi, dxmovcx, _widthIncPal: inc byte ptr es:[di]incdi loop IncPal mov bx, ax mov ah, 1 int 16h jne @quit2 imul ax, bx, 4e6dh shl ax, 1 adc ax, 0061h shr ax, 1 neg ax shl ax, 1 and ax, 7FFEh shr ax, 1 cmp al, 80h jb @A0185 inc dx inc dx@A0185: dec dx ;decrease X inc si ;increase Y jmp putpix@quit2: xor ax, ax int 16h; mov ax, 013h ;may need to be AX, 013h sometimes.; int 10h ; (4)(4); push 0a000h; pop es;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪; RANDOM NUM. ax = RND (-32768 to
+3
2768).(3)(12); "GET A DOG UP YA";哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪@main: imul ax, 03;smallest random number generator!;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪; Setup for smaller code size for the 1st and 2nd 50%'s. (BX,BP)=(X,Y);哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 mov cx, bx ;setup for both 50%'s NewX and NewY. add cx,
bp
; bit quicker and saves ~15 bytes. mov dx, bx neg dx add dx, bp add dx, 75 test ax, ax jg @@_1;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪; First 50%;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 add cx, 80 ;newx:=((0.5*x)+(0.5*y)+80); sub ax, cx ;newy:=((0.5*-x)+(0.5*y)+75); jmp @@_Calc;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪; Second 50%;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪@@_1: sub cx, 80 ;newx:=((0.5*x)+(0.5*y)-80); add dx, 50 ;newy:=((0.5*-x)+(0.5*y)+125); add ax, cx;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪; Do the (?x)'s and (?y)'s on NewX and NewY. (4)(41);哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪@@_calc:shr cx, 1 shr dx, 1;哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪;PUTPIXEL routine. Slow... but small!. (BP ? X) (BX ? Y). (18)(59);哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
2008年05月01日 12点05分