requesting help with Template tiddlers

61 views
Skip to first unread message

Charlie Hitselberger

unread,
Aug 12, 2017, 9:51:42 PM8/12/17
to TiddlyWiki
A while back, I put together a tiddlywiki for a Forth language I'm writing as part of a retrocomputing project.  http://chitselb.com/files/tiddlypettil.html . This file is automatically generated each time I build the source, and most of the tiddlers are the Forth dictionary, with the tiddlywiki documentation for each forth word contained in its assembler source between "#if 0" / "#endif" to make the 6502 assembler ignore it.   In the "About PETTIL" tiddler, I used the expedient of writing.

For Primitives, it would be useful to have a CPU register diagram indication of which registers and flags (really just N, V, Z, and C) are affected, and I can do it using tables, but this afternoon I did not succeed at coming up with a scheme where I can pass in a parameter (e.g. "*----**" to mean only A, Z and C are modified by this primitive) and display it in a chart.  Here are a few designs, not sure which one I'll wind up using yet.

Any help would be appreciated.
Charlie

|''A*''&nbsp;&nbsp;&nbsp;X.&nbsp;&nbsp;&nbsp;Y.|^- altered<br/>* result<br/>. unchanged<br/> |
|''N -''&nbsp;&nbsp;&nbsp;V .&nbsp;&nbsp;&nbsp;''Z *''&nbsp;&nbsp;&nbsp;C .|~|
|Z implies A=0<br/>!Z implies A!=0 |<|


|N ''-''|V .|Z ''*''|C .|
|A ''-''|X .|Y .||

|^A|^''-'' |^N|^''-'' |
|^X||^V||
|^Y||^Z|^''*'' |
|>||^C||
|altered|<|<| -|f
|useful|<|<| *|f
|unchanged|<|<| |f



tiddlywiki question.png

Charlie Hitselberger

unread,
Aug 13, 2017, 3:00:30 AM8/13/17
to TiddlyWiki
hmm... probably with something like this: :)

\define registers(A:"." X:"." Y:"." N:"." V:"." Z:"." C:".")
Registers affected<br/>

|N ''$N$''|V ''$V$''|Z ''$Z$''|C ''$C$''|
|A ''$A$''|X ''$X$''|Y ''$Y$''||
\end
<<registers Z:"*"  >>
<<registers X:"*"  >>
<<registers X:"*"  >>
<<registers C:"*" X:"*" >>

PMario

unread,
Aug 13, 2017, 6:44:23 AM8/13/17
to TiddlyWiki
Hi Charlie,

I personally would go with something like the following code. It will give you a bit more visibility and more control over styling.

\define registers(A:"A ." X:"X ." Y:"Y ." N:"N ." V:"V ." Z:"Z ." C:"C .")
Registers affected

| $N$ | $V$ | $Z$ | $C$ |
| $A$ | $X$ | $Y$ ||
\end
<<registers N:"//''N *''//"  >>
<<registers X:"!X *"  >>
<<registers X:"//''X *''//"  >>
<<registers C:"''C *''" X:"''X *''" >>


have fun!
mario


PMario

unread,
Aug 13, 2017, 9:11:34 AM8/13/17
to TiddlyWiki
Hi,

I didn't like my last proposal. So here is a new one, that you can drag and drop import to your TW.

The main code looks like this:

\define val(tid x)
<$transclude tiddler=$tid$ index=$x$ >$x$ .</$transclude>
\end
\define registers(A:"." X:"." Y:"." N:"." V:"." Z:"." C:".")
Registers affected

| <<val $N$ N>> | <<val $V$ V>> | <<val $Z$ Z>> | <<val $C$ C>>|
| <<val $A$ A>> | <<val $X$ X>> | <<val $Y$ Y>> | |

\end

<<registers N:"*"  A:"*" Y:"*" C:"-">>

There are 2 loopup tiddlers in the json file.

* ... useful formats
- ... altered formats

The "." is default fallback in the val transclude macro.

If you have questions ... just ask

have fun!
mario




register-info-table.json
Reply all
Reply to author
Forward
0 new messages