반응형
1.masm 다운 및 설치
2. visual studio 2012와 masm 설정
http://valley.egloos.com/viewer/?url=http://wharak.egloos.com/801515
01. project 생성 [ file > new > project ..]

02. [ Installed > Templates > Visual C++ > Empty Project ]

03. 소스파일추가
[ Sources Files 선택 > 오른쪽버턴 > Add > New Item ]

03-2. [ Installed > Visual C++ > C++ File ] 을 선택한다음 파일이름을 [source.asm]으로 한다.

04. 프로그램을 작성하고 저장한다.

[Source.asm]
.386
.model flat, c
.stack 100h
printf proto arg1:ptr byte, printlist:vararg
.data
msg1fmt byte "%s%d", 0ah,0
msg1 byte "The answer is: ",0
num1 sdword ?
num2 sdword ?
.code
main proc
mov num1,5
mov eax, num1
mov num2, eax
invoke printf, addr msg1fmt, addr msg1, num2
ret
main endp
end
05. [ 프로젝트를 선택 > 오른쪽버턴 > Build Customizations...]

06. [ masm ]선택

08. [프로젝트선택 > 메뉴바의 PROJECT > Properties ]

09. [Configuration Properties > Linker > Input > Additional Dependencies 의 값을 msvcrt.lib 로 바꾼다
소스파일에서 printf함수를 사용했기때문이다.

연이어 [ System > SubSystem ] 의 역삼각형을 클릭하여 [Console(/SUBSYSTEM:CONSOLE)]을 선택한다.
프로젝트의 타입을 Win32 console mode로 바꾸는것이다.

10. [ source.asm 선택 > 오른쪽버턴 > Properties ]

11. [ Item Type]이 [ Microsoft Macro Assembler] 이 되어야된다. 만약 그렇지 않으면 오른쪽끝의 역삼각형버턴을 클릭하여 [ Microsoft Macro Assembler]를 선택한다.


12. 빌드한다. [ BUILD메뉴 > Build Solution ]

13. Output 창에서 [ Assembling source.asm ] 메시지와 [ 1 succeed ]를 확인하다.

14. 실행해본다. [ DEBUG > Start Without Debugging ] 메뉴를 선택한다.

15. 아래그럼처럼 나오면 성공한 것이다.

3. AsmHighlighter 1.6 - VS2010 + VS2012 다운 및 설치
http://asmhighlighter.codeplex.com/releases
% AsmHighlighter 1.6 적용이 안되면 레지스터의 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache을 삭제
If the new AsmHighlighter version doesn't highlight your asm code, you can try to remove the registry entry: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache
공부할 책
http://book.naver.com/bookdb/book_detail.nhn?bid=1528739
반응형