안녕하세요 혹시 mips사용하시는 분들 계신가요?
안녕하세요. 다름이 아니라 MIPS를 David A.Patterson, John L.henness의 Computer Organization&Design이 책으로 공부하는 중인데요. CD에 있는 project중에
Write a subroutine, wait, that will wait until the button K2 is pressed, then wait until the button is released, and finally, return. It should read from the address 0xbfa00000 until it receives a 1 in bit position 0 from this read operation. Next, it should read until the bit becomes zero again, and then return. This method of receiving 2 information from the outer world is called polling. The subroutine should be called with the instruction jal wait, as shown in the main program above.
#include
.set noreorder
.text
.globl start
.ent start
start : jal wait # Wait for button click
nop
lui s0, 0xbf90 # Load switch port address
lb s1, 0x0(s0) # Read first number from switches
nop
jal wait # Wait for button click
nop
lb s2, 0x0(s0) # Read second number from switches
nop
addu s3, s1, s2 # Perform an arithmetic operation
sb s3, 0x0(s0) # Write the result to LEDs
jal finish
nop
b start
nop
wait :(여기 빈칸의 인스트럭션을 채워야 하는데요...)
finish : lui t2, 0xbfa0
lb t3, 0x0(t2)
nop
sb t3, 0x0(t2)
nop
bnez t3, k3
nop
b finish
nop
k3 : lui t2. 0xbfa0
lb t3, 0x0(t2)
nop
sb t3, 0x0(t2)
nop
bnez t3, k3
nop
jr ra
.end start
이 문제를 어떻게 풀어야할지 도저히 모르겠어서 도움을 요청해 봅니다:)
지문의 내용을 잘 읽어보시면 아시리라 생각합니다.
문제라고 말씀하신 wait 서브루틴은 다음의 설명을 수행하도록 만들어야 하겠죠?
0xbfa00000 번지의 값이 1이 되었다가 0이 되었을 때, K2 스위치가 눌렸다가 떼였다는 것을 감지할 수 있을 것입니다. finish 루틴을 보시면 어느 정도 이해하실 수 있으리라 생각합니다. 저도 그 책을 읽고 MIPS 구현을 해봤습니다만, 오랫만의 AT&T 어셈블러 문법이라 조금 아리송 하네요.
크게 어려운 문제는 아니니 이해하시리라 생각합니다.
====
하나는 전부, 전부는 하나
넵..
k2가 실행스위치이고 k1이 리셋스위치인것은 알겠는데 도통 저 사이에 어떤 인스트럭션을 넣어야 하는지 모르겠어서요ㅜ
법을 선택한 다음 "설정
면 어느 정도 이해하실 수음 "설정 저장"음 "설정 저장"을 누을 누 있으리라 생각합니다. 저도 그 책음 "설정 저장"을 누을 읽고음 "설정 저장"을 누 MIPS 구현을 해봤습니다만, 오랫만의 AT&T 음 "설정 저장"을 누
댓글 달기