online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
; Az RiZ 3 ; Author: Pooria bekhradi ; Date: 1400-10-01 .386 .MODEL FLAT ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD INCLUDE io.h ; header file for input/output cr EQU 0dh ; carriage return character Lf EQU 0ah ; line feed .STACK 4096 ; reserve 4096-byte stack .DATA ; reserve storage for data ;----------------دیتای منوی برنامه--------------- inSwitch DWORD 11 DUP (?) string BYTE 40 DUP (?) promptMenue BYTE "************************************ " BYTE cr, Lf,"*********1.Prime Number *********** " BYTE cr, Lf,"*********2.Arrays *********** " BYTE cr, Lf,"*********0.Exit *********** " BYTE cr, Lf,"************************************ " BYTE cr, Lf, 0 ;----------------دیتای ورود اعداد --------------- number1 DWORD ? prompt1 BYTE cr,Lf,"Enter a number: ", 0 voroodi BYTE 40 DUP (?) ;----------------دیتای تشخیص عدد اول---------- i DWORD ? labelPrime BYTE cr, Lf, "The Number is Prime" BYTE cr, Lf, 0 labelNotPrime BYTE cr, Lf, "The Number is Not Prime!!!" BYTE cr, Lf, 0 ;----------------دیتای آرایه های زوج و فرد-------- X DWORD 5 DUP (?) Y DWORD ? Temp DWORD ? voroodi2 BYTE 40 DUP (?) prompt2 BYTE cr,Lf, "Enter a number: ",0 msgeven BYTE cr,Lf, "Number is Even:" evennum BYTE 11 DUP (?) BYTE cr, Lf, 0 msgodd BYTE cr,Lf, "Number is Odd:" ODDnum BYTE 11 DUP (?) BYTE cr, Lf, 0 ;----------------دیتای خداحافظی --------------- label2 BYTE cr, Lf, " Good Bye ..." BYTE cr, Lf, 0 .CODE _start: ;//////////////////////منوی برنامه//////////////////////// OUTPUT promptMenue INPUT string, 40 ATOD string MOV inSwitch, eax CMP inSwitch,0 JNG endofProgram CMP inSwitch,1 JE SwitchPRIME CMP inSwitch,2 JE SwitchArrays CMP inSwitch,3 JGE _start JMP _start ;//////////////////////تشخیص عدد اول ////////////////////// SwitchPRIME: MOV ECX,0 FUNC1: output prompt1 input voroodi, 40 atod voroodi mov number1, eax cmp eax,02h je prime cmp eax,03h je prime FUNC2: mov eax,number1 mov i,02h cdq idiv i cmp edx,0 je noprime call funcprime cmp edx,0 je noprime cmp i,eax je prime PRIME: mov eax,number1 output labelprime inc ecx cmp ecx,05h jne func1 jmp _start NOPRIME: mov eax,number1 output labelnotprime inc ecx cmp ecx,05h jne func1 jmp _start FUNCPRIME: mov eax,number1 inc i cdq idiv i ret ;//////////////////////آرایه های زوج و فرد//////////////////////// SwitchArrays: MOV Y,2 MOV edx, OFFSET X MOV ecx, lengthof X FUNC3: output prompt2 input voroodi2, 40 atod voroodi2 mov [edx], eax add edx,4 dec ecx cmp ecx,0 jg func3 MOV edx, OFFSET X MOV ecx, lengthof X FUNC4: mov ebx,edx mov eax,[edx] mov temp,eax cdq idiv y cmp edx,0 je oneven jmp onodd endcmp: mov edx,ebx mov eax, [edx] add edx,4 dec ecx cmp ecx,0 jg func4 jmp _start OnEven: mov eax,temp dtoa evennum,eax output msgeven jmp endcmp OnODD: mov eax,temp dtoa oddnum,eax output msgodd jmp endcmp endofProgram: output label2 INVOKE ExitProcess, 0 ; exit with return code 0 PUBLIC _start ; make entry point public END ; end of source code ; Author: Pooria bekhradi

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue