fork(5) download
  1. TITLE Add and Subtract, Version 2 (AddSub2.asm)
  2.  
  3. ; This program adds and subtracts 32-bit integers
  4. ; and stores the sum in a variable.
  5.  
  6. INCLUDE Irvine32.inc
  7.  
  8. .data
  9. val1 dword 10000h
  10. val2 dword 40000h
  11. val3 dword 20000h
  12. finalVal dword ?
  13.  
  14. .code
  15. main PROC
  16.  
  17. mov eax,val1 ; start with 10000h
  18. xor eax,val1 ; xor eax to make it almost negative
  19. add eax,1h ; now add one to make it negative
  20. sub eax,val2 ; subtract 40000h
  21. sub eax,val3 ; subtract 20000h
  22. mov finalVal,eax ; store the result (30000h)
  23. call DumpRegs ; display the registers
  24.  
  25. exit
  26. main ENDP
  27. END main
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.asm:1: error: comma, colon, decorator or end of line expected after operand
prog.asm:1: error: comma, colon, decorator or end of line expected after operand
prog.asm:6: error: parser: instruction expected
prog.asm:9: error: parser: instruction expected
prog.asm:10: error: parser: instruction expected
prog.asm:11: error: parser: instruction expected
prog.asm:12: error: parser: instruction expected
prog.asm:15: error: parser: instruction expected
prog.asm:26: error: symbol `main' redefined
prog.asm:26: error: parser: instruction expected
prog.asm:27: error: parser: instruction expected
ld: cannot find prog.o: No such file or directory
stdout
Standard output is empty