-
Notifications
You must be signed in to change notification settings - Fork 0
/
sudoku.s
77 lines (60 loc) · 1.11 KB
/
sudoku.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
.text
start:
li sp 0x10000
la s0 inputcnt
lw s0 0(s0)
la a0 inputs
input_loop:
#jal solve
addi a0 a0 16
addi s0 s0 -1
bnez s0 input_loop
la s0 inputcnt
lw s0 0(s0)
la s1 inputs
la s2 answers
loop_answers:
li s3 16
addi s4 zero 0
loop_answer:
add t0 s3 s1
add t1 s3 s2
lb t2 0(t0)
lb t3 0(t1)
beq t2 t3 skip_different
addi s4 s4 1
skip_different:
addi s3 s3 -1
bnez s3 loop_answer
li t4 0x10000
sw s4 0(t4)
addi s0 s0 -1
bnez s0 loop_answers
hcf
#########################################
####### Modify this part! #############>>
solve:
addi sp sp -8
sw a0 4(sp)
sw ra 0(sp)
lw ra 0(sp)
lw a0 4(sp)
addi sp sp 8
ret
### Do not modify beyond this point! ##<<
#########################################
.data
inputcnt:
.word 3
inputs:
.byte 0 4 3 0 0 0 4 2 0 2 0 0 3 0 0 0
.byte 0 0 3 0 0 4 0 2 0 0 2 0 0 2 0 3
.byte 0 3 0 4 0 0 2 0 4 0 3 0 0 0 0 2
answers:
.byte 2 4 3 1 1 3 4 2 4 2 1 3 3 1 2 4
.byte 2 1 3 4 3 4 1 2 4 3 2 1 1 2 4 3
.byte 2 3 1 4 1 4 2 3 4 2 3 1 3 1 4 2