opcodes

Assign by reference bug

纵饮孤独 提交于 2019-11-28 06:55:18
I came across this seemingly very simple question the other day How to changing value in $array2 without referring $array1? However the more i looked into it the more odd it seemed that this is indeed functioning as intended. After this I started looking into the opcodes that are generated from the output of the following. $array1 = array(2, 10); $x = &$array1[1]; $array2 = $array1; $array2[1] = 22; echo $array1[1]; // Outputs 22 This seems crazy to me since array2 should only be a copy of array1 and anything that happens to one array should not effect the contents of the other. Of course if

Converting very simple ARM instructions to binary/hex

让人想犯罪 __ 提交于 2019-11-27 05:31:30
问题 I've been trying to use this page as well as various other guides to figure out how to express very simple ARM instructions as binary and hex. It seems like it should be a straightforward process to me, but I still don't understand. Here's a few examples. Basic NOP: what goes here? what goes here? _↓_ _____↓____ | | | | mov r0, r0 ; ????00?1101????????????????????? |__||__| ↑ ↑ how do I express registers? Same basic question for others. Comparing two registers: cmp r1, r0 Adding immediate to

Assign by reference bug

隐身守侯 提交于 2019-11-27 01:37:00
问题 I came across this seemingly very simple question the other day How to changing value in $array2 without referring $array1? However the more i looked into it the more odd it seemed that this is indeed functioning as intended. After this I started looking into the opcodes that are generated from the output of the following. $array1 = array(2, 10); $x = &$array1[1]; $array2 = $array1; $array2[1] = 22; echo $array1[1]; // Outputs 22 This seems crazy to me since array2 should only be a copy of