Hi,
I am relatively new in ASM, so I need some help.
I found this code on the internet and made some modifications.
;**************************************************
; Hello World OS Boot loader
; Designed by Arnav
; http://pendorasoft.byethost15.com/
;**************************************************
[BITS 16]
[ORG 0x0000]
; code located at 0000:7C00, adjust segment registers
cli
mov ax, 0x07C0
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
; create stack
mov ax, 0x0000
mov ss, ax
mov sp, 0xFFFF
sti
; post message
mov si,msgHello
call DisplayMessage
mov si,msgName
call DisplayMessage
hlt
; Display Message
DisplayMessage:
lodsb ; load next character
or al, al ; test for NUL character
jz .DONE
mov ah, 0x0E ; BIOS teletype
mov bh, 0x00 ; display page 0
mov bl, 0x07 ; text attribute
int 0x10 ; invoke BIOS
jmp DisplayMessage
.DONE:
ret
; data section
msgHello db 0x0D, 0x0A, "Hello World!", 0x0D, 0x0A, 0x00
msgName db 0x0D, 0x0A, "What`s your name", 0x0D, 0x0A, 0x00
;ASM Signature
TIMES 510-($-$$) DB 0
DW 0xAA55
It`s output is:
Hello World!
What`s your name?
Now I`d like to be able to get the user input and to say "Hello, [the user input]."
For example, if the user input is "John", then the program prints "Hello, John."
Any suggestions appreciated.