問題タブ [immediate-operand]
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.
assembly - MIPS I 型指示記号拡張についての混乱
私は MIPS 命令を学んでいますが、即値を拡張する必要がある I タイプの命令をテストすると、次の結果について混乱します (それらはすべて MARS で実行されます)。
- ソース コード行 があるとします
ori $s1, $s2, 0xfd10
。MARS は基本的なアセンブラ命令ori $17, $18, 0x0000fd10
を提供します。これは、16 ビットの即値ori
をゼロ拡張する必要があるためです。機能を変更するだけori
でandi
、つまりソース コードの行andi $s1, $s2, 0xfd10
だけを変更すると、MARS はほぼ同じ基本的なアセンブラ命令andi $17, $18, 0x0000fd10
を提供します。ただし、 とは異なりori
、符号拡張andi
を使用する必要があります。したがって、基本的なアセンブラ命令は.andi $17, $18, 0xfffffd10
andi
また、ゼロ拡張を使用する必要があります。最初の質問は無視してください。
slti rt, rs, imm
たとえば、を使用しようとするとslti $s1, $s2, 0x8000
、MARS は行の実行を拒否し、エラー メッセージは"0x8000": operand is out of range
. 即時が範囲外である理由はわかりません。即時を少し下に変更すると、たとえば 、slti $s1, $s2, 0x7fff
機能し、即時が に拡張され0x00007fff
ます。私の期待は、0x8000
に拡張する必要があること0xffff8000
です。私の理解に何か問題がありますか?
cpu-architecture - ダイレクトアドレッシングモードの命令フォーマット
Assume a computer with a 16-bit memory and 16-bit data and address bus. So if an Instruction is of 16-bit let's say the opcode occupies 6 bits and the operand occupies the remaining 10 bits. In the direct addressing mode, the memory address of the operand is specified in the instruction itself. So how a 16-bit memory location is specified inside the 10-bit instruction operand. Is the address encoded somehow or one Instruction is stored in multiple memory locations? Sorry, If my question seems kind of stupid.
assembly - ARM プロセッサ: 即値の有効性チェック (ビットローテーション)
命令サイズが 32 ビットの ARM プロセッサでは、ARM が 8 ビットを使用して値を格納し、4 ビットをビット ローテーション命令 (2 の倍数で 8 ビット値をビット シフトする) に使用できることを理解しています。即値の単純な 8/12 ビット表現よりもはるかに優れた範囲です。
ARM が拡張範囲を取得するプロセスを理解していますが、選択した即時値がこのスキームで有効かどうかを簡単に確認する方法があるかどうかを知りたいと思っています。この値が ARM のビット ローテーション スキームで有効かどうかを判断するのに役立つ数値 (バイナリまたは 16 進数) のどのような特性を調べていますか?
編集:これは、私が話している概念へのリンクです。