Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
[org 0x8000]
prog:
mov ax, cs
mov ds, ax
; load gdt and enter PM mode code here
db 0eah
dw con
dw 08h
con:
mov ax, 10h
mov ds, ax
endprog dq $-prog
data:
myTxt db 'Here is my sample text'
enddata dq $-data
My problem is to get myText when in protected mode, probably becouse (for sure...) org 0x8000 it makes 0x8000+tekst to create address when I want to acces it.
I can acces it by [ds:offset_for_myTxt] where offset_for_myTxt = myTxt - endprog but its not ok to access it that way in my opinion. How to deal with it ? How to access myTxt by normal way like
mov si, myTxt
mov byte al, [myTxt]
to get first letter for example ?
Hot to do this ?
You have set the segments incorrectly. If you wanted to use the tiny memory model, then both segments should have the same base address. Either both segments must start at 0, or both segments must start at 0x8000 and the program should start with org 0.