Thursday, May 17, 2012

Assembly in Windows

1. Compiler: MASM 
download: http://www.masm32.com/
install it
it has an masm editor
it use NASM assembly, please use pcasm for reference
http://www.drpaulcarter.com/pcasm/
But it doesn't have the IO instruction in the book


2. Start with hello world program

include \masm32\include\masm32rt.inc  

.data
MyTitle db "ASM is Fun!",0
MyText db "I hope you're learning!",0
.codestart:
push 0
push offset MyTitle
push offset MyTextpush 0
call MessageBoxA
call ExitProcess
end start



URL: http://computertech.createmybb3.com/showthread.php?tid=105
http://www.youtube.com/watch?v=gklpZIVuTBY



3. Write your own program

.386
.model flat,stdcall
.code
start
mov dx, 1327
out dx, ax
end start



This program write port 0x52f It looks like MASM cannot use hex because I get compile error.



4. Run the Program 

AllowIo.exe WritePort.exe /a
write to port in Windows, please see my another article
http://fengweizhang.blogspot.com/2012/04/user-program-write-to-io-ports-on.html



No comments: