私はLC3シミュレータをC言語で実装しようとしていますが、私が実行した命令コードを解析中です。私は、特定の短いint( 'Word'として定義されている)のビットを取得するはずのget_bits()メソッドを持っています。所与の命令、1221用 Word get_bits(Word val, Word leftBit, Word rightBit){
printf("\nWord: %x
これは私がこれまで持っているものです。 .orig x3000
Lea r0, EnterString
puts
LOOP
getc
add r1, r0, -10 ;subtract 10 to identified if enter is pressed
brz OUTSIDE ;if yes, go out of the loop
LC3シミュレータ用のプログラムを作成しようとしています。メモリ内の別の場所に格納されている2進数の1の数をカウントできます。ここで私はこれまで持っているものです。 0011 0001 0000 0000 ; Start the data at memory location x3100
0110 1010 1111 0001 ; Hex number stored at x3000
001