Module:Instruction set table builder: Difference between revisions

Reduced font size for instruction table to shrink table width
mNo edit summary
(Reduced font size for instruction table to shrink table width)
 
(4 intermediate revisions by the same user not shown)
Line 29:
str = str:gsub("rs", "r<sub>s</sub>")
str = str:gsub("rt", "r<sub>t</sub>")
str = str:gsub("r'd", "rd")
str = str:gsub("r't", "rt")
str = str:gsub("r's", "rs")
return str
Line 66 ⟶ 70:
function p.set( frame )
local args = getArgs(frame)
local s = "{| class=\"wikitable\" style=\"text-align: center; font-size: 85%;\"\n! Mnemonic !! Description !! 32-bit Instruction Word\n"
local arr = {}
Line 75 ⟶ 79:
for i = 1, #arr, 4 do
local mnemonic = formatMnemonic( string.gsub(string.format("%-10s", arr[i]), " ", "&nbsp;") .. arr[i + 1] )
mnemonic = mnemonic:gsub(arr[i], "[[#"..arr[i].."|"..arr[i].."]]")
local descrip = formatDescription( arr[i + 2] )
local word = string.addSpacing(string.gsub(arr[i + 3], " ", ""), 4)
s = s .. "|-\n"
s = s .. "| style=\"text-align: left; font-family: Consolas,Monaco,Lucida Console,monospace; padding: 1px 7px 1px 7px;\"| " .. mnemonic
.. " || style=\"text-align: left; font-family: Consolas,Monaco,Lucida Console,monospace; padding: 1px 7px 1px 7px;\"| " .. descrip
.. " || style=\"font-family: Consolas,Monaco,Lucida Console,monospace; padding: 1px 7px 1px 7px;\"| " .. word
.. "\n"
end