Code: Select all
program_start:
; prepare segments for PM and enter pm, load new segments by selectors etc...
mov byte al, [my_number]
program_size dw $-program_start
data_start:
my_number db 62h
size_data dw $-data_start
ds segment starts at kernel_offset_in_memory+program_size
nasm generates wrong memory reference for instruction
mov byte al, [my_number]
for [my_number] it generates wrong memory reference of my_number and result is wrong becouse my_number_address = my_number-program_size
i can't make equal cs and ds segment base address becouse it will be segment violation
how to deal with it ? i can not access correctly any data from ds without making magic tips like
mov byte al, [my_number-program_size]
is the only way to solve it to do it like this ? :
Code: Select all
jmp program
data:
;data here
data_size dw $-data
program:
;program code here
program_size dw $-program
thank you