资源描述:
《十进制十六进制加法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、1)十进制十六进制加法(无减法)FHEQU28HQIANEQU29HBAIEQU30HSHIEQU31HGEWEQU32HORG0000HMOVSP,#60HMAIN:MOVR5,#50HMOVR3,#5DD3:MOVR3,#5;CALLJIAFA;CALLJIANFA;CALLCHENGFA;CALLCHUFA;CALLANWH;CALLANWYCALLDWJ;多位加法CALLXSDJNZR5,DD3SJMPMAINDD:MOVR7,0FFHDL1:NOPNOPNOPNOPNOPNOPNOPDJNZR7,DL1RETDY
2、XS:MOVDPTR,#DX;MOVCA,@A+DPTR;数码管显示数字MOVDPTR,#8004H;位选地址MOVX@DPTR,AMOVA,R3;MOVDPTR,#WXMOVCA,@A+DPTR;数码管第一位MOVDPTR,#8002H;位选地址MOVX@DPTR,ALCALLDDRETXS:MOVA,FHCALLDYXS;DECR3;MOVA,QIAN;CALLDYXSDECR3MOVA,BAICALLDYXSDECR3MOVA,SHICALLDYXSDECR3MOVA,GEWCALLDYXSRETFLXS:MOVFH
3、,#16MOVA,R0MOVB,#100DIVABMOVBAI,AMOVA,BMOVB,#10DIVABMOVSHI,AMOVGEW,BRETJIAFA:MOVFH,#16MOVA,42HADDA,43HMOVB,#100DIVABMOVBAI,AMOVA,BMOVB,#10DIVABMOVSHI,AMOVGEW,BRETJIANFA:CLRCYMOVFH,#16MOVA,42HSUBBA,43HJCSSSJMPSS2SS:CLRCYMOVA,43HSUBBA,42HMOVFH,#17SS2:MOVB,#100DIVABM
4、OVBAI,AMOVA,BMOVB,#10DIVABMOVSHI,AMOVGEW,BRETCHENGFA:MOVFH,#16MOVA,42HMOVB,43HMULABMOVB,#100DIVABMOVBAI,AMOVA,BMOVB,#10DIVABMOVSHI,AMOVGEW,BRETCHUFA:MOVFH,#16MOVA,42HMOVB,43HDIVABMOVGEW,BMOVB,#10DIVABMOVBAI,AMOVSHI,BRETANWY:;546FH924FHMOVA,#05HANLA,#09HMOVFH,AMOVA
5、,#04HANLA,#02HMOVBAI,AMOVA,#06HANLA,#04HMOVSHI,AMOVA,#0FHANLA,#0FHMOVGEW,ARETANWH:;546FH924FHMOVA,#05HORLA,#09HMOVFH,AMOVA,#04HORLA,#02HMOVBAI,AMOVA,#06HORLA,#04HMOVSHI,AMOVA,#0FHORLA,#0FHMOVGEW,ARETDWJ:;1235+1235MOVA,#08HADDA,#05HMOVB,#16;10代表十进制,如是十六进制,改为16DIVAB
6、MOVGEW,BADDA,#09HADDA,#03HMOVB,#16;10代表十进制,如是十六进制,改为16DIVABMOVSHI,BADDA,#09HADDA,#02HMOVB,#16;10代表十进制,如是十六进制,改为16DIVABMOVBAI,BADDA,#09HADDA,#01HMOVB,#16;10代表十进制,如是十六进制,改为16DIVAB;MOVQIAN,AMOVFH,BRETDX:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,77H,7CH,39H,5EH,79H,71
7、H,00H,40H;从TAB处开始存储0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,GUAN,-WX:DB00H,01H,02H,04H,08H,10H,20H,40H,80H,00H,00H,00H,00H,00HEND2乘除法main:CLRCMOVA,#120;SUBBA,#20;用减法时去掉分号,用加法时改成ADD,改#号的数字即可MOVB,#2;用乘法时不去掉,用加减时去掉MULAB;同上句MOVB,#100DIVABMOVR5,AMOVA,BMOVB,#10DIVABMOVR4,AMOVA,R
8、5MOVR2,AMOVR3,#04HACALLXIANSHIACALLDAYMOVA,R4MOVR2,AMOVR3,#02HACALLXIANSHIACALLDAYMOVR2,BMOVR3,#01HACALLXIANSHIACALLDAYajmpmainDAY:MOVR6,#20DL1:MOVR7,#2