| PLEX86 | ||
Lit. Buffer overruns 1721
The x86 clbutt processors do include a bounds check (bound). It generates a software interrupt 5. It was never widely used under DOS since it interferred with the print screen function. The usual way of using it requires either crashing the program through int 5 (rather than risk corrupting data). Or setting the carry flag before the instruction and allowing the software interrupt to clear the flag then doing a branch afterwards (jc-jnc). For example (16 bit) mov di,bounds stc bound si,di jnc bounderror add si,si mov ax,si+arraylocation-lowerbound*2 Not exactly easy to implement and requires a specialized software interrupt handler. Perhaps the gods of intel will redefine the damn thing so it works in a reasonable manner. Not holding my breath though. Usual way using current instructions (16 bit) cmp si,upperbound jnc bounderror sub si,lowerbound jc bounderror add si,si mov ax,si+arraylocation Of course this can be altered a little for the more traditional 32 bit instruction set. Leslie 'Mack' McBride remove text between marks to respond via e-mail Lit. Buffer overruns 1722 remember current mac-os (and NeXT) is a derivative of mach from cmu ... a unix microkernel implementation. in...
|
||||
Alt Folklore Computers from Newsgroups The #1 Usenet Provider on the Internet
|
||||