Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

redundant override in "ss:bp" for clarity (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 14.05.2012, 18:47

> My assembler does not insert them, so in my code I put the
> SS: in there as a form of documentation, to remind myself that I'm working
> with the stack and not "regular" memory.

I merely insure to always put bp as the first addend if I address memory using it. So that I'd always use [bp+XX...], never [XX...+bp]. This way, I can (at least in my own source) quickly tell what segment registers an explicitly specified address uses; it'll either begin with an override "[Xs:" (indicating that segment register naturally), or with "[bp" (indicating ss), or neither of those (indicating ds).

To regularly use your method, I'd of course first have to extend NASM to have it optimise away redundant overrides - so I lacked that feature in the first place. On the other hand, I might have preferred the convention described above even if I had it, because I sometimes do tend to save some typing if I think it'd be overly redundant.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22760 Postings in 2121 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum