I found this in my archives (without notes -- shame on me)and hope it may be of use to you. Please keep in mind that it uses screen 13, but should work well with whatever screen you want.
[tt]
'--Ref: use of LINE function
SCREEN 13
COLOR 2
FOR BackDropY = 0 TO 100
FOR BackDropX = 0 TO 100
PSET (BackDropX, BackDropY), 14
NEXT BackDropX, BackDropY
LeftMarg = 10
TopMarg = 2
LINE (LeftMarg, TopMarg)-STEP(0, 100), 0 'show left margin
FOR Cycle = 0 TO 15
LINE (LeftMarg, TopMarg)-STEP([red]16[/red], 0), 1, , Cycle
TopMarg = TopMarg + 3
SLEEP 1
NEXT
'END
TopMarg = TopMarg + 3
LINE (LeftMarg, TopMarg)-STEP(16, 0), 3, , [red]&H1F[/red]
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H10
'--notice that 0 is a place holder to make #1
' the significant bit?
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &HF
'--notice that F is preceeded by imaginary 000.
'--this is your examples from above.
TopMarg = TopMarg + 3
LINE (LeftMarg, TopMarg)-STEP(16, 0), 3, , &H2222
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H2000
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H200
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H20
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H2
TopMarg = TopMarg + 3
LINE (LeftMarg, TopMarg)-STEP(16, 0), 3, , &H5555
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H5000
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H500
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H50
TopMarg = TopMarg + 1
LINE (LeftMarg, TopMarg)-STEP(16, 0), 1, , &H5
[/tt]
Based on the workings, it uses 4-16 bits to draw the line. But, I never tested it to check on the vertical, only horizontal. Anyways, hope this helps you.
--MiggyD