I have 2 codes that I need a screenprint of them when they show up on de command prompt, Im just having problems with my pc that my command prompt dosnt want to showup, can anyone run this 2 codes for me and take a screen print of them both I really need them , that codes I already wrote them.

first code:

INCLUDE Irvine32.inc

.data

string BYTE "This is a string",0dh, 0ah, 0

.code

main PROC

;mov ecx, 4
mov edx, string
call WriteString

exit

main ENDP
END main

secound code:

INCLUDE Irvine32.inc

.data

string0 BYTE "Enter the first number: ", 0
string1 BYTE "Enter the second number: ", 0
string2 BYTE "The result is: ", 0
number SDWORD ?

.code

main PROC

call Clrscr ; Clears the screen

mov dh, 10 ; Row 10
mov dl, 0 ; Column 0
call Gotoxy ; Locate the cursor

mov edx, OFFSET string0 ; "Enter the first number: "
call WriteString ; Displays the string

call ReadInt ; Prompts the user for a number
mov number, eax ; Assigns the number to the "number" variable
call Crlf ; End of line operation

mov edx, OFFSET string1 ; "Enter the second number: "
call WriteString ; Displays the string

call ReadInt ; Prompts the user for a number
add eax, number ; Adds the number in eax register with the variable: "number"
call Crlf ; End of line operation

mov edx, OFFSET string2 ; "The result is: "
call WriteString ; Displays the string

call WriteInt ; Writes the number in eax register (the result)
call Crlf ; End of line operation
call Crlf ; End of line operation

exit
main ENDP
END main
Posted on 2011-11-01 22:49:35 by j25
Don't use Irvine stuff and no time to test it for you but can see one
immediate problem. mov edx, string

should probably be either:
mov edx, OFFSET string
or
mov edx, DWORD PTR string

ie, can't read memory location directly...
Posted on 2011-11-02 03:06:42 by MACH4
lea edx, string is also valid
Posted on 2011-11-02 07:22:40 by Homer