Right now im having a bit of a problem with the prinitng out of the charters. It seems to read the characters into the array but when the PutString is called nothing it echo'd
main.asm
BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100;
SECTION .text;
MOV CX, 00h ; Sets counter for the number converted to 0
MOV DL, 00h ; Sets DL to 0
MAIN:
MOV CX, 00h ; Sets counter to 0
call GetString
;add black lines here
MOV CX, 00h ; Sets counter to 0
Call PutString
call Exit
%include "STDIO.asm"
STDIO.asm
GetString:
call Getch ; get the character stored in DL
CMP DL, 0DH ; if Enter is pressed Exit the subroutine
JE Return
call Putch ; output the character on screen
push bx ; preserve value on the stack
mov bx, 2 ; bx = 2
imul bx, cx ; imul is an assembly command for multiplication
; the way it was used here is bx = bx*cx
mov [MyArray+bx], dl ; bx is being used as the index here for your array
pop bx ; restore previous bx value
INC CX ;add 1 to the counter
JMP GetString ; loop back to GetString
Return:
Ret
PutString:
push bx ; preserve value on the stack
mov bx, 2 ; bx = 2
imul bx, cx ; imul is an assembly command for multiplication
; the way it was used here is bx = bx*cx
mov AL,[MyArray+bx] ; put the value of the array back into AL
call Putch ; output the character on screen
pop bx ; restore previous bx value
INC CX ;add 1 to the counter
JMP GetString ; loop back to GetString
Getch:
push BX
mov ah, 7 ; keyboard input subprogram without echo
int 21h ; read the character into al
mov dl, al ; move al to dl
pop BX
RET ; return
Putch:
mov ah, 2h ; display subprogram
INT 21H ;read the characters from al
RET ; Return
Putln: ;new line
mov dl, 0DH ;Carriage return
int 21h
mov dl, 0AH ;Line feed
int 21H
RET ; return
any ideas everything compiles fine but i get no output from the PUtString subroutine