Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .686
- .model flat, c
- includelib libcmt.lib
- includelib libvcruntime.lib
- includelib libucrt.lib
- includelib legacy_stdio_definitions.lib
- extern Sleep@4: proc, system: proc, printf_s: proc, putchar: proc
- .data
- clsString byte "cls", 0
- crlf byte 13, 10, 13, 10, 0
- element_final_x dword 0
- x word 1 ; x coordinate
- message byte "SAUDI ARABIA", 0
- messageLength equ $ - message
- .data?
- index dword ?
- y word ? ; y coordinate
- .code
- main proc
- call hidecursor32
- mov element_final_x, 0
- push 233
- call SetColor32 ;
- add esp, 4
- push offset clsString
- call system ;
- add esp, 4
- mov x, 1
- mov index, 0
- L0:
- cmp index, messageLength - 1
- jae L6
- mov esi, index
- cmp message[esi], ' ' ; don't animate blank character
- je L4 ;
- mov y, 0
- L1:
- cmp y, 10 ; max_y = 10
- jae L4
- movzx ecx, y
- push ecx
- movzx ecx, x
- push ecx
- call gotoxy32
- add esp, 8
- push 233 ; SetColor(233);
- call SetColor32 ;
- add esp, 4
- movzx eax, byte ptr message[esi]
- push eax
- call putchar
- add esp, 4
- push 300 ; Sleep(300);
- call Sleep@4 ;
- add esp, 4
- movzx ecx, y
- push ecx
- movzx ecx, x
- push ecx
- call gotoxy32
- add esp, 8
- push 238
- call SetColor32 ;
- add esp, 4
- movzx eax, byte ptr message[esi]
- push eax
- call putchar
- add esp, 4
- inc y ; increment the y coordinate
- jmp L1
- L4:
- movzx ecx, y
- push ecx
- movzx ecx, x
- push ecx
- call gotoxy32
- add esp, 8
- push 233 ; SetColor(233);
- call SetColor32 ;
- add esp, 4
- mov edi, element_final_x
- movzx eax, byte ptr message[edi]
- push eax
- call putchar
- add esp, 4
- inc element_final_x
- inc x
- inc index
- jmp L0
- L6:
- push offset crlf
- call printf_s
- xor eax, eax
- ret
- main endp
- setColor32 proc colorValue: dword
- extern GetStdHandle@4: proc, SetConsoleTextAttribute@8: proc
- push eax
- push 0FFFFFFF5h ; HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- call GetStdHandle@4 ;
- push colorValue ; SetConsoleTextAttribute(hStdOut, colorValue);
- push eax ;
- call SetConsoleTextAttribute@8 ;
- pop eax
- ret
- setColor32 endp
- gotoxy32 proc
- extern GetStdHandle@4: proc, SetConsoleCursorPosition@8: proc
- .data?
- coord2 dword ?
- .code
- push ebp
- mov ebp, esp
- sub esp, 32
- mov ax, [ebp + 8] ; x
- mov word ptr [coord2],ax
- mov bx, [ebp + 12] ; y
- mov word ptr [coord2 + 2], bx
- mov eax,dword ptr [coord2]
- push eax
- push 0FFFFFFF5h ; GetStdHandle(STD_OUTPUT_HANDLE);
- call GetStdHandle@4 ;
- push eax ; SetConsoleCursorPosition(handle, coord);
- call SetConsoleCursorPosition@8 ;
- add esp, 32
- pop ebp
- ret
- gotoxy32 endp
- hidecursor32 proc
- extern GetStdHandle@4 : proc, SetConsoleCursorInfo@8 : proc
- .data
- consoleHandle dword 0
- info dword 0
- .code
- push 0FFFFFFF5h
- call GetStdHandle@4
- mov consoleHandle, eax
- mov info, 100
- mov dword ptr [ebp - 24], 0
- lea eax, info
- push eax
- mov ecx, consoleHandle
- push ecx
- call SetConsoleCursorInfo@8
- ret
- hidecursor32 endp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement