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
|
.include "macros.inc"
.section .text, "ax"
.global __StringRead
__StringRead:
cmpwi r5, 1
beq lbl_80085B3C
bge lbl_80085B00
cmpwi r5, 0
bge lbl_80085B0C
b lbl_80085B70
lbl_80085B00:
cmpwi r5, 3
bge lbl_80085B70
b lbl_80085B68
lbl_80085B0C:
lwz r4, 0(r3)
lbz r5, 0(r4)
extsb. r0, r5
bne lbl_80085B2C
li r0, 1
stw r0, 4(r3)
li r3, -1
blr
lbl_80085B2C:
addi r0, r4, 1
stw r0, 0(r3)
extsb r3, r5
blr
lbl_80085B3C:
lwz r0, 4(r3)
cmpwi r0, 0
bne lbl_80085B58
lwz r5, 0(r3)
addi r0, r5, -1
stw r0, 0(r3)
b lbl_80085B60
lbl_80085B58:
li r0, 0
stw r0, 4(r3)
lbl_80085B60:
mr r3, r4
blr
lbl_80085B68:
lwz r3, 4(r3)
blr
lbl_80085B70:
li r3, 0
blr
|