1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
| STACK SEGMENT PARA STACK S_AREA DW 100H DUP(?) S_TOP EQU $-S_AREA STACK ENDS DATA SEGMENT PARA VALUE DW 0EB9AH RESULT DB 5 DUP(?),'$' DATA ENDS CODE SEGMENT PARA ASSUME CS:CODE,DS:DATA,SS:STACK MAIN PROC FAR MOV AX,DATA MOV DS,AX MOV AX,STACK MOV SS,AX MOV SP,S_TOP MOV CX,5 MOV AX,VALUE MOV BX,10 MOV DI,OFFSET RESULT+4 JYB: XOR DX,DX DIV BX OR DL,30H MOV BYTE PTR [DI],DL DEC DI LOOP JYB MOV DX,OFFSET RESULT MOV AH,9 INT 21H EXIT: MOV AX,4C00H INT 21H MAIN ENDP CODE ENDS END MAIN
STACK SEGMENT PARA STACK DW 100H DUP(?) STACK ENDS DATA SEGMENT PARA VALUE DW 0EB9AH DATA ENDS CODE SEGMENT PARA ASSUME CS:CODE,DS:DATA,SS:STACK MAIN PROC FAR MOV AX,DATA MOV DS,AX MOV CX,5 MOV AX,VALUE MOV BX,10 JYB1: XOR DX,DX DIV BX OR DL,30H PUSH DX LOOP JYB1 MOV CX,5 JYB2: POP DX MOV AH,2 INT 21H LOOP JYB2 EXIT: MOV AX,4C00H INT 21H MAIN ENDP CODE ENDS END MAIN
STACK SEGMENT PARA STACK DW 100H DUP(?) STACK ENDS DATA SEGMENT PARA VALUE DW 0EB9AH DIVISOR DW 10000,1000,100,10,1 DATA ENDS CODE SEGMENT PARA ASSUME CS:CODE,DS:DATA,SS:STACK MAIN PROC FAR MOV AX,DATA MOV DS,AX MOV CX,5 MOV AX,VALUE MOV SI,OFFSET DIVISOR JYB: XOR DX,DX DIV WORD PTR[SI] PUSH DX OR AL,30H MOV DL,AL MOV AH,2 INT 21H INC SI INC SI POP AX LOOP JYB EXIT: MOV AX,4C00H INT 21H MAIN ENDP CODE ENDS END MAIN
|