内部RAM中以40H单元为首地址,存放着10个字节的有符号数.统计
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 20:06:59
LOOP2:MOVR0,30HMOVA,@R0INCR0MOV60H,@R0CLRCCJNEA,60H,LOOPLOOP:JCQDMOV20H,60HQD:MOV20H,ADJNZ#16H,LOOP2
MOVA,30HMOVB,31HMULABMOVR2,BMOVR3,AEND
;MOVTPTR,#2000HMOVR2,#100MOVR3,#0MOVR4,#0MOVR5,#0LOOP:MOVA,@DPTRJZZZZJBACC.7,FUINCR3;正数个数JMPNEXTFU:I
;MOV32H,30HMOVA,30HCLRCSUBBA,31H;(30H)-(31H)JNBACC.7,ZZZ;差为正数则转移JBOV,_END;负、且溢出转至结尾SJMPXXX;否则去存31HZZ
这个程序很简单,很多教材上都有的,movr3,#16movr0,#20hmovr1,#28hloop:mova,@r0mov@r1,aincr0incr1djnzr3,loop看懂了,再稍微修改一下,
我按照你的要求给你写了一段程序,加了标注,你分析一下吧movr0,#30H;数据地址movr5,#0FH;数据个数movr7,#00h;比较缓存LOOP:movr2,@r0;取出数据存入r2cjner
MOVDPTR,#1000HMOVA,@DPTRMOVDPTR,#4000HMOV@DPTR,A
movsi,30h;数据区首地址装入源变址寄存器SIlodsb;把第一个数读入AL,作为最大数movcx,9;循环比较9次Compare:;开始逐个比较cmpal,byteptr[si];把当前最大数
程序如下:MOVR0,#20HMOVDPTR,#1000HLOOP:MOVA,@R0MOVX@DPTR,AMOV@R0,#0INCDPTRINCR0CJNER0,#31H,LOOPSJMP$END
MOVR1,#50HMOVDPTR,#20HL1:CLRAMOVCA,@A+DPTRMOVR2,AMOVA,#DPTRMOVR0,AMOVA,R2MOVX@R0,AINCDPTRDJNZR1,L1再问
;MOVR0,#30HMOVR1,#40HMOVR2,#4CLRCLOOP:MOVA,@R0SUBBA,@R1MOV@R0,AINCR0INCR1DJNZR2,LOOPCLRASUBBA,#0MOV@
PUSH20HPUSH21HPOP20HPOP21H
movdi,31hss:cmpax,[di]jzddmovax,[di]dd:incdiloopssmov[40h],ax
空1处:MOVR7,#08H空2处:CLRCSUBBA,2AH
MOV2FH,20HMOV2EH,21HMOV2DH,22H只用这三条指令即可.
CLRC;C=0CLR08H;21H.0=0CPL09H;21H.1=0->1SETBC;C=1SETB0FH;21H.7=1CPLC;C=1->0;21H=0F2HC=0再问:请问,08H,09H和
嘿嘿还是俺来帮你吧1JBACC.7,IERO;小于0转IERO2JNBACC.7,POSITIVE;大于0转POSITIVE呵呵满意就选满意回答吧再问:谢谢谢谢啊不好意思题目抄错了第一句判断是否等于0
movdptr,#20hmovxa,@dptrmovb,aincdptrmovxa,@dptrmulabincdptrmovx@dptr,amova,bincdptrmovx@dptr,a
ORG0000HAJMPMAINORG0040HMAIN:MOVR3,#0;R3用来统计内容为‘1’的个数,初始为0MOVR0,#10H;用R0作间接寻址的指针MOVR2,#100;R2控制循环次数S
呼保义宋江神机军师朱武