I am writing my first TSR. I know I have to use function 31H of INT 21H. When i looked it up, I found out that the value in DX is the "memory size in paragraphs". I don't know how to calculate that and GOOGLE didn't help. I want to know how can I calculate the memory size in paragraphs of my code.
i just found this
mov dx, OFFSET Install ; DX = bytes in resident section
mov cl, 4
shr dx, cl ; Convert to number of paragraphs
inc dx ; plus one
mov ax, 3100h ; Request Function 31h, error code=0
int 21h ; Terminate-and-stay-resident
Why is there a plus one? And know should i assume that a paragraph = offset*16 and that is it?