Coverting String Decimal to Binary and Hexa in Assembly 8086
问题 I'm trying to convert a string I read with this code to binary and hexa. READ_STRING: MOV DX, offset buffer MOV AH, 0Ah INT 21h MOV SI, 1d MOV AX, 0 XOR CX, CX MOV CL, buffer[SI] INC SI LOOP_1: MOV DX, 10 MUL DX MOV DL, buffer[SI] SUB DL, 30h MOV DH, 0 ADD AX, DX INC SI LOOP LOOP_1 RET So far I have this code for binary output but it always prints "1001" (9 in decimal): NEXT: XOR AX, AX XOR BX, BX XOR CX, CX MOV CL, 2 MOV AL, byte ptr[nombre] MOV DI, offset binaire ; DIV : divide AX by CL.