;B2Nasm - Basic to Nasm compiler
;Copyright (C) 2003  Nicholas Dark
;For more information, see license.txt
geti:
        xor ax,ax
        push ax
        call getc
        cmp al,'-'
        jne ooops
        mov cx,1
        call putc
        call getc
ooops:
        call putc
        cmp al,13
        je .exit
        sub al,0x30
        xor dx,dx
        mov dl,al
        pop ax
        add ax,dx
        push ax

.getii:
        call getc
        call putc
        cmp al,13
        je .exit
        sub al,0x30
        xor dx,dx
        mov dl,al
        pop ax
        imul ax,10
        add ax,dx
        push ax
        jmp .getii

.exit:
        pop ax
        cmp cx,1
        jne noneg
        neg ax
noneg:
        push ax
        mov al,10
        call putc
        pop ax
        ret
