I am in an Assembly language class in college and we are working on assignment that prints data using printf. In class we use Visual Studio Professional 2015 but on my laptop I have Visual Studio Community 2017. In class we change have to change the toolset to a 2013 version but my visual studio does not have that. Here is my code: (it worked perfectly in class but I get errors when running it on my pc):
; Author: Keenan Kaufman
; Date: 9/20/2017
.586
.MODEL FLAT, STDCALL
INCLUDELIB msvcrt.lib
EXTERN printf:NEAR
EXTERN exit:NEAR
.STACK 4096
.DATA
plain BYTE 'Hello, World!'
key BYTE 02h
cipher BYTE SIZEOF plain DUP(?)
.CODE
main PROC
sub eax, eax ; clear registers
sub ebx, ebx
sub ecx, ecx
mov ebx, 0 ; index into strings
mov ecx, SIZEOF plain ; number of chars in strings
lea esi, plain
lea edi, cipher
COPYCHAR:
mov al, [esi]
add al, key
mov [edi], al
inc esi
inc edi
loop COPYCHAR
lea eax, cipher
push eax
call printf ; call printf C function
add esp, 4 ; clean up stack
mov eax, 0 ; exit with
call exit ; return code 0
main ENDP
END
Any help would be appreciated! Thank You!