Allow implicit floating point immediate for FPP instructions

which have an general (source) argument and an AC destination.
There are no FPP instrs which have 1 general source arg;
only with 1 general destination (even TSTF).
This commit is contained in:
Olaf Seibert
2021-01-23 15:56:06 +01:00
parent 28f891dc1f
commit 0e3d596daf
7 changed files with 151 additions and 15 deletions

View File

@@ -121,16 +121,45 @@
99 000340 077777 177777 177777 .FLT4 170141183460469230564930741053754966016 ; 2**127-(2**70-2**64+2**62+2)
000346 177777
100
101 .end
101
101 ; Several ways to define a name for the fpp registers
102 ; TODO: change symbol table to show % sign
103
104 000000 ac0 = r0
105 000001 ac1 = %1
106 000002 f2 = %2
107
108 000350 171003 mulf r3,ac0
109 000352 171102 mulf r2,ac1
110 000354 172227 041040 ADDF #^O41040,F2
111 000360 172127 040200 addf #1,ac1
112
113 000364 171003 mulf r3,ac0
114 000366 171102 mulf r2,ac1
115 000370 172227 041040 addf #^O41040,F2 ; taken literally
116 000374 172127 040200 addf #1,ac1 ; as float
117 000400 172127 040200 addf #1.,ac1 ; as float
118 000404 172127 000001 addf #^D1,ac1 ; literally
119 000410 172127 000002 addf #<1+1>,ac1 ; literally
120 000414 172127 040300 addf #1.5,ac1 ; as float
121 000420 172127 140263 addd #-1.4,ac1 ; as float
122
123 ; TODO: let parser check for junk at end of line
124 000424 170627 000002 absf #2.5 ; bad: operand is destination
125 000430 170527 000002 tstd #2.5 ; bad: operand is considered FDST by the arch handbook
126 000434 174027 000002 stf ac0,#2.5 ; bad: junk at end of line
127 000440 174027 000002 stf ac0,#2 ; doesn't makes sense but MACRO11 allows it
128
129
130 .end
130
Symbol table
. ******R 001
. ******R 001 AC0 =000000 AC1 =000001 F2 =000002
Program sections:
. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV)
000350 001 (RW,I,LCL,REL,CON,NOSAV)
000444 001 (RW,I,LCL,REL,CON,NOSAV)

View File

@@ -98,4 +98,33 @@
.FLT4 170141183460469230564930741053754966015 ; 2**127-(2**70-2**64+2**62+1)
.FLT4 170141183460469230564930741053754966016 ; 2**127-(2**70-2**64+2**62+2)
; Several ways to define a name for the fpp registers
; TODO: change symbol table to show % sign
ac0 = r0
ac1 = %1
f2 = %2
mulf r3,ac0
mulf r2,ac1
ADDF #^O41040,F2
addf #1,ac1
mulf r3,ac0
mulf r2,ac1
addf #^O41040,F2 ; taken literally
addf #1,ac1 ; as float
addf #1.,ac1 ; as float
addf #^D1,ac1 ; literally
addf #<1+1>,ac1 ; literally
addf #1.5,ac1 ; as float
addd #-1.4,ac1 ; as float
; TODO: let parser check for junk at end of line
absf #2.5 ; bad: operand is destination
tstd #2.5 ; bad: operand is considered FDST by the arch handbook
stf ac0,#2.5 ; bad: junk at end of line
stf ac0,#2 ; doesn't makes sense but MACRO11 allows it
.end