tailieunhanh - The art of computer programming mmim - phần 10

Công bố đồng thời tại Canada. Không có phần nào của ấn phẩm này có thể được sao chép, lưu trữ trong một hệ thống thu hồi, hoặc truyền đi dưới bất kỳ hình thức nào hoặc bằng bất kỳ phương tiện, điện tử, cơ khí | 122 ANSWERS TO EXERCISES 13. 577 SET XX 0 518 519 520 521 522 523 524 2H SLU t t 55 INCL XX 1 SLU PBNN t 2B SET t 100 SRU t t XX ANDN exc exc t Loop to find highest trip bit. Now XX index of trip bit. t A- corresponding event bit. Remove t from exc. 525 526 527 528 529 530 531 532 533 534 535 536 537 538 TakeTrip 1H STŨU inst_ptr g 8 rW g rW inst_ptr. SLU inst_ptr xx 4 inst_ptr XX 4. INCH inst 8000 STŨU inst g 8 rX g rX inst 263. AND t f Mem_bit PBZ t IF Branch if op doesn t access memory. ADDU y y z Otherwise set y y z mod 264 SET z x z X. STŨU y g 8 rY g rY y. STŨU z g 8 rZ g rZ z. LDŨU t g c255 STŨU t g 8 rB g rB g 255 . LDŨU t g 8 rJ STŨU t g c255 g 255 g rj . 1 14. Resume 1H 2H SLU BNZ LDŨU LDŨU BN SRU SUBU BNN PBZ SRU AND SET SLU ANDNL BNZ BP SRU AND CMPU BN CMPU BN MOR CMPU BZ NEG t inst 40 inst_ptr g 8 rW x g 8 rX X Update xx x 56 t xx 2 t lF XX 2F y x 28 y y f z 1 z z y z 70cf z Error t Error t x 13 t t c255 y 2F y t gg t x 8 t t F9 resuming XX Make sure XYZ 0. inst_ptr g rW Finish the command if rX is negative. Otherwise let XX be the ropcode. Branch if the ropcode is 2. Branch if the ropcode is 0. Otherwise the ropcode is 1 y t k the leading nybble of the opcode. z e- 2k. Zero out the acceptable values of z. Make sure the opcode is normal. Make sure the ropcode is 2. Branch if x is local. Otherwise make sure x is global. Make sure the opcode isn t RESUME. 122 ANSWERS TO EXERCISES 123 CSNN resuming resuming 1 Set resuming as specified. JMP Update Finish the command. I 166 LDŨU y g 8 rY y g rY . 167 LDŨU z g 8 rZ z g rZ 168 BOD resuming Install_Y Branch if ropcode was 1. 169 OH GREG Cl 56 x- 0 48 z- 0 40 l 16 X_is_dest_bit 170 SET f 0B Otherwise change f to an ŨRI instruction. 171 LDŨU exc g 8 rX 172 MOR exc exc 20 exc third-from-left byte of rX. 173 JMP XDest Continue as for ORI. 1 15. We need to deal with the fact that the string to be output might be split across two or more chunks of the simulated .

TỪ KHÓA LIÊN QUAN