source: buchla-68k/alcyon/ungetc.s@ 4810254

Last change on this file since 4810254 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 515 bytes
RevLine 
[7bf3856]1.globl _Cbuffs
2.globl _Stdbufs
3.globl _Stdbuf
4.globl _ungetc
5.text
6_ungetc:
7~~ungetc:
8~c=R7
9~ptr=R13
10link R14,#0
11movem.l R6-R7/R13-R13,-(sp)
12*line 16
13move 8(R14),R7
14*line 16
15move.l 10(R14),R13
16*line 16
17*line 17
18cmp #-1,R7
19beq L10000
20move.l (R13),R0
21cmp.l 8(R13),R0
22bhi L2
23L10000:*line 17
24move #-1,R0
25bra L1
26*line 18
27L2:
28*line 19
29sub.l #1,(R13)
30move R7,R0
31move.l (R13),R9
32move.b R0,(R9)
33*line 21
34move R7,R0
35bra L1
36L1:tst.l (sp)+
37movem.l (sp)+,R7-R7/R13-R13
38unlk R14
39rts
40.data
Note: See TracBrowser for help on using the repository browser.