問題タブ [mips]

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 に答える
207 参照

assembly - MIPS での奇妙な命令呼び出し

MIPS 命令に syscall コードはありませんが、シミュレーターでは次のように表示されます。

代替テキスト

.s に次のコード行がありません

何故ですか?システムコールで間違ったアドレスが返されるので気になります

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

mips - MIPSフェッチアドレスがワード境界に整列されていません。.align4を使用していますが、まだ実行されません

何か案は?発生する理由:0x00400020でのランタイム例外:フェッチアドレスがワード境界に整列されていません0x00000007問題の行は次のとおりです:lw $ s1,0($ a1)#copyarg2=配列のサイズ

0 投票する
2 に答える
8995 参照

c - C から MIPS への変換

この c コードを MIPS に変換し、SPIM で実行しようとしています。

これまでのところ、これは私が持っているものです。

SPIM で実行すると、次のエラーが発生します。

何らかの方向性がいいでしょう。ありがとう

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

mips - MIPS アセンブリのヘルプ - ジャンプとリンク

これまで MIPS アセンブリを使用したことがなく、クラスで紹介されたばかりです。宿題に取り組んでいますが、関数を呼び出すのに苦労しています。これが私がこれまでに取り組んだことです:

問題は、それが永久にループしていることです。そのため、$a1 が適切に処理されていないと思います。このコードは、関数でサイズを直接設定していたときに機能します。誰かが私を正しい方向に向けることができますか? ありがとう!

0 投票する
2 に答える
85857 参照

arrays - MIPSでのアレイの作成(およびアクセス)

MIPSアセンブリで配列を作成してから、すべての要素を一緒に追加しようとしています。しかし、以下を組み立てようとすると、

read_arrayの1行目の7番目のエラー:「。word」ディレクティブをテキストセグメントに表示できません。アセンブル:操作がエラーで完了しました。

これが私のアセンブリです:

ありがとう!

0 投票する
3 に答える
8322 参照

assembly - シングルサイクルデータパスの先行ゼロをカウント

ご存知かもしれませんが、MIPS命令セットは次のようにclz(先行ゼロのカウント)をサポートしています。

clz $ t0、$t1先行ゼロをカウントt0=t1の先行ゼロの数

私はVerilogでシングルサイクルデータパスを書いていますが、これを行うためにALUが何をサポートする必要があるのか​​疑問に思っていました...何かアイデアはありますか?

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

vhdl - シングル サイクル データパスでハーフ ワードをロードし、バイトをロードする

データ メモリを変更せずにロード バイトをシングル サイクル データパスに実装することについて尋ねられたこの問題があり、解決策は次のようなものでした。

代替テキスト http://img214.imageshack.us/img214/7107/99897101.jpg

This is actually quite a realistic question; most memory systems are entirely word-based, and individual bytes are typically only dealt with inside the processor. When you see a “bus error” on many computers, this often means that the processor tried to access a memory address that was not properly word-aligned, and the memory system raised an exception. Anyway, because byte addresses might not be a multiple of 4, we cannot pass them to memory directly. However, we can still get at any byte, because every byte can be found within some word, and all word addresses are multiples of 4. So the first thing we do is to make sure we get the right word. If we take the high 30 bits of the address (i.e., ALUresult[31-2]) and combine them with two 0 bits at the low end (this is what the “left shift 2” unit is really doing), we have the byte address of the word that contains the desired byte. This is just the byte’s own address, rounded down to a multiple of 4. This change means that lw will now also round addresses down to multiples of 4, but that’s OK since non-aligned addresses wouldn’t work for lw anyway with this memory unit. OK, now we get the data word back from memory. How do we get the byte we want out of it? Well, note that the byte’s byte-offset within the word is just given by the low-order 2 bits of the byte’s address. So, we simply use those 2 bits to select the appropriate byte out of the word using a mux. Note the use of big-endian byte numbering, as is appropriate for MIPS. Next, we have to zero-extend the byte to 32 bits (i.e., just combine it with 24 zeros at its high end), because the problem specifies to do so. Actually, this was a slight mistake in the question: in reality, the lbu instruction zero-extends the byte, but lb sign-extends it. Oh, well. Finally, we have to extend the MemtoReg-controlled mux to accept one new input: the zero-extended byte for the lb case. The MemtoReg control signal must be widened to 2 bits. The original 0 and 1 cases change to 00 and 01, respectively, and we add a new case 10 which is only used in the case of lb.

I don't quite actually understand on how this works even after reading the explanation, especially about left shift the ALU result by 2 would give the byte address... how is this possible?? so if I would like to load a half word then I would do one left shift and I would get the address of the half word?? what would be a better way to do load byte, load half word by modifying the data memory? (the question above puts constraints that we can't modify the data memory)

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

assembly - MIPS アセンブリの .word ディレクティブ

この MIPS コードでは、.word 部分は何をするのでしょうか? 私のエミュレータは、テキスト セクションのデータ ディレクティブを処理できません。ディレクティブは何をしますか? そして、.word -8 ではなく、.word -2 と .word -6 を実行するポイントは何ですか?

0 投票する
4 に答える
1890 参照

memory - メモリアドレスを理解する

MIPS でのメモリ アドレッシングに問題があります。アドレッシングはワードで整列されていると書かれています...下のテキストでは、アドレスの最下位2ビットを見ている理由がわかりませんか? なぜ?誰かがここでのポイントを明確/説明する例を教えてもらえますか...では、有効なハーフワードアドレスはすべて、最下位2ビットが00または10のいずれかであると言っていますか?

では、ワード アラインされたメモリからバイトをロードしたい場合はどうすればよいでしょうか?? これどうやってするの?左に 2 シフトする必要がある、つまり、最下位 2 ビットを 0 にする必要があると言われています。

代替テキスト http://img69.imageshack.us/img69/1603/jpgdw.jpg

0 投票する
2 に答える
3147 参照

assembly - 符号付き整数の MIPS 除算

組み込みの除算演算を使用せずに、MIPS で 2 つの符号付き整数の間で除算を実行する方法を誰かが知っているかどうか疑問に思っています。

問題の仕様では、除数レジスタ、ALU、商レジスタはすべて 32 ビット幅で、剰余レジスタは 64 ビットであると言われています。