you breakpoint at the function, and see the following 32 bits at the top of the stack.
7B0E9721
what's the linear address of the return value? Well, obviously, it's
2197:0E7B!
you just gotta remember to reverse the bytes but not the nibbles, that'd be silly. Little Endian makes perfect sense.
btw the colon in that 32bit address means I lied. That's not really the address. The address is, obviously, 227EB
because the colon means this is 16-bit segmented x86! we're in Real Mode!
and real mode is nonsense of a higher order
You've got two 16-bit integers, called the segment (or segment selector, or just selector) and your offset.
And it'd make sense that those are just two chunks of a larger 32bit linear address, but they're not. They're two 16-bit chunks of a 20-bit address.
and that'd make sense if only the lower 4 bits of the segment were used.
but all bits are used. They just add the segment and the offset together, after bitshifting the segment over by 4.
So the linear address of AAAA:BBBB is AAAA*16+BBBB.
@foone x86 real mode was the most gratuitously stupid addressing mode ever.