how to setup

step 1: create a visual cpp project

hello world

make sure cpp is running ok

step 2: build customization

build customization

masm

step 3: change item type

Go to the assembly file, change the item type

assmebler

code example

foo.asm

.code

foo PROC
	mov rax, 124
	ret
foo ENDP

END

#include <iostream>

using namespace std;

extern "C" int foo();

int main() {
	cout << "the result is " << foo() << endl;

	cin.get();  // Wait for the user to press Enter
	return 0;
}

ref

https://sonictk.github.io/asm_tutorial/

https://stackoverflow.com/questions/20326262/error-lnk2019-unresolved-external-symbol-referenced-in-function-main