アセンブラーがCでどのように機能するかをテストして学習しようとしているので、いくつかのチュートリアルを閲覧していて、これを見つけました:
__asm
{
mov ax,0B800h //startaddress for the screen memory (in textmode)
mov es,ax //add the startaddress to es
xor di,di //reset di (start at the beginning of the screen)
mov al, 65 //65 = ascii for the 'A' character to al
mov ah, 16*4+1 //Attribute = blue text on a red background to ah.
mov cx,2000 //25*80 = 2000 characters on the screen
rep stosw //write ax to the screen memory and count di up 2000 times
}
私が抱えている問題は、実行できないことです.Microsoft Visual Studio 2008のメインメソッド内でコンパイルできますが、実行すると次のエラーが発生します:
Test.exe の 0x00da3660 で未処理の例外: 0xC0000005: アクセス違反の読み取り場所 0xffffffff。
2 行目 mov es,ax //lägg startadressen i es
プログラムが 16 ビットであり、VS 2008 がそれを 32 ビット プログラムにコンパイルする可能性はありますか? もしそうなら、VS 2008 に別の方法でコンパイルさせることはできますか?
アセンブラ内の優れたチュートリアルを知っている人はいますか?