問題タブ [addressing-mode]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
147 参照

c++ - Visual C++ 2010 がメモリ アドレス指定にこのアセンブリ構文を使用するのはなぜですか?

Visual C++ 2010 を使用して、次の C++ コードをアセンブリに変換しました。

次の出力を受け取りました。

ここに画像の説明を入力

メモリ アドレス指定に関する私の理解に基づいて、メモリ アドレスの計算は常に角括弧の内側に配置されるのに、なぜ_i$この場合は角括弧の外側に配置されるのでしょうか?

0 投票する
1 に答える
11275 参照

assembly - [base + index*scale + disp] に関するいくつかの質問

Intel および AT&T 構文でのメモリ アドレッシングの一般的な形式は次のとおりです。

私の質問は次のとおりです。

  • 任意のレジスタにすることがbaseできますか?index
  • scale1、2、4 、および 8 (デフォルトは 1) のどの値を取ることができますか?
  • indexと は互換性がありますかdisp(唯一の違いindexはレジスタでdispあり、即値であるということです)?
0 投票する
1 に答える
619 参照

assembly - Dealing with the overflow of a 9bit result to an ADD op that is supposed to store in a byte ptr in x86

I am working on a problem for my introductory computer organization course at UCI and we use x86 assembly language in the course (using Visual Studio and the MS syntax). While the problem is for a homework assignment, we are graded on attempts and not the correctness of our answers.

My question is w.r.t indirect memory addressing. The entire question is stated below:

Suppose EBX = 1000 (in decimal) and the byte values stored in the memory addresses 1000 through 1003 are 255, 255, 255, and 255 (in decimal). What effect do the following instructions have (independently) on this area of memory? Assume for multi-byte data, least significant byte is stored in smallest address.

a. ADD byte ptr [EBX], 1

b. ADD word ptr [EBX], 1

c. ADD dword ptr [EBX], 1

I understand that byte ptr [EBX] will load the value 0xFF and that question (A) essentially boils down to ADD 0xFF, 0x01 using a memory address of one byte. However, what I do not understand is how to deal with the overflow caused by '0x100' which would require a minimum of 9 bits to represent.

The two possible solutions I can determine for question (A) ADD byte ptr [EBX], 1 are as follows:

QUESTION: what effect does the overflow of representing a 9 bit result of an ADD operation in a single byte of memory have on any subsequent memory regions, if any

Any insight that anyone could shed on this topic would be greatly appreciated as I was not able to find any x86 specific information that dealt with the overflow of storing a 9 bit number in a single byte of memory.

0 投票する
0 に答える
41 参照

cpu-registers - Immediatea メモリ位置を含む命令で使用されるアドレッシング モード

次があるとします。

MOV #NUM、R0

ハッシュタグが即時アドレッシング モードを表していることを理解しています。ただし、この場合、 R0に何が格納されるのか正確にはわかりません。NUMの実際のアドレスですか?

0 投票する
1 に答える
1972 参照

assembly - 32ビットアドレスサイズの64ビットモードでのx86-64アドレス計算

64ビットモードでのアドレス計算に関するインテルのマニュアルを読みました。64 ビット モードの場合、デフォルトのアドレス サイズは 64 ビットです。問題の命令の前にアドレス サイズ オーバーライド プレフィックスがあると仮定すると、アドレス サイズは 32 ビットになります。

ここで、レジスタ番号 0 (rax/eax/ax ...) で指定されたアドレスを使用して、命令がメモリ オペランドをエンコードするとします。

CPUがeax値のみを見て内部的にゼロ拡張して「ネイティブ」64ビットアドレスを形成するのか、rax値全体を見て有効な32ビット範囲に切り捨てるのか、私が完全には理解していないこと(たとえば、raxには5Gbのようなものが含まれており、CPUはそれを最大32ビットアドレスにカットします)。