Last change
on this file since 0170798 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added Alcyon C reference output.
|
-
Property mode
set to
100644
|
File size:
695 bytes
|
Rev | Line | |
---|
[7bf3856] | 1 | .globl _strncmp
|
---|
| 2 | .text
|
---|
| 3 | _strncmp:
|
---|
| 4 | ~~strncmp:
|
---|
| 5 | ~s1=R13
|
---|
| 6 | ~s2=R12
|
---|
| 7 | ~n=R7
|
---|
| 8 | link R14,#0
|
---|
| 9 | movem.l R6-R7/R12-R13,-(sp)
|
---|
| 10 | *line 16
|
---|
| 11 | move.l 8(R14),R13
|
---|
| 12 | *line 16
|
---|
| 13 | move.l 12(R14),R12
|
---|
| 14 | *line 16
|
---|
| 15 | move 16(R14),R7
|
---|
| 16 | *line 16
|
---|
| 17 | *line 17
|
---|
| 18 | cmp.l R12,R13
|
---|
| 19 | bne L2
|
---|
| 20 | *line 17
|
---|
| 21 | clr R0
|
---|
| 22 | bra L1
|
---|
| 23 | *line 18
|
---|
| 24 | L2:
|
---|
| 25 | *line 19
|
---|
| 26 | bra L5
|
---|
| 27 | L4:
|
---|
| 28 | *line 20
|
---|
| 29 | *line 21
|
---|
| 30 | tst.b (R13)+
|
---|
| 31 | bne L6
|
---|
| 32 | *line 21
|
---|
| 33 | clr R0
|
---|
| 34 | bra L1
|
---|
| 35 | *line 22
|
---|
| 36 | L6:L5:
|
---|
| 37 | *line 23
|
---|
| 38 | sub #1,R7
|
---|
| 39 | blt L10000
|
---|
| 40 | move.b (R13),R0
|
---|
| 41 | ext.w R0
|
---|
| 42 | cmp.b (R12)+,R0
|
---|
| 43 | beq L4
|
---|
| 44 | L10000:L3:
|
---|
| 45 | *line 23
|
---|
| 46 | tst R7
|
---|
| 47 | bge L10001
|
---|
| 48 | clr R0
|
---|
| 49 | bra L10003
|
---|
| 50 | L10001:move.b (R13),R0
|
---|
| 51 | ext.w R0
|
---|
| 52 | move.b -(R12),R1
|
---|
| 53 | ext.w R1
|
---|
| 54 | sub R1,R0
|
---|
| 55 | L10003:bra L1
|
---|
| 56 | L1:tst.l (sp)+
|
---|
| 57 | movem.l (sp)+,R7-R7/R12-R13
|
---|
| 58 | unlk R14
|
---|
| 59 | rts
|
---|
| 60 | .data
|
---|
Note:
See
TracBrowser
for help on using the repository browser.