what's the value of es when that function is entered? The screen address is at 0xB800:0000, so you have to read starting from there. I think your function needs to set the value of es and not assume it already contains the correct segment value.
bx = upper left corner
ax = lower right corner
cx = width -- this is one problem. We need the height, not the width. The width can be calculated from bx and ax.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
you need both width and height so that your program knows how many lines of text to save. They can both be calculated when you know the upper-left and lower-right coordinates. It might be easier to just save the contents of the entire screen, write sub-menu, then restore the screen to erase the sub-menu. If you don't do anything with the color attributes than all you need is a buffer that's 24*80 = 1920 bytes. double that if you need the color attributes too.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343