Reputation: 900 Master
- Active Posts:
- 2,485 (1.57 per day)
- 28-March 11
- Profile Views:
- Last Active:
- Yesterday, 09:01 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
- Expert In:
Posts I've Made
Posted 17 Jul 2015Please help with what, modifying someone else's program? Sure looks like code from a decompiled exe, and we won't help with that.
Closing this thread, any questions PM me.
Posted 2 Jul 2015NUL terminating the string will definitely fix the problem, since the functions read the string until it hits a 0. The OP is linking against the Irvine library which is a wrapper around the Win32 API, not DOS interrupts.
Posted 27 Jun 2015Why do you think that is? Look at each string carefully, how do string printing functions know when to stop printing the string? By looking for a 0, that is why they are called NUL terminated strings. What are you missing at the end of each of your strings? WriteString prints the string intro, and since you are missing the NUL terminator, it keeps printing everything after that until it hits a 0
Posted 19 Jun 2015Please don't open duplicate threads.
Please don't open duplicate threads.
Posted 13 Jun 2015
Quotecant get it to display
Where are you displaying anything? Irvine has a few display routines:
DumpRegs displays all of the registers in Hex.
WriteBin displays a 32 bit integer to the console window in binary format
WriteDec displays an unsigned 32 bit integer to the console window.
WriteHex displays a 32 bit hex number to the console window
WriteInt displays a signed 32 bit number to the console window.
You could use any one of those routines to display the final result.
Quoteor calculate correct
If you cannot get it to display, how to you know it is not calculating correctly?
Why do you have sub commented out? Your code is correct, you just need to print it out an learn to ADD COMMENTS!!!!
Let's clean up your code and add comments and a call to display the results:
.code main PROC ; A = (A + B ) - (C + D) mov eax, 10 ; A mov ebx, 10 ; B mov ecx, 5 ; C mov edx, 5 ; D add eax, ebx ; (A + B ) eax == sum add ecx, edx ; (C + D) ecx == sum sub eax, ecx ; (A + B ) - (C + D) eax == result call WriteDec ; display results call Crlf ; add CR and Line Feed to console call WaitMsg ; wait for keypress push 0 call ExitProcess main endp end main
- Member Title:
- "Hurry up and wait"
- 41 years old
- June 30, 1974
- In my head
- Forum Leader:
- Full Name:
- Years Programming:
- Programming Languages:
- x86 Win32 Assembly (MASM, FASM, NASM)