Paste: a*2

Author: fiction
Mode: assembly-x86
Date: Sun, 18 Mar 2012 11:24:41
Plain Text |
.686    
.model flat, stdcall
option casemap:none
include C:/masm32/include/windows.inc   ; for infinite, invoke, etc.
include C:/masm32/include/kernel32.inc ; for SetConsoleTitle, Sleep, ExitProcess
include C:/masm32/include/msvcrt.inc    ; for crt_printf\crt_scanf

includelib C:/masm32/lib/kernel32.lib  ; for SetConsoleTitle, Sleep, ExitProcess
includelib C:/masm32/lib/msvcrt.lib     ; for crt_printf\crt_scanf
 
.data
ConsoleTitle db 'Input',0
mess_1 db 'Write a: ',0
rez dd ?
formats db '%d',0
formats2 db "a*2 = %d", 0

.code
main:
invoke SetConsoleTitle, addr ConsoleTitle

invoke  crt_printf, addr mess_1
invoke  crt_scanf,ADDR formats,ADDR rez

imul ebx,rez,2
mov rez, ebx
invoke  crt_printf, addr formats2, rez
invoke Sleep, INFINITE
invoke ExitProcess,0

end main

New Annotation

Summary:
Author:
Mode:
Body: