Jump to content

Wikipedia:Reference desk/Archives/Computing/2018 January 20

From Wikipedia, the free encyclopedia
Computing desk
< January 19 << Dec | January | Feb >> January 21 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


January 20

[edit]

8051 programmer

[edit]

I came across this page and I remember reading the same story about the 8051 programmer getting schooled by car mechanics in greater length earlier, but I can't find it in my browser history, and Google search is saturated with guides for 8051 programming. Does anyone know more about this?

weird instruction

[edit]

The page linked above reminds me that I once knew a programmer who liked to brag of having once found a use for an opcode that swapped the bytes of the program counter. What device had such a weird instruction? —Tamfang (talk) 08:47, 22 January 2018 (UTC)[reply]

Byte swap is a common machine code instruction. You give it a register and it swaps the bytes. In a 16-bit machine (very very old), it is obvious that it will swap the high and low bytes of the register. The program counter is commonly referred to as the PC or IA register, depending on the processor you are using. So, you can execute the byte-swap instruction on that register to swap the bytes of the program counter. Why would you do that? It would be equivalent to a jump. The next instruction would start somewhere else in the code. It is just coincidence that swapping the bytes is useful and that will fail if either the start-point or the end-point of this "creative" jump moves. It isn't really beneficial either. You can jump in one instruction if that command is available. If not, you jump by placing a value in the PC register, which is one instruction. Nothing is saved by using your one instruction to swap bytes of the program counter. 209.149.113.5 (talk) 14:01, 22 January 2018 (UTC)[reply]
Minor nitpick: there are enormous numbers of 8- and 16-bit computers in use, probably more than all higher-bit-width architectures combined. You probably have quite a few in your home. Not all computers are PCs, tablets, or smartphones. --47.157.122.192 (talk) 08:21, 25 January 2018 (UTC)[reply]
I really wonder what use he found, and if a any processor would have this capability. Joepnl (talk) 22:42, 23 January 2018 (UTC)[reply]
in many architectures the Program Counter is just another GPR (general purpose register) and so can be the target of any operation (arithmetic, byte move, indirect addressing and the like.) The quality of an instruction set being able to encode any combination of operation and register is called orthogonality. For example, the PDP-11 command set was highly orthogonal, allowing things like MOV -(PC),-(PC) 78.50.125.27 (talk) 15:40, 24 January 2018 (UTC)[reply]
You may be interested in the Story of Mel. Now that's real programming! --47.157.122.192 (talk) 02:41, 25 January 2018 (UTC)[reply]
Added some wikilinks to ease navigation for any interested readers.--47.157.122.192 (talk) 08:21, 25 January 2018 (UTC)[reply]

Cyrillic URLs in FB profiles

[edit]

It seems that in Facebook user profiles internationalized domain names, like Cyrillic URLs, are displayed via ASCII and Punycode, so that e.g. Russian www.фантастика.рф becomes outlandish www.xn--80aaa5akp3agco.xn--p1ai. Is there a way to fix this when logged in so that Russian URLs in my profile are displayed correctly? Thanks. 78.11.167.237 (talk) 14:16, 20 January 2018 (UTC)[reply]

There are only two ways this could be done. Facebook could fix it or someone could write a browser plugin to process punyode. I'm not aware of any plugins that do this. -- Q Chris (talk) 09:10, 25 January 2018 (UTC)[reply]