Я пытаюсь скопировать строку, используя 16-битную сборку.
У меня есть (среди прочего) 16 11-символьных строк в .dirBafer, и я хочу скопировать каждую строку в .ime_dat такчто я могу распечатать и обработать его позже (код обработки еще не написан).Первый символ каждой строки разделен 32 байтами данных.По сути .dirbafer - это дамп каталога FAT12, и я пытаюсь напечатать имена файлов.
У меня есть следующий код:
mov dx, .dirBafer ;loads address of .dirBafer in dx
mov cx, 16 ;16 entries in a dir
.load_dir:
push cx
mov ax, dx ;loads address of .dirBafer from dx into ax
mov bx, .ime_dat ;buffer for storing file names
mov cx, 11 ;each file name is 11 characters long
.ime_dat_str:
push dx ; push dx, since it's being used as a temporary register
mov dx, [ax] ;this is supposed to load first char from location pointed byax to dx
mov [bx], dx ;this is supposed to load the first char from location pointed by dx to bx
add ax, 1 ; moving on to the next character
add bx, 1 ;moving on to the next character
pop dx ; we pop the dx so that the original value returns
loop .ime_dat_str ;this should loop for every character in the file name
mov si, bx ;preparing to print the file name
call _print_string ; printing the name
add dx, 32 ; we move to the next dir entry
pop cx ; popping cx so that the outer look counter can be updated
loop .load_dir
.dirBafer times 512 db 0
.ime_dat times 12 db 0
Моя проблема в том, что строка:
mov dx, [ax]
генерирует ошибку неверного эффективного адреса.
Что я делаю неправильно и как я могу это исправить?