Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

while looking thru some 360 assembler code one day, I came across this ...

XC loc1,loc2

XC loc2,loc1

XC loc1,loc2

It took a day of head scratching, and various notes, before I understood that it was a clever way of exchanging the contents of two storage locations, without a third intermediate location. Three consecutive exclusive-Ors.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: