1
0
mirror of https://github.com/aap/pdp6.git synced 2026-01-13 23:37:09 +00:00

floating point division

This commit is contained in:
aap 2016-04-27 18:05:01 +02:00
parent d5db4f2a3b
commit 5a11c7ea4e
2 changed files with 23 additions and 8 deletions

21
apr.c
View File

@ -423,7 +423,7 @@ relocate(Apr *apr)
membus0 &= ~0007777777761;
membus0 |= ma_fmc_select ? MEMBUS_MA_FMC_SEL1 : MEMBUS_MA_FMC_SEL0;
membus0 |= (apr->ma&01777) << 4;
membus0 |= (apr->rla&017) << 14;
membus0 |= ((word)apr->rla&017) << 14;
membus0 |= apr->rla & 0020 ? MEMBUS_MA21_1|MEMBUS_MA21 : MEMBUS_MA21_0;
membus0 |= apr->rla & 0040 ? MEMBUS_MA20_1 : MEMBUS_MA20_0;
membus0 |= apr->rla & 0100 ? MEMBUS_MA19_1 : MEMBUS_MA19_0;
@ -1571,7 +1571,7 @@ pulse(ds_div_t0){
pulse(nrt6){
trace("NRT6\n");
nextpulse(apr, et10); // 5-5
nextpulse(apr, et10); // 5-5
}
pulse(nrt5a){
@ -1664,7 +1664,7 @@ pulse(fst0a){
apr->fsf1 = 0; // 6-19
if(!AR0_EQ_SC0)
SET_OVERFLOW; // 6-17
apr->ar |= apr->ar&0400777777777 | (apr->sc&0377)<<27; // 6-4
apr->ar |= apr->ar&0400777777777 | ((word)apr->sc&0377)<<27; // 6-4
nextpulse(apr, et10); // 5-5
}
@ -1774,12 +1774,23 @@ pulse(fmt0){
/* Divide */
pulse(fdt1){
word ar0_shr_inp;
word mq0_shr_inp, mq1_shr_inp;
trace("FDT1\n");
// 6-7
ar0_shr_inp = apr->ar & F0;
mq0_shr_inp = apr->ar & F0;
mq1_shr_inp = (apr->ar & F35) << 34;
AR_SH_RT; // 6-17
MQ_SH_RT; // 6-17
nextpulse(apr, nrt0_5); // 6-27
}
pulse(fdt0b){
trace("FDT0B\n");
apr->fdf2 = 0; // 6-22
apr->sc = apr->fe; // 6-15
apr->nrf2 = 1; // 6-27
nextpulse(apr, fdt1); // 6-22
}
@ -1787,6 +1798,8 @@ pulse(fdt0a){
trace("FDT0A\n");
apr->fdf1 = 0; // 6-22
apr->fdf2 = 1; // 6-22
apr->sc = 0741; // 6-14
nextpulse(apr, apr->ar & F0 ? dst0 : dst10); // 6-25
}
pulse(fdt0){
@ -2238,7 +2251,7 @@ pulse(et3){
if(apr->ex_ir_uuo){
// MBLT <- IR(1) (UUO T0) on 6-3
apr->mb |= (apr->ir&0777740) << 18; // 6-1
apr->mb |= ((word)apr->ir&0777740) << 18; // 6-1
apr->ma |= F30; // 7-3
apr->uuo_f1 = 1; // 5-10
nextpulse(apr, mc_wr_rq_pulse); // 7-8

10
mem
View File

@ -1,9 +1,11 @@
1000: 200000001003
1001: 160000001007
1000: 200000001011
1001: 150000001012
1002: 254200000000
1003: 202400000000
1004: 576400000000
1005: 200400000000
1006: 577400000000
1005: 201600000000
1006: 576200000000
1007: 204500000000
1010: 573300000000
1011: 204600000000
1012: 203400000000