// MDfixup -- JCN fixup pass // last edited November 3, 1978 5:24 PM get "mddecl.d" get "mdfields.d" external // defined here [ FixupJCN // () ] external // used [ // MDmain @IP @NInstructions @DMachine // MDprescan @PageMask ] structure IMA: // decompositions of a real 12-bit address [ blank bit 4 page bit 6 // Dorado = [ p0thru4 bit 5 pbit5 bit 1 ] // D0 = [ blank bit 4 wd0thru1 bit 2 ] wd bit 6 = [ wd2thru3 bit 2 wd4thru7 bit 4 = [ wd4thru6 bit 3 wdbit7 bit 1 ] = [ blank bit 1 wd5thru6 bit 2 blank bit 1 ] ] = [ wd2thru6 bit 5 blank bit 1 ] = [ blank bit 1 wd3thru6 bit 4 blank bit 1 ] ] let FixupJCN() be // Fill in branch control fields of instructions // Does no error checking! [ for i = 0 to NInstructions-1 do [ let ip = IP(i) if ip>>IM.returns loop let i1 = ip>>IM.W1 if i1 eq WExt loop let a0 = ip>>IM.W0 let a1 = IP(i1)>>IM.W0 test DMachine eq 0 ifso // Fill in FA [ test ip>>IM.iscond ifso ip>>TI.JA2thru6 = a1<>TI.JA2thru7 = a1<>TI.JA0thru1 = a1<>IM.iscond & ip>>IM.jbc ifso // must use short form ip>>TI.JNfast = a1<>TI.JCglobal, ip>>TI.JNglobal = JCglobalV, a1<>TI.JClocal, ip>>TI.JNlocal = JClocalV, a1<>TI.JClong, ip>>TI.JNlong, ip>>TI.FF = JClongV, a1&17B, a1 rshift 4 ] ifnot // Dorado model 1 [ test ip>>IM.iscond & ip>>IM.jbc ifso // must use short form ip>>TI.JN1fast2thru3, ip>>TI.JN1fast5thru6 = a1<>TI.JC1global, ip>>TI.JN1global2thru6, ip>>TI.JN1bit7 = JC1globalV, a1<>TI.JC1local, ip>>TI.JN1local2thru6, ip>>TI.JN1bit7 = JC1localV, a1<>TI.JC1long, ip>>TI.JN1long4thru6, ip>>TI.JN1bit7, ip>>TI.FF = JC1longV, a1<