Hi everyone,
got a slight problem. trying to make a program that takes the users input and puts it into a string untill it detects a CR character then outputs the string, i've made a start but i'm at a dead end on what to do.
BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100;
SECTION .text;
MAIN:
%include 'STDIO.asm'
mov bx , offset Array ;store start of array in bx
call Getch ;read in first character to register
while1:
cmp DL, 0dh ;while character is not equal to cr
je Next
mov byte ptr [bx], DL ;assign the value of DL to position bx in the array
inc bx; increment bx
call Getch;read in next character to DL register
jmp while1
Next:
mov bx , offset Array ;set bx to the start of Array
while2:
cmp byte ptr[bx] , 0dh;while character is not equal to cr
je Exit
mov DL , byte ptr[bx]; set DL to be equal to the value at BX in the array
call Putch ; puts the character in DL onto the screen
inc BX
jmp while2
Exit:
MOV AH,04Ch ; Select exit function
MOV AL,00 ; Return 0
INT 21h ; Call the interrupt to exit
SECTION .bss
Array resb (20*1)
thanks in advance for any help
-Midi