Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Pyjong
Wasting three CPU clock cycles before returning, so the whole routine would take a fixed number of cycles. I read this on an AMI BIOS chip -
@Pyjong
I was using debug.com, and was reading the interrupt handler for INT19h when I came across it for the first time. It was over 20 years ago... -
Isn't that even normal today? For example waiting for data from ram would do something similar.
You can get pretty creative, especially when multiple things run at the same time. A friend did wonders with that in the Game TIS-100 (really fun, you should try it), while I usually kept it synchronized by waiting for data. -
Pyjong10875ySome years ago when heroes of the storm were in closed beta, I lost my access before release, so I chcked the binary cuz maybe there are some bytes worth noping out. And close to beginning of the exe I found a tight loop that counted from 64k down to zero. Which is also pretty weird. I asked about it on osdev without giving a context and one guy replied in the way: yeah we used that in old games for the hardware to get ready xD . Maybe blizzard never removes old code.. I mean storm.dll was created fairly long time ago.
-
Parzi86695ymight be required for hardware sync, due to bein in a BIOS and all? Burning cycles is a common practice for that situation, so...
-
@LinusCDE
CPU can wait for 100 of cycles before the ram gets you the data.
Yup ram is slow. That is why cache exists. -
Obviously, I would shorten the nop-nop-nop-ret to ret, but that's my special skill. ^^
When you set some IO pin, it may take some moments before the change arrives. Remember that lines on the board have a capacitance and don't change their level instantaneously. Waiting until a proper steady signal level has been reached isn't uncommon.
Another thing is that some CPUs have instructions that don't have their effect right after the program counter has gone past them, but some clocks later.
Related Rants
Reading this in a routine:
NOP
NOP
NOP
RET
rant
wk169