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

sptab.s (1273B)


      1 / c code tables-- expression to -(sp)
      2 
      3 .globl	_sptab
      4 
      5 _sptab=.;.+2
      6 	20.;	cs20
      7 	21.;	cs21
      8 	22.;	cs21
      9 	30.;	cs30
     10 	31.;	cs30
     11 	32.;	cs32
     12 	33.;	cs32
     13 	35.;	cs35
     14 	36.;	cs36
     15 	40.;	cs40
     16 	41.;	cs40
     17 	42.;	cs42
     18 	47.;	cs47
     19 	48.;	cs48
     20 	0
     21 
     22 
     23 / name
     24 cs20:
     25 %aw,n
     26 	mov	A,-(sp)
     27 
     28 / constant
     29 cs21:
     30 %z,n
     31 	clr	-(sp)
     32 
     33 %a,n
     34 	mov	A,-(sp)
     35 
     36 / ++,-- prefix
     37 cs30:
     38 %ai,n
     39 %abp,n
     40 	I	A1
     41 	mov	A1,-(sp)
     42 
     43 %aw,n
     44 	I'	$2,A1
     45 	mov	A1,-(sp)
     46 
     47 %nbp*,n
     48 %ni*,n
     49 	F*
     50 	I	#1(R)
     51 	mov	#1(R),-(sp)
     52 
     53 %nip*,n
     54 	F*
     55 	mov	#1(R),-(sp)
     56 	I'	$2,#1(R)
     57 
     58 / ++,-- postfix
     59 cs32:
     60 %ai,n
     61 %abp,n
     62 	mov	A1,-(sp)
     63 	I	A1
     64 
     65 %aip,n
     66 	mov	A1,-(sp)
     67 	I'	$2,A1
     68 
     69 %nbp*,n
     70 %ni*,n
     71 	F*
     72 	mov	#1(R),-(sp)
     73 	I	#1(R)
     74 
     75 %nip*,n
     76 	F*
     77 	mov	#1(R),-(sp)
     78 	I'	$2,#1(R)
     79 
     80 / & unary
     81 cs35:
     82 %i,n
     83 	mov	$A1,-(sp)
     84 
     85 / * unary
     86 cs36:
     87 %aw,n
     88 	mov	*A1,-(sp)
     89 
     90 %nw*,n
     91 	F*
     92 	mov	#1(R),-(sp)
     93 
     94 / +
     95 cs40:
     96 %n,aw
     97 	FS
     98 	I	A2,(sp)
     99 
    100 %n,nw*
    101 	FS
    102 	S*
    103 	I	#2(R),(sp)
    104 
    105 %n,n
    106 	FS
    107 	S
    108 	I	R,(sp)
    109 
    110 / *
    111 cs42:
    112 %aw,a
    113 	mov	A1,(r4)+
    114 	movB2	A2,(r4)
    115 	mov	-(r4),-(sp)
    116 
    117 %n,a
    118 	F
    119 	mov	R,(r4)+
    120 	movB2	A2,(r4)
    121 	mov	-(r4),-(sp)
    122 
    123 %n,nw*
    124 	FS
    125 	S*
    126 	mov	(sp)+,(r4)+
    127 	mov	#2(R),(r4)
    128 	mov	-(r4),-(sp)
    129 
    130 %n,n
    131 	FS
    132 	S
    133 	mov	(sp)+,(r4)+
    134 	mov	R,(r4)
    135 	mov	-(r4),-(sp)
    136 
    137 / &
    138 cs47:
    139 %n,c
    140 	FS
    141 	bic	$!C2,(sp)
    142 
    143 %n,n
    144 	FS
    145 	S
    146 	com	R
    147 	bic	R,(sp)
    148 
    149 / |
    150 cs48:
    151 %n,a
    152 	FS
    153 	bisB2	A2,(sp)
    154 
    155 %n,n*
    156 	FS
    157 	S*
    158 	bisB2	#2(R),(sp)
    159 
    160 %n,n
    161 	FS
    162 	S
    163 	bis	R,(sp)
    164 
    165 .data
    166 .even
    167 .text