Well here is my code in functions.asm for anyone that knows how to convert to windows nasm code
section .data
MSG: db "Input number : ",10
MSG_L: equ $ - MSG
negsign: dq '-'
negsign_L: equ $ - negsign
section .bss
x_number resq 255
section .text
atoi:
push rbx;if you are going to use rbx you must preserve it by pushing it onto the stack
;~ Address is passed in rdi
xor r9, r9
mov rbx, 10 ; to multiply by
xor rax, rax; to use as "result so far"
xor rcx, rcx ; our character/digit (high bits zero)
cmp byte [r8], '-'
jne .top
add r8, 1
add r9, 1
.top:
mov cl, byte [r8] ; get a character
add r8, 1 ; get ready for the next one
cmp cl, 0 ; end of string?
je .done
cmp cl, '0'
jb .invalid
cmp cl, '9'
ja .invalid
sub cl, '0' ; or 48 or 30h
; now that we know we have a valid digit...
; multiply "result so far" by 10
mul rbx
jc .overflow ; ?
; and add in the new digit
add rax, rcx
jmp .top
; I'm not going to do anything different for overflow or invalid
; just return what we've got
.overflow:
.invalid:
.done:
cmp r9, 1
jne .done2
neg rax
.done2:
pop rbx;restore rbx to its original value
ret ; number is in rax
itoa:
jmp beggining ; go to the beggining of the function
negate:
; print out a negative sign
mov rdx, negsign_L;length
mov rsi, negsign;variable
mov rdi,1;sys_write
mov rax, 1;stdout
syscall
neg r8
mov rax, r8
inc rcx
jmp godivide
beggining:
push rbx
;number is passed in through r8
mov rbx, 10
xor rcx, rcx
cmp r8, 0
jl negate
mov rax, r8;move number into rax
godivide:
xor rdx, rdx ; clear remainder
div rbx ; divide rax by 10
push rdx ; put rdx on stack
inc rcx ; increment number of digits
cmp rax, 0 ; if rax
jne godivide ; is not equal to zero, divide again
nextdigit:
pop rax ;pull off the stack
add rax, 30h ;convert to ASCII
push rcx ; store counter
mov rdx, 1 ; one byte
push rax
mov rsi, rsp
mov rdi,1;sys_write
mov rax, 1;stdout
syscall
pop rax
;;
pop rcx ; restore counter
dec rcx ; get ready for the next one
cmp rcx, 0 ; if rcx
jg nextdigit ; is greater than 0, jump nextdigit
pop rbx
ret
thanks for the help anyway frank