From 993bc23b8caabcc51b60935a8b130999f1756f7b Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 5 Jun 2019 16:46:24 +0800 Subject: [PATCH] add initial state of registers --- src/page.h | 1 + src/templates/randomx.html | 47 +++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/page.h b/src/page.h index e0d2bd3..dd41d2b 100644 --- a/src/page.h +++ b/src/page.h @@ -1462,6 +1462,7 @@ show_randomx(uint64_t _blk_height) for (auto& rxc: rx_code) { mstch::map rx_map = rxc.get_mstch(); + rx_map["first_program"] = (code_idx == 1); rx_map["rx_code_idx"] = code_idx++; rx_code_str.push_back(rx_map); } diff --git a/src/templates/randomx.html b/src/templates/randomx.html index 6803e2e..dd88d99 100644 --- a/src/templates/randomx.html +++ b/src/templates/randomx.html @@ -4,39 +4,40 @@

Eight RandomX and correspoding assembly x86 programs used to calcualte the PoW hash of the block.
- The RandomX programs are executed on RandomX virtual machine.
- Initial values of the integer and floating point registers in the machine are also provided. + The RandomX programs are executed on RandomX virtual machine.

+
+ Values of the integer and floating point registers + are also provided. +
{{#rx_codes}}

Program #{{rx_code_idx}}

+ {{#first_program}} + {{/first_program}} + + - - - + + +
Integer registers R:

- r0: {{r0}}, r1: {{r1}}, r2: {{r2}}, r3: {{r3}}
- r4: {{r4}}, r5: {{r5}}, r6: {{r6}}, r7: {{r7}}

+ r0: 0x0000000000000000, r1: 0x0000000000000000, r2: 0x0000000000000000, r3: 0x0000000000000000
+ r4: 0x0000000000000000, r5: 0x0000000000000000, r6: 0x0000000000000000, r7: 0x0000000000000000

+ Floating point registers F {lo, hi}:

- f0: {{f0}}, f1: {{f1}}
- f2: {{f2}}, f3: {{f3}}

+ Initial values not accessible

Floating point registers E {lo, hi}:

- e0: {{e0}}, e1: {{e1}}
- e2: {{e2}}, e3: {{e3}}

+ Initial values not accessible

Floating point registers A {lo, hi}:

a0: {{a0}}, a1: {{a1}}
a2: {{a2}}, a3: {{a3}}

-
-
RandomX code ASM x86
{{rx_code}}
@@ -45,6 +46,26 @@
{{rx_code_asm}}
+ Integer registers R:

+ r0: {{r0}}, r1: {{r1}}, r2: {{r2}}, r3: {{r3}}
+ r4: {{r4}}, r5: {{r5}}, r6: {{r6}}, r7: {{r7}}

+ + Floating point registers F {lo, hi}:

+ f0: {{f0}}, f1: {{f1}}
+ f2: {{f2}}, f3: {{f3}}

+ + Floating point registers E {lo, hi}:

+ e0: {{e0}}, e1: {{e1}}
+ e2: {{e2}}, e3: {{e3}}

+ + Floating point registers A {lo, hi}:

+ a0: {{a0}}, a1: {{a1}}
+ a2: {{a2}}, a3: {{a3}}

+
+
{{/rx_codes}}