Assembly code is normally divided into columns like this:
label: instruction operands ; comments
My habit is to start the instructions in column 9 with operands starting in column 17. This looks pretty good, but many of my lines of code are a little long. I originally shrank them somewhat to fit the width of the printed book (about 6 inches). Then I ran into the Kindle.
The Kindle is limited to 47 characters of monospaced text per line or 65 characters in landscape mode. I was originally fairly happy when I discovered the landscape mode. Nearly all my comments were 65 or fewer characters.
Then I borrowed my son's Nook. The Nook apparently did not have a landscape mode. I opted from the start to make the Nook version be the same as the Kindle version, so I have to live with the portrait mode.
I have gone through the code once (or twice) shrinking comments and spreading comments out onto 2 lines to make the book look fairly good on the Kindle with 47 characters, but I was not too happy with short lines for the printed version of the book. So after some thought I decided to dive in and solve the problem with a bash/awk script.
I wrote a fairly good script which tries to break long comments near the middle and apparently break one line into 2 lines is sufficient for my needs. I was afraid that I would need more robust code, but I'll leave it as is for now.
My script does allow a command-line parameter for the number of columns. I need to borrow the Nook again and study it in detail. Perhaps it has a smaller monospaced font which will allow wider lines. I also don't know precisely the number of characters across the Nook screen. I will be prepared for updating the Kindle and Nook books fairly soon. I have also found a moderate number of typos, so I might update the printed book on Create Space as well.
Hopefully I will get around to doing some Windows assembly language during the Christmas break...