source: buchla-68k/alcyon/strncmp.s@ ca9ec00

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