legacy-cc

The earliest versions of the very first c compiler known to exist in the wild written by the late legend himself dmr. https://github.com/mortdeus/legacy-cc
git clone http://git.hanabi.in/repos/legacy-cc.git
Log | Files | Refs | README

c1t.s (2521B)


      1 / C operator tables
      2 
      3 .globl	_getwrd
      4 
      5 .globl	getw
      6 .globl	fopen
      7 .globl	_tmpfil
      8 
      9 .data
     10 _getwrd: 1f
     11 .text
     12 1:
     13 	tst	buf
     14 	bne	1f
     15 	mov	_tmpfil,r0
     16 	jsr	r5,fopen; buf
     17 	bes	botchp
     18 1:
     19 	jsr	r5,getw; buf
     20 	bes	botchp
     21 	rts	pc
     22 botchp:
     23 	mov	$1,r0
     24 	sys	write; botch; ebotch-botch
     25 	sys	exit
     26 botch:
     27 	<Temp file botch.\n>; ebotch:
     28 .even
     29 .bss
     30 buf:	.=.+518.
     31 .text
     32 .globl	_opdope
     33 .globl	_instab
     34 
     35 _instab:.+2
     36 	40.; 1f; 1f; .data; 1:<add\0>; .text
     37 	70.; 1b; 1b
     38 	41.; 2f; 2f; .data; 2:<sub\0>; .text
     39 	71.; 2b; 2b
     40 	30.; 3f; 1b; .data; 3:<inc\0>; .text
     41 	31.; 4f; 2b; .data; 4:<dec\0>; .text
     42 	32.; 3b; 1b
     43 	33.; 4b; 2b
     44 
     45 	45.; 2b; 5f; .data; 5:<ac\0>; .text
     46 	46.; 6f; 7f; .data; 6:<mov\0>; 7:<(r4)\0>; .text
     47 	75.; 2b; 5b
     48 	76.; 6b; 7b
     49 	43.; 7b; 1f; .data; 1:<divf\0>; .text
     50 	44.; 5b; 0
     51 	73.; 7b; 1b
     52 	74.; 5b; 0
     53 
     54 	60.; 0f; 1f; .data; 0:<beq\0>; 1:<bne\0>; .text
     55 	61.; 1b; 0b
     56 	62.; 2f; 5f; .data; 2:<ble\0>; 5:<bgt\0>; .text
     57 	63.; 3f; 4f; .data; 3:<blt\0>; 4:<bge\0>; .text
     58 	64.; 4b; 3b
     59 	65.; 5b; 2b
     60 	66.; 6f; 9f; .data; 6:<blos\0>; 9:<bhi\0>; .text
     61 	67.; 7f; 8f; .data; 7:<blo\0>; 8:<bhis\0>; .text
     62 	68.; 8b; 7b
     63 	69.; 9b; 6b
     64 	0
     65 	.data
     66 	.even
     67 	.text
     68 
     69 _opdope:.+2
     70 	00000	/ EOF
     71 	00000	/ ;
     72 	00000	/ {
     73 	00000	/ }
     74 	36000	/ [
     75 	02000	/ ]
     76 	36000	/ (
     77 	02000	/ )
     78 	02000	/ :
     79 	07001	/ ,
     80 	00000	/ 10
     81 	00000	/ 11
     82 	00000	/ 12
     83 	00000	/ 13
     84 	00000	/ 14
     85 	00000	/ 15
     86 	00000	/ 16
     87 	00000	/ 17
     88 	00000	/ 18
     89 	00000	/ 19
     90 	00000	/ name
     91 	00000	/ short constant
     92 	00000	/ string
     93 	00000	/ float
     94 	00000	/ double
     95 	00000	/ 25
     96 	00000	/ 26
     97 	00000	/ 27
     98 	00000	/ 28
     99 	00000	/ 29
    100 	34002	/ ++pre
    101 	34002	/ --pre
    102 	34002	/ ++post
    103 	34002	/ --post
    104 	34020	/ !un
    105 	34002	/ &un
    106 	34020	/ *un
    107 	34000	/ -un
    108 	34020	/ ~un
    109 	00000	/ 39
    110 	30101	/ +
    111 	30001	/ -
    112 	32101	/ *
    113 	32001	/ /
    114 	32001	/ %
    115 	26061	/ >>
    116 	26061	/ <<
    117 	20161	/ &
    118 	16161	/ |
    119 	16161	/ ^
    120 	00000	/ 50
    121 	00000	/ 51
    122 	00000	/ 52
    123 	00000	/ 53
    124 	00000	/ 54
    125 	00000	/ 55
    126 	00000	/ 56
    127 	00000	/ 57
    128 	00000	/ 58
    129 	00000	/ 59
    130 	22105	/ ==
    131 	22105	/ !=
    132 	24105	/ <=
    133 	24105	/ <
    134 	24105	/ >=
    135 	24105	/ >
    136 	24105	/ <p
    137 	24105	/ <=p
    138 	24105	/ >p
    139 	24105	/ >=p
    140 	12013	/ =+
    141 	12013	/ =-
    142 	12013	/ =*
    143 	12013	/ =/
    144 	12013	/ =%
    145 	12053	/ =>>
    146 	12053	/ =<<
    147 	12053	/ =&
    148 	12053	/ =|
    149 	12053	/ =^
    150 	12013	/ =
    151 	00000	/ 81
    152 	00000	/ 82
    153 	00000	/ 83
    154 	00000	/ int -> float
    155 	00000	/ int -> double
    156 	00000	/ float -> int
    157 	00000	/ float -> double
    158 	00000	/ double -> int
    159 	00000	/ double -> float
    160 	14001	/ ?
    161 	00000	/ 91
    162 	00000	/ 92
    163 	00000	/ 93
    164 	00000	/ int -> float
    165 	00000	/ int -> double
    166 	00000	/ float -> double
    167 	00000	/ int -> int[]
    168 	00000	/ int -> float[]
    169 	00000	/ int -> double[]
    170 	36001	/ call
    171 	36001	/ mcall