资源描述:
《南航微机原理及应用习题答案6.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、南京航空航天大学自动化学院6-4INAL,PORT_TCMPAL,0FEH;k0单独被按下,即最低位为0,其余位为高JZNEXT1CMPAL,0FDH;JZNEXT2MOVAL,00H;其他的情况,将灯全部不点亮OUTPORT_T,ALJMPEXITNEXT1:MOVAL,01H;K0被按下,LED0~LED7顺次点亮,送1则对应的灯亮MOVCX,8LOOP1:OUTPORT_T,ALCALLDELAYROLAL,1LOOPLOOP1JMPEXITNEXT2:MOVAL,80H;K1被按下,LED0~LED7反序点亮,送1则对应的灯亮MOVCX,8LOOP2:OUTPORT_T
2、,ALCALLDELAYRORAL,1LOOPLOOP2EXIT:….6-5MOVBX,OFFSETSTRINGOUT_TEST:INAL,STATUSTESTAL,80HJNZOUT_TESTMOVAL,[BX]OUTDATAS,ALINCBXCMPAL,0DHJNZOUT_TESTEXIT:…6-6MOVBX,OFFSETDATABUFMOVCX,100IN_TEST:INAL,STATUSTESTAL,80HJZIN_TESTINAL,DATASMOV[BX],ALINCBXLOOPIN_TEST6-9略6-13执行INT8后CPU将PSW,CS,IP压入堆栈,堆栈的情况
3、如下图:A2H00H00H09H40H02HSP00FAH00FBH00FCH00FDH00FEH00FFHSP=00FAH,SS=0300H,IP=0040H,CS=0100H因为IF,.TF进入中断后自动为零,所以PSW=0040H.6-16IRQ3申请中断,IRQ3正在被服务,20H,05H6-18MOVDX,0FFDCHMOVAL,00010011B;ICW1OUTDX,ALMOVDX,0FFDDHMOVAL,90H;ICW2OUTDX,ALMOVAL,00000001B;ICW4OUTDX,AL6-21RRREGDB?SRREGDB?IMREGDB?…MOVAL,00
4、001010B;读IRROUT20H,ALINAL,20HMOVRRREG,ALMOVAL,00001011B;读ISROUT20H,ALINAL,20HMOVSRREG,ALINAL,21H;读IMRMOVIMREG,AL