Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
fractalb
on Nov 1, 2022
|
parent
|
context
|
favorite
| on:
Ask HN: What piece of code/codebase blew your mind...
Shouldn’t it be
*to++ = *from++;
jcranmer
on Nov 1, 2022
|
next
[–]
In the original code, actually, no, incrementing "to" was not desired. The "to" was pointing to a hardware memory-mapped register, and it needed to copy to the same memory location each time.
fractalb
on Nov 1, 2022
|
parent
|
next
[–]
Didn’t know that. Thanks
johnthescott
on Nov 2, 2022
|
prev
[–]
amen. seems like back in the day that "reg1 = *pc++;" would have been the fastest op in a computer.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
*to++ = *from++;