0

I want to multiply a 2 * 100 or 1 * 100

section .bss
    varA: resb 1
    num1: resb 1
    

section .text
    global _start

_start:

;read var A
    mov eax,3            
    mov ebx,0            
    mov ecx,varA
    mov edx,1
    int 80h


    sub [varA], byte '0'
    mov al, [varA]
    mov bl, 100
    mul bl,   

    add al, '0'
    mov [num1], al
    
;write total of numbers
    mov eax,4            
    mov ebx,1            
    mov ecx,num1
    mov edx,1
    int 80h

    mov eax,1            
    mov ebx,0            
    int 80h;

I tried this formula but I keep getting a "?" in www.rextester.com

I tried the code above and either expected to print out 1 or 2 / 100 or 200 but I got none. I eventually want to read 3 digit input like "123" and print it out.

phuclv
  • 37,963
  • 15
  • 156
  • 475
AlexCodes
  • 1
  • 1

0 Answers0