Skip to content

Commit 5bb8736

Browse files
authored
feat(instruction_appendix): add assembly field based on environment variable (#759)
added the Assembly field as optional to the instruction_appendix pdf output since it's already in a much more verified status --------- Signed-off-by: Afonso Oliveira <[email protected]>
1 parent 6e7c74c commit 5bb8736

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

backends/instructions_appendix/tasks.rake

+20-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,26 @@ end
5555
namespace :gen do
5656
task instruction_appendix_adoc: MERGED_INSTRUCTIONS_FILE.to_s
5757

58-
desc "Generate instruction appendix (merged instructions adoc and PDF)"
58+
desc <<~DESC
59+
Generate the instruction appendix (merged .adoc and PDF)
60+
61+
By default this will produce the “merged instructions” AsciiDoc file and
62+
then render it to PDF.
63+
64+
Environment flags:
65+
66+
* ASSEMBLY - set to `1` to include an “Assembly” line (instruction mnemonic + operands)
67+
before the Encoding section for each instruction.
68+
69+
Examples:
70+
71+
# Just regenerate AsciiDoc + PDF:
72+
$ do gen:instruction_appendix
73+
74+
# Include assembly templates in the docs:
75+
$ do gen:instruction_appendix ASSEMBLY=1
76+
77+
DESC
5978
task :instruction_appendix do
6079
# Generate the merged instructions adoc.
6180
Rake::Task[MERGED_INSTRUCTIONS_FILE.to_s].invoke

backends/instructions_appendix/templates/instructions.adoc.erb

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
Synopsis::
1111
<%= inst.long_name %>
1212

13+
<%- if ENV['ASSEMBLY']=="1" && inst.assembly.to_s.strip != "" -%>
14+
Assembly::
15+
<%= inst.fix_entities("#{inst.name.downcase} #{inst.assembly}") %>
16+
17+
<%- end -%>
1318
Encoding::
1419
<%- if inst.multi_encoding? -%>
1520
[NOTE]

0 commit comments

Comments
 (0)