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