source: buchla-68k/alcyon/atoi.s@ 0170798

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: 803 bytes
Line 
1.globl ___atab
2.globl _atoi
3.text
4_atoi:
5~~atoi:
6~cp=R13
7link R14,#0
8movem.l R5-R7/R13-R13,-(sp)
9~i=R7
10~sign=R6
11*line 18
12move.l 8(R14),R13
13*line 18
14clr R6
15*line 20
16*line 20
17cmp.b #45,(R13)
18bne L2
19*line 21
20*line 22
21add.l #1,R13
22*line 23
23move #1,R6
24*line 24
25bra L3
26L2:
27*line 25
28*line 26
29*line 27
30*line 28
31cmp.b #43,(R13)
32bne L4
33*line 28
34add.l #1,R13
35L4:L3:
36*line 31
37clr R7
38bra L7
39L8:
40*line 32
41mulu #10,R7
42move.b (R13)+,R0
43ext.w R0
44and #127,R0
45add R0,R7
46add #-48,R7
47L6:L7:
48*line 31
49move.b (R13),R0
50ext.w R0
51ext.l R0
52add.l #___atab,R0
53move.l R0,R8
54btst #2,(R8)
55bne L8
56L5:
57*line 34
58tst R6
59beq L10000
60clr R0
61move R7,R0
62neg R0
63bra L10002
64L10000:clr R0
65move R7,R0
66L10002:bra L1
67L1:tst.l (sp)+
68movem.l (sp)+,R6-R7/R13-R13
69unlk R14
70rts
71.data
Note: See TracBrowser for help on using the repository browser.