1、微机原理打印stack segment para stackstack DB 256 DUP(0)STACK ENDSCODE SEGMENT PARA PUBLICCODESTART PROC FAR ASSUME CS:CODE,SS:STACK PUSH DS MOV AX,0 PUSH AX MOV AX,0B800H MOV ES,AX MOV AX,3 INT 10H MOV DX,3D9H MOV AL,15 OUT DX,AL MOV DX,0 MOV AL,20H MOV AH,44H MOV DI,0 CALL COLOR MOV AH,11H MOV DI,40 CALL
2、 COLOR MOV AH,55H MOV DI,80 CALL COLOR MOV AH,22H MOV DI,120 CALL COLOR RETCOLOR PROC NEARBEGIN:MOV CX,20 CLD REP STOSW ADD DI,120 INC DX CMP DX,25 JB BEGIN MOV DX,0 RETCOLOR ENDPSTART ENDPCODE ENDSEND STARTstack segment para stackstack DB 256 DUP(01H) DW 128 DUP(0001H) 01 01.01 00 874120.asmSTACK E
3、NDSCODE SEGMENT PARA PUBLICCODESTART PROC FAR ASSUME CS:CODE,SS:STACK PUSH DS MOV AX,0 PUSH AX ;DS MOV AX,0B800H ;设置显示缓冲区首地址 MOV ES,AX MOV AX,3 ;设置彩色字符方式:3 INT 10H ;80W*25H MOV AL,15 ;底色白色 MOV DX,3D9H OUT DX,AL MOV DX,0 MOV AL,20H MOV AH,44H ;COL MOV DI,0 CALL COLOR MOV AH,11H MOV DI,20 CALL COLOR M
4、OV AH,55H MOV DI,40 CALL COLOR MOV AH,22H MOV DI,60 CALL COLORMOV AH,44H ;COL MOV DI,80 CALL COLOR MOV AH,11H MOV DI,100 CALL COLOR MOV AH,55H MOV DI,120 CALL COLOR MOV AH,22H MOV DI,140 CALL COLOR RETCOLOR PROC NEARBEGIN:MOV CX,10 ;每个彩条宽度WIDTH=80/N CLD ;列递增0。159。160 REP STOSW ADD DI,140 ;列跃变量X=160-
5、WIDTH INC DX ;行数加1 CMP DX,25 ; 0-2425 JB BEGIN MOV DX,0 RETCOLOR ENDPSTART ENDPCODE ENDSEND START0 39 40 79 80 119 120 159 0 1920 39 40 内存地址:B800hBFFFH(32K)09Hc融(理解) 溶(加材料) 熔(特点、激情)12345=?h 999990*10+1(31h-30h)1*10+2(32h-30h)12*10+3(33-30)31 32 33 34 35 x0-x4S=0,assddfg,xi39h报错M= xi-30H(30-39H); S=S
6、*10+M S65535S=S-65536S=0C/10 Y=2 G=1DIV ?字节B,AX作为被除数 DIV BL ;将商存放AL,余数存放AH字W, AX,dx作为被除数 DXAXDIV BX;将商存放AX,余数存放DX AX=1 DX=2 DX-2+30=32HPUSH DXCX+1DX-0 00000001H/101+30 2+30CX-1压缩BCD非压缩BCD0-90-9X0-9979797H09H07H+ -+ - * /10010111Aaaaaaaab99999999b11111111b01000110bI123456789987654321=9*10+8)*10+7ASCI
7、I0-9 30H-39H -30H 00H-09HAL:10010011BL:10010111XXXX1001 2+2*2*2=10CL 10010111000011110000011154321=(5*10+4)*10+3)*10)+2)*10+110010111B=(1*2+0)*2+0)*2+1)*2+0)*2+1)*2+1)*2+1=10001011161H主程序1输入提示:判定按Q,q退出,否则输入数正确输入提示及结束SIGN错误输入提示及重新输入SIGN02将输入值按十进制的方式转换 BCD两位数=十位数*10+个位数十位:向右移4位取10位数, 做12+2*2*2成 十位数*10 结果个位:值与0F逻辑与,得个位十位数、个位数分别与0-9的比较,判定是否为压缩BCD码再做:十位数*10+个位数,得到十进制真实值61h=97F2T2判定输入是否30H-39H之间,若是,则-30H得到实际数值输入ASCII码转换二进制转换, 为运算准备F2T10做二进制到十进制转换准备,同时将radix结果(ASCII码)显示出来radix做二进制到十进制运算,除10取余方式,得到结果并将结果加30H后转换为ASCII码,做F2T10的计算机显示准备10010111B=97H 9 7 61H =97
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1