3 ms·
It's a long time ago that I last wrote 8086 assembler. The OP speaks of the assembler not freeing allocated memory, and refers to "manual calls to free". Back
by denton-scratch 5y ago
It's a long time ago that I last wrote 8086 assembler.
The OP speaks of the assembler not freeing allocated memory, and refers to "manual calls to free". Back in the day, memory management was the programmer's responsibility; I don't know how an assembler might divine the programmer's intention.
Like, you could allocate stack memory in assembler, and deallocate it simply by returning. But heap management would be the responsibility of some library or OS (and the stuff I wrote ran on bare metal, this was before Windows).
- ac42dgu 5y agoI read that part as the assembler itself never freeing memory during its work assembling. The assembled program can do whatever including using the stack and manual memory management.
- denton-scratch 5y agoOh, thanks, I guess I misread it. I wrote a crude assembler in Pascal once (for fun). It didn't need a heap, it was all static allocation and stack - it didn't cross my mind that one might write an assembler that needs to do heap allocation. I was a callow youth, and probably didn't know what a heap was! The only storage you need other than stack is for a symbol table. In the general case, you can't know in advance how big that's going to be, so I suppose heap allocation for the symbol table makes sense.