I am trying to create a login form for my OS. Like Kali Linux's SSH login. User will be shown but password won't be shown. I use int 16h / ah=0 to read key press. But I don't know taking one line input (like input() in Python) and joining two strings. I saw topics that explains joining two strings but I did not find any topics about taking one line input in Assembly. I use NASM to compile.
My code:
bits 16
org 0x7c00
mov si, loginmsg
call ps
call nl
mov si, usermsg
call ps
call nl
call inputstring
jmp $
;INPUT FUNCTION
inputstring:
inputchar:
mov ah, 00h
int 16h
;I do not know what to do
ret
;VARIABLES
loginmsg db 'Please login to continue...', 0
loginfailmsg db 'Wrong user or password!'
loginsuccessmsg db 'Successfuly logged in.'
usermsg db 'User: ', 0
passmsg db 'Password: ', 0
defuser db 'root'
defpass db 'root'
entereduser times 16 db 0
enteredpass times 16 db 0
indexuser db 0
indexpass db 0
;FUNCTIONS:
;BACKSPACE
bs:
pusha
mov al, 8 ;BACKSPACE
mov ah, 0eh
int 10h
mov al, 32 ;SPACE
mov ah, 0eh
int 10h
mov al, 8 ;BACKSPACE
mov ah, 0eh
int 10h
popa
ret
;NEWLINE
nl:
pusha
mov al, 0ah ;10
mov ah, 0eh
int 10h
mov al, 0dh ;13
mov ah, 0eh
int 10h
popa
ret
;PRINTSTRING
ps:
pusha
ps_test:
lodsb
cmp al, 0h
je ps_eof
mov ah, 0eh
int 10h
jmp ps_test
ps_eof:
popa
ret
times 510 - ($ - $$) db 0
dw 0xaa55