Last change
on this file since ca867c1 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added Alcyon C reference output.
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[7bf3856] | 1 | .globl _Cbuffs
|
---|
| 2 | .globl _Stdbufs
|
---|
| 3 | .globl _Stdbuf
|
---|
| 4 | .globl _getc
|
---|
| 5 | .text
|
---|
| 6 | _getc:
|
---|
| 7 | ~~getc:
|
---|
| 8 | ~ptr=R13
|
---|
| 9 | link R14,#0
|
---|
| 10 | movem.l R6-R7/R13-R13,-(sp)
|
---|
| 11 | ~len=R7
|
---|
| 12 | *line 17
|
---|
| 13 | move.l 8(R14),R13
|
---|
| 14 | *line 17
|
---|
| 15 | *line 17
|
---|
| 16 | move.l (R13),R0
|
---|
| 17 | cmp.l 4(R13),R0
|
---|
| 18 | blo L2
|
---|
| 19 | *line 18
|
---|
| 20 | *line 19
|
---|
| 21 | *line 20
|
---|
| 22 | btst #3,12(R13)
|
---|
| 23 | beq L3
|
---|
| 24 | *line 20
|
---|
| 25 | move #-1,R0
|
---|
| 26 | bra L1
|
---|
| 27 | *line 21
|
---|
| 28 | L3:
|
---|
| 29 | *line 22
|
---|
| 30 | and.b #-5,12(R13)
|
---|
| 31 | *line 23
|
---|
| 32 | *line 24
|
---|
| 33 | *line 25
|
---|
| 34 | tst.l 8(R13)
|
---|
| 35 | bne L4
|
---|
| 36 | *line 25
|
---|
| 37 | move.l R13,(sp)
|
---|
| 38 | jsr _getbuff
|
---|
| 39 | *line 26
|
---|
| 40 | L4:
|
---|
| 41 | *line 27
|
---|
| 42 | *line 27
|
---|
| 43 | move 16(R13),(sp)
|
---|
| 44 | move.l 8(R13),-(sp)
|
---|
| 45 | move.b 13(R13),R0
|
---|
| 46 | ext.w R0
|
---|
| 47 | move R0,-(sp)
|
---|
| 48 | jsr _read
|
---|
| 49 | addq.l #6,sp
|
---|
| 50 | move R0,R7
|
---|
| 51 | bgt L5
|
---|
| 52 | *line 28
|
---|
| 53 | *line 29
|
---|
| 54 | tst R7
|
---|
| 55 | bne L10000
|
---|
| 56 | move #8,R0
|
---|
| 57 | bra L10002
|
---|
| 58 | L10000:move #16,R0
|
---|
| 59 | L10002:move.b 12(R13),R1
|
---|
| 60 | or.b R0,R1
|
---|
| 61 | move.b R1,12(R13)
|
---|
| 62 | *line 30
|
---|
| 63 | move #-1,R0
|
---|
| 64 | bra L1
|
---|
| 65 | *line 31
|
---|
| 66 | *line 32
|
---|
| 67 | L5:
|
---|
| 68 | *line 33
|
---|
| 69 | move R7,R0
|
---|
| 70 | ext.l R0
|
---|
| 71 | move.l 8(R13),R1
|
---|
| 72 | move.l R1,(R13)
|
---|
| 73 | add.l R1,R0
|
---|
| 74 | move.l R0,4(R13)
|
---|
| 75 | *line 34
|
---|
| 76 | *line 35
|
---|
| 77 | L2:
|
---|
| 78 | *line 36
|
---|
| 79 | move.l (R13),R8
|
---|
| 80 | move.b (R8),R0
|
---|
| 81 | ext.w R0
|
---|
| 82 | and #255,R0
|
---|
| 83 | add.l #1,(R13)
|
---|
| 84 | bra L1
|
---|
| 85 | L1:tst.l (sp)+
|
---|
| 86 | movem.l (sp)+,R7-R7/R13-R13
|
---|
| 87 | unlk R14
|
---|
| 88 | rts
|
---|
| 89 | .data
|
---|
Note:
See
TracBrowser
for help on using the repository browser.