電子書籍の厳選無料作品が豊富!

私は
α: r1
β: -1
γ: r1
δ: r2
と答えました。でもたぶん最後はr4です。いわれてみればそうですけど、なんでですか?
またなんで+8しますか??

「あせんうぶり言語」の質問画像
  • 画像を添付する (ファイルサイズ:10MB以内、ファイル形式:JPG/GIF/PNG)
  • 今の自分の気分スタンプを選ぼう!
あと4000文字

A 回答 (8件)

> what do you mean nobody knowsss :((



Just as I said. Nobody here (at 教えて!goo) knows what kind of assembly language it is.
You are the only one here, who should know what it is.

> this is all I got on this 過去問 thing from the class of コンピュータ概論Ⅱ 前期水4

That implies the assembly language you are dealing with is very "local" language. It may only work in the university you are attending to. Not a general one.
I guess the assembly language is a sort of pseudo one, which has an educational purpose.
If we knew where you were attending to, we could check out the syllabus on the web page and know what kind of text book you guys are using in コンピュータ概論Ⅱ 前期水4, but you yourself had better check out the syllabus and the name of text book used in the course. The "official" text book in your course might have what kind of assembly language is used and its specification; however if somebody here does not have the same text book, it is very difficult to say something general around the assembly language; thus you had better ask your classmate, 先輩, or professor about this kind of question. Again, this question seems to be very "local".
    • good
    • 0

> but how am I even supposed to know that???



If you ain't known that, nobody here knows what it is.
Where did you cite the problem from?
If it came from a certain text book, something like its preface would say what it was. If it came from a test, an examination, or a quiz, its booklet would show what kind of assembly language at the first-part like.

By the way, for instance, a certification exam like the Fundamental Information Technology Engineer Examination (基本情報技術者試験), provided as a Japanese government certification, uses CASL II as an assembly language; however CASL II exists just for the examination and is a pseudo assembly language, it is something official in Japan, though. In other words, it is not designed for a particular CPU.

CASL II:
https://ja.wikipedia.org/wiki/CASL

You may find some emulators to use CASL II somewhere on the internet.

The other "official" assembly language is Wasm, or WebAssembly.

WebAssembly:
https://en.wikipedia.org/wiki/WebAssembly

It is also something like a pseudo assembly language, but it runs on web browsers like Edge, Firefox, or Chrome, even though its target is not any CPU.

Whatever, what you showed looks neither. I wonder what kind of assembly language you showed is.
    • good
    • 0
この回答へのお礼

what do you mean nobody knowsss :((
this is all I got on this 過去問 thing from the class of コンピュータ概論Ⅱ 前期水4

お礼日時:2024/07/23 23:02

I am not familiar with assembly languages, but what I can say is THERE IS NO "COMMON" ASSEMBLY LANGUAGE; in other words, an assembly language is heavily dependent on a particular CPU, such as 6502, Z80, 680xx, Intel Core, PowerPC, R3000 and so on.


You have to specify what CPU you are dealing with.
That is what #3 is talking about.
    • good
    • 0
この回答へのお礼

but how am I even supposed to know that???
どつやってわかりますか???
これで全部だよ?

お礼日時:2024/07/21 03:58

No4 です



>かいてません。
そうでしたか、仮定して回答しなければいけない時点で、問題文としては不正確ですね

>わからないので、むしろわからないのでやめてください
申し訳ありません。C言語のカテゴリーなので、C言語がわかる前提で回答しましたが、回答とは関係ないので止めるようにします
    • good
    • 0
この回答へのお礼

ありがとう

お礼日時:2024/07/17 23:45

>+8しますか??


64bit CPUだからではないですか?問題文の最初に条件として書いていると思います

>最後はr4です。
I2:で、計算結果は、r4に入っているからです。問題の例をC言語的に書き直すと、分かりやすいでしょう

uint64_t r1 = NUMBER_OF_ARRAY;
void* r2 = ARRAY_START_ADDRESS;
uint64_t r3;
uint64_t r4 = 0;
uint64_t* r5 = RESULT_STORED_ADDRESS;

I1:
 r3 = (uint64_t *)(r2+0);
 r4 += r3;
 r2 += 8;
 r1 = [α] + [β];

 if ([γ] != 0)
  goto I1;

 *(r5+0) = [δ];
    • good
    • 0
この回答へのお礼

助かりました

ありがとうございます。
問題文の最初に条件として書いていると思います
かいてません。
でも考えたら、r2 をインクリメントするときに配列が64ビット整数で構成されていて各要素が8バイトになっているとそうぞうするしかないとおもいました。
計算結果は、r4に入っているからです
レジスタにロードしてr2ににに履いてたメモリのアドレスのさきのメモリの中の値でr2はめもりの上の配列を動くということが理解したらr4の理由もわかりました。
C言語的に書き直すと、分かりやすいでしょう
わからないので、むしろわからないのでやめてください。

お礼日時:2024/07/17 23:11

日本語としてどうか以前に、


プロセサを指定せずにアセンブリの質問をしてることがおかしい。
BNZ って何だよ? って話。
    • good
    • 0

最後のstはstore:結果を格納する


格納する場所は0番地にr5を修飾した番地。
(理由はR5はそういうレジスタだと書いて有る)

また、r1,r2,r5の値は配列の要素数、先頭アドレス、結果を格納するアドレスって書いて有る。

つまり、r4が和の値が格納されるレジスタだと解る。

ところで、+8するって何処に書いて有る??
    • good
    • 0

R4だと、落選してしまうからなあ...


考えものだなあ。
    • good
    • 0
この回答へのお礼

うーん・・・

日本語としておかしいと思います

お礼日時:2024/07/17 20:21

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!

このQ&Aを見た人はこんなQ&Aも見ています


このQ&Aを見た人がよく見るQ&A