Terminal control/Cursor positioning: Difference between revisions
Content added Content deleted
(Add Nimrod) |
(Added Whitespace entry, with assembly explanation) |
||
Line 313: | Line 313: | ||
# number to obtain correct positioning. |
# number to obtain correct positioning. |
||
tput cup 5 2</lang> |
tput cup 5 2</lang> |
||
=={{header|Whitespace}}== |
|||
Using ANSI escape sequence, where ESC[y;xH moves curser to row y, col x (see below): |
|||
<lang whitespace> |
|||
</lang> |
|||
This solution was generated from the following pseudo-Assembly. |
|||
<lang asm>push "Hello" ;The characters are pushed onto the stack in reverse order |
|||
push "[6;3H" |
|||
push 27 ;ESC |
|||
push 11 ;Number of characters to print |
|||
call 0 ;Calls print-string function |
|||
exit |
|||
:0 |
|||
dup jumpz 1 ;Return if counter is zero |
|||
exch prtc ;Swap counter with next the character and print it |
|||
push 1 sub ;Subtract one from counter |
|||
jump 0 ;Loop back to print next character |
|||
:1 |
|||
pop ret ;Pop counter and return</lang> |
|||
=={{header|XPL0}}== |
=={{header|XPL0}}== |