I have the following assembly code. I've declared two arrays in my DS. Later in the code I move into BX the index number of the array element I want to access. The PRINT_CHAR process just sends the data in AL over a serial port to display on the screen. But for some reason, I can't seem to access the array elements. It just gives me some bogus value.
The print_char process is definitely fine. I've tried both methods I know to access the array. Any help would be appreciated. Thanks!
DATA_SEG SEGMENT
ARRAY DB '1','2','3','1','2','3','4','5','6','4','5','6'
bottom2 DB '7','8','9','7','8','9','*','0','#','*','0','#'
DATA_SEG ENDS
topnumbers:
cmp BX, 12
jge bottom_numbers
MOV AL,DS:ARRAY[BX] ; Stores character in AL (?)
jmp NUMBERS
bottom_numbers:
sub BL, 12d
LEA SI, bottom2
ADD SI, BX
MOV AL, [SI]
NUMBERS:
XOR AH, AH
CALL FAR PTR PRINT_CHAR
DSto?