r/learnprogramming • u/Electronic_Nerve_561 • 12d ago
Debugging assembly question (8086, dos)
started learning 8086 assembly in a vm a day or so ago, things have been a little harder to grasp than c was when i first started, so i wanted to ask a couple questions
first:
when i did c i was always told that there always exists a stack and a heap and nothing inbetween
but when i do
`bar db 69`
i can't really tell where that's stored, my first thought was the stack but then if i try popping the stack with nothing else put in there the os shits itself and dies, so i doubt
heap doesn't even cross my mind because afaik i have to ask the os for more memory which i didn't so i wanna know what it really is
second:
segment registers and more specifically something like
[DS:DX]
afaik it's the address of dx offset from ds?
but everytime i use it i don't have to specify that at all, i just put dx at the start of a buffer or something and let it roll
so yeah the whole [SEG:REG] notation i don't really get
while i'm at it, if you have any useful books or anything (the last one i saw was 1200 pages long and they get to programming at around the 300 mark) i'd love that.