hello, iam tring to figure out assembly langauge and am having a hard time. I want to write a program purely in assembly that takes in a number in base 10 and converts it to hex octal and binary. Just know how to output to the screen and take in from the keyboard, but once i get the number in I am unable to work with them. i think because they are an ascii string as opposed to integers. trying to convert so i can manipulate them for the conversions to different bases. I may be way off, but am definatley lost and would appreciate any guidance!! Here is the code i have so far, but it does not do waht i want it to:
.section .data
input:
.fill 256 #where i would like to store the converted number, if possible
prompt:
.asciz "Enter a decimal integer:"
prompt_end:
.equ promptlength, prompt_end-prompt
.section .bss
.lcomm number, 40 #number taken in from input, in ascii
.section .text
.globl _start
_start:
nop
######## display prompt string ####################
movl $4,%eax
movl $1,%ebx
movl $prompt,%ecx #string for output
movl $promptlength,%edx
int $0x80
######## get input #################################
movl $3, %eax
movl $0, %ebx
movl $number, %ecx
movl $40, %edx
int $0x80
######## convert from ascii to decmial ##############
# %edi holds current index
# %eax holds number
movl $0, %edi
movl number(,%edi,1),%eax
movl $3, %ecx
loop1:
sub $48, %eax
movl %eax, input
incl %edi
movl number(,%edi, 1), %eax
cmpl %edi, %ecx
jge loop1
########## Output converted number # ###############
movl $4, %eax
movl $1, %ebx
movl $input, %ecx
movl $4, %edx
int $0x80
movl $1,%eax
movl $0,%ebx
int $0x81
~
Thanks!!