The snow falls too fast and I would like to slow it down.
I have some code for a CPU independent delay but don't know where to put the delay.
Thanks.
I have some code for a CPU independent delay but don't know where to put the delay.
Thanks.
CODE C Language
; snow.asm 16 bit Tasm code ; .model tiny .386 .code org 100h start: jmp begin eoh db '* SOPHIE *' begin: mov ax,13h ; video mode int 10h mov bl,2 ; foreground color, bright red = 4 push 0a000h pop es mov bh,10d ;this contains count of chars to be ; (this matches what is in eoh) mov di,30508 mov si,offset eoh nogeenchar: mov cl,ds:[si] inc si push si push di push bx push ds push 0f000h pop ds mov si,0fa6eh shl cx,3 add si,cx mov cx,08 nogeenrow: lodsb mov ah,al mov dl,10000000b nogeenpixel: mov al,ah and al,dl jz nietneerzetten mov al,bl stosb dec di nietneerzetten: inc di shr dl,1 jnz nogeenpixel add di,312 dec cx jnz nogeenrow pop ds pop bx pop di pop si add di,8 dec bh jnz nogeenchar xor ax,ax push ax claudia: pop ax inc ax push ax sub di,bx add di,ax add di,cx and di,0000001000000000b shr di,9 push di mov si,319 ;<---- ; Hier wordt de mov cl,3 ; eax = n sneeuwvlokje: ; ebx = n add ax,bp ; ecx = n add ax,bx ; edx = n sub ax,di ; esi = n <- die moet mov bx,di ; edi = n or bx,ax ; ebp = n not ax ; fs add bx,dx ; gs xor ax,bx ; ds add al,ah ; es mov ;bp,ax test bp,1 jnz pleuris not bp shr bp,1 pleuris: cmp ax,319 jna gassen sub ax,319 jmp pleuris gassen: add ax,63680 mov di,ax mov ax,0a000h mov es,ax mov al,15 stosb dec cl jnz sneeuwvlokje mov cx,64000-319 push 0a000h pop es push es pop ds mov ax,15 pop di volgendepixel: mov dl,ds:[si] ;bx was si mov bx,-319 add bx,di cmp dl,15 jne klaar nogeenrandommer: add dx,cx xor dx,di add dl,dh and dl,00000011b cmp dl,3 je drie cmp dl,2 je twee cmp dl,1 jne nogeenrandommer een: call piaf witte1: dec bx call piaf witte2: dec bx call paf jne klaar jmp plop twee: dec bx call piaf witte3: inc bx call piaf witte4: dec bx dec bx call paf jne klaar jmp plop drie: dec bx dec bx call piaf witte5: inc bx call piaf witte6: inc bx call paf jne klaar jmp plop ploep: pop bp plop: mov ds:[si],ah mov ds:[si-bx],al klaar: inc si dec cx jnz volgendepixel mov ah,1 ;Check for a key int 16h jz claudia ;Loop back xor ah,ah ;Eat the key int 16h mov ax,03h int 10h pop ax push cs pop ds ret piaf proc call paf je ploep ret endp paf proc mov dl,ds:[si-bx] cmp dl,00 ret endp end start Modify message