Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- .model flat, stdcall
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;includem msvcrt.lib, si declaram ce functii vrem sa importam
- includelib msvcrt.lib
- extern printf: proc
- extern exit: proc
- extern scanf: proc
- extern fopen: proc
- extern fprintf: proc
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;declaram simbolul start ca public - de acolo incepe executia
- public start
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;sectiunile programului, date, respectiv cod
- .data
- msg db "Introduceti sirul de caractere!",0
- string db 100 dup(0),0 ; !!!!!!!!
- format db "%s", 0
- format1 db "Stringul este %s",0
- mode_write DB "w", 0
- file_name DB "fisier.txt", 0
- .code
- start:
- ;mov ecx,0
- push offset msg
- call printf
- ;add esp,4
- push offset string
- push offset format
- call scanf
- ;add esp,8
- ;mov esi,0
- push offset string
- push offset format1
- call printf
- ;add esp,12
- push offset mode_write
- push offset file_name
- call fopen
- push EAX ;in eax a fost returnat pointer-ul spre fisier
- push offset string
- push offset format1
- push eax
- call fprintf
- ; citeste de la tastatura un cuvant si il afiseaza in fisier
- push 0
- call exit
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement