NocEm Scroller 4 v 1 0 3 by MiCRO TaS NME This will make my smallest tightest fastest k rad n est scroller yet 286 allow 80286 code model small small memory model EXE stack 256 256 byte stack segment VGA SEG EQU 0A000h A000h VGA Graphics Video Memory data BEGIN data segment definition of the NocEm each number is a color out of 256 colors NOTE color \'s 0 1 will not be rotated color 0 0 0 0 black 4x16 64 x16 1024 let A db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 db 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 db 0 1 71 70 69 68 67 1 0 0 0 0 0 0 1 57 56 55 54 53 52 1 0 0 0 0 1 45 44 43 42 41 40 39 1 0 1 35 34 33 32 31 30 29 28 27 1 0 1 23 22 21 20 19 18 1 0 0 0 0 0 0 0 0 db 0 1 70 69 68 67 66 65 1 0 0 0 0 0 1 56 55 54 53 52 51 50 1 0 0 1 45 44 43 42 41 40 39 38 1 0 1 34 33 32 31 30 29 28 27 26 1 0 1 22 21 20 19 18 17 16 1 1 1 0 0 0 0 0 db 0 1 69 68 67 66 65 64 63 1 0 0 0 0 1 55 54 53 52 51 50 49 48 1 0 1 44 43 42 41 40 39 38 37 1 0 1 33 32 31 30 29 28 27 26 25 1 0 1 21 20 19 18 17 16 15 14 13 12 1 0 0 0 0 db 0 1 1 1 1 1 1 63 62 61 1 0 0 0 1 1 1 1 1 50 49 48 47 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 15 14 13 12 11 10 1 0 0 0 db 0 0 0 0 0 0 0 1 61 60 59 1 0 0 0 0 0 0 0 1 48 47 46 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 13 12 11 10 9 8 1 0 0 db 0 1 1 1 1 1 0 0 1 59 58 57 1 0 1 1 1 1 1 1 47 46 45 1 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 0 1 12 11 10 1 8 7 6 1 0 db 0 1 65 64 63 1 0 0 1 58 57 56 1 0 1 51 50 49 1 1 46 45 44 1 0 1 40 39 38 1 0 0 0 0 0 0 1 29 28 27 1 0 1 1 1 0 0 0 1 17 16 15 1 0 1 11 10 9 1 7 6 5 1 0 db 0 1 64 63 62 1 0 0 1 57 56 55 1 0 1 50 49 48 1 1 45 44 43 1 0 1 39 38 37 36 1 1 1 1 1 0 1 28 27 26 1 0 0 0 0 0 0 0 1 16 15 14 1 0 1 10 9 8 1 6 5 4 1 0 db 0 1 63 62 61 1 0 0 1 56 55 54 1 0 1 49 48 47 46 1 44 43 42 1 0 1 38 37 36 35 34 33 32 31 1 0 1 27 26 25 1 1 1 1 1 1 1 0 1 15 14 13 1 0 1 1 1 1 1 5 4 3 1 0 db 0 1 62 61 60 1 0 0 1 55 54 53 1 0 0 1 47 46 45 44 43 42 1 0 0 0 1 36 35 34 33 32 31 30 1 0 1 26 25 24 23 22 21 20 19 18 1 0 1 14 13 12 1 0 0 0 0 0 1 4 3 2 1 0 db 0 1 61 60 59 1 0 0 1 54 53 51 1 0 0 0 1 45 44 43 42 1 0 0 0 0 0 1 34 33 32 31 30 29 1 0 1 25 24 23 22 21 20 19 18 17 1 0 1 13 12 11 1 0 0 0 0 0 1 3 2 2 1 0 db 0 1 60 59 58 1 0 0 1 53 51 50 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 24 23 22 21 20 19 18 17 16 1 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 db 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 length and width of NocEm defined a width db 64 a length db 16 current x y positions beginning at 0 0 x pos dw 0 y pos dw 0 x pos2 dw 310 64 y pos2 dw 190 16 x pos3 dw 160 y pos3 dw 90 begin in direction 1 where direction 1 down right direction 2 up right direction 3 up left direction 4 down left direction db 1 directionb db 3 directionc db 4 used for rotation of palette temp db 3 DUP pal db 768 DUP credit db \'NocEm Scroller 4 ver 1 0 3 By MiCRO TaS NME \' 13 10 db \'NocturnaL EmmissionS 713 431 CULT\' 13 10 db \'TragiK aNSi SpinnerZ FREE ART \' 13 10 \' \' code BEGIN code segment clear the screen set mode to 13h 320x200x256 VGA Graphics Mode mov ax 0013h ROM BIOS Service 00h set mode al 13 int 10h perform interrupt video services copy pre defined values for palette mov cx 768 256 colors 3 bytes color r g b mov ax code mov ds ax mov si offset palarr copy from palarr in CS mov ax data mov es ax mov di offset pal copy to pal in DS rep movsb copy the palette bytes mov si offset pal address our variable palette call setpal set the palette using pal mov ax data the letter \'A\' is in DS mov ds ax mov ax VGA SEG address the video memory mov es ax assign it to ES extra seg mov si 0 beginning of letter data mov di 0 beginning of video memory wait for any key loop until keypressed keywait mov dx 3DAh holdon in al dx test al 08h jz holdon retrace in al dx test al 08h jz retrace display the cyber letter \'A\' nextpixel movsb dec a width next byte in line jnz nextpixel have we drawn a line nextline mov a width 64 reset count for next line add di 320 64 adjust video memory pointer dec a length next line in letter jnz nextpixel have we drawn the letter mov si 0 reset to start of letter A mov ax y pos2 linear location 320 y pos x pos mov bx 320 mul bx add ax x pos2 mov di ax mov a length 16 nextpixel2 movsb dec a width next byte in line jnz nextpixel2 have we drawn a line nextline2 mov a width 64 reset count for next line add di 320 64 adjust video memory pointer dec a length next line in letter jnz nextpixel2 have we drawn the letter mov si 0 reset to start of letter A mov ax y pos3 linear location 320 y pos x pos mov bx 320 mul bx add ax x pos3 mov di ax mov a length 16 nextpixel3 movsb dec a width next byte in line jnz nextpixel3 have we drawn a line nextline3 mov a width 64 reset count for next line add di 320 64 adjust video memory pointer dec a length next line in letter jnz nextpixel3 have we drawn the letter determine current direction and jump to appropriate section cmp direction 1 je direction1 cmp direction 2 je direction2 cmp direction 3 je direction3 jmp direction4 none of these then must be 4 check direction2 cmp directionb 1 je j d1b direction1b cmp directionb 2 je j d2b direction2b cmp directionb 3 je j d3b direction3b jmp direction4b none of these then must be 4 j d1b fuck too far 2 jump conditionally jmp direction1b j d2b jmp direction2b j d3b jmp direction3b check direction3 cmp directionc 1 je j d1c direction1c cmp directionc 2 je j d2c direction2c cmp directionc 3 je j d3c direction3c jmp direction4c none of these then must be 4 j d1c fuck too far 2 jump conditionally jmp direction1c j d2c jmp direction2c j d3c jmp direction3c the following is neccesary because for every direction there are two different boundries and therefore two different reactions new directions direction1 inc x pos move down one inc y pos move right one cmp x pos 320 64 have we reached the boundry je dir 4 yes then new direction is needed cmp y pos 200 16 ditto je dir 2 you get the picture jmp done direction passed remain in current direction direction2 inc x pos move down one dec y pos move left one jz dir 1 boundry cmp x pos 320 64 etc etc etc je dir 3 jmp done direction direction3 dec x pos jz dir 2 dec y pos jz dir 4 jmp done direction direction4 dec x pos jz dir 1 inc y pos cmp y pos 200 16 je dir 3 jmp done direction assign new directions if needed dir 1 mov direction 1 jmp done direction dir 2 mov direction 2 jmp done direction dir 3 mov direction 3 jmp done direction dir 4 mov direction 4 jmp done direction direction1b inc x pos2 move down one inc y pos2 move right one cmp x pos2 320 64 have we reached the boundry je dir 4b yes then new direction is needed cmp y pos2 200 16 ditto je dir 2b you get the picture jmp done direction2 passed remain in current direction direction2b inc x pos2 move down one dec y pos2 move left one jz dir 1b boundry cmp x pos2 320 64 etc etc etc je dir 3b jmp done direction2 direction3b dec x pos2 jz dir 2b dec y pos2 jz dir 4b jmp done direction2 direction4b dec x pos2 jz dir 1b inc y pos2 cmp y pos2 200 16 je dir 3b jmp done direction2 assign new directions if needed dir 1b mov directionb 1 jmp done direction2 dir 2b mov directionb 2 jmp done direction2 dir 3b mov directionb 3 jmp done direction2 dir 4b mov directionb 4 jmp done direction2 direction1c inc x pos3 move down one inc y pos3 move right one cmp x pos3 320 64 have we reached the boundry je dir 4c yes then new direction is needed cmp y pos3 200 16 ditto je dir 2c you get the picture jmp done direction3 passed remain in current direction direction2c inc x pos3 move down one dec y pos3 move left one jz dir 1c boundry cmp x pos3 320 64 etc etc etc je dir 3c jmp done direction3 direction3c dec x pos3 jz dir 2c dec y pos3 jz dir 4c jmp done direction3 direction4c dec x pos3 jz dir 1c inc y pos3 cmp y pos3 200 16 je dir 3c jmp done direction3 assign new directions if needed dir 1c mov directionc 1 jmp done direction3 dir 2c mov directionc 2 jmp done direction3 dir 3c mov directionc 3 jmp done direction3 dir 4c mov directionc 4 jmp done direction3 we have finished messing with the direction rotate palette then move done direction jmp check direction2 done direction2 jmp check direction3 done direction3 call rotpal mov si offset pal 6 why 6 skip colors 0 1 call setpal mov si 0 reset to start of letter A mov ax y pos linear location 320 y pos x pos mov bx 320 mul bx add ax x pos mov di ax mov a length 16 in the future i will use the quicker out with 60h looking for ESC only mov ah 1 ROM BIOS Service 01h key ready int 16h perform interrupt keyboard services jnz keypressed keywait is 127 bytes away must jmp keywait unconditionally jump keypressed xor ah ah ROM BIOS Service 00k read key int 16h perform interrupt keyboard services call fadeout clear the screen reset mode to text 80x25x16 xor ah ah ROM BIOS Service 00h set mode mov al 3 mode 3 text 80x25x16 int 10h perform interrupt video services mov dx offset credit mov ah 9 int 21h mov ah 04Ch DOS Sub routine 4Ch DOS exit program int 21h perform interrupt setpal PROC near mov cx 768 6 skip first two colors done manually mov al 0 0 set palette setcx mov dx 3C8h VGA port out dx al inc dx VGA port palette data cld out dx al color 0 0 0 0 out dx al out dx al out dx al color 1 0 89 55 bluish color mov al 89 out dx al mov al 55 out dx al rep outsb send the rest of the color definitions ret setpal ENDP rotpal PROC near first save the first color into temp mov bx 3 mov cx 3 loopone mov al bx byte ptr pal mov temp bx 3 al inc bx loop loopone now rotate the rest covering up the first mov cx 768 6 mov bx 6 again mov al bx byte ptr pal mov bx byte ptr pal 3 al inc bx loop again last restore the saved color to the last position in the palette mov bx 768 3 mov cx 3 looptwo mov al bx temp 765 mov bx byte ptr pal al inc bx loop looptwo ret rotpal ENDP fadeout PROC mov cx 64 onecycle mov dx 3DAh wait in al dx test al 08h jz wait retr in al dx test al 08h jnz retr mov dx 03C7h xor al al out dx al inc dx inc dx xor bx bx readloop in al dx mov byte ptr pal bx al inc bx cmp bx 256 3 jl readloop xor bx bx decloop cmp byte ptr pal bx 0 je continue dec byte ptr pal bx continue inc bx cmp bx 256 3 jl decloop mov dx 3DAh wait2 in al dx test al 08h jz wait2 retr2 in al dx test al 08h jnz retr2 mov dx 03C8h mov al 0 out dx al inc dx mov si offset pal cld push cx mov cx 256 3 rep outsb pop cx loop onecycle ret fadeout ENDP palarr REMEMBER every color has a RED value a GREEN value and a BLUE value 256 colorZ 3 bytes per color R G B 768 bytes R G B R G B R G B R G B db 0 0 0 0 89 55 0 89 55 0 80 49 0 71 43 0 6 36 0 0 0 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 89 55 db 0 80 49 0 71 43 0 6 36 0 0 0 0 0 0 0 0 0 0 0 0 db 0 0 0 0 0 0 0 0 0 0 61 61 0 52 52 0 44 44 0 40 40 db 0 0 0 0 0 0 0 0 0 0 0 0 END