Ignore machine-check MSRs
[freebsd-src/fkvm-freebsd.git] / share / examples / bootforth / screen.4th
blob3ea79e453d800052dfcf9891e80cc7724cba2c15
1 \ Screen manipulation related words.
2 \ $FreeBSD$
4 marker task-screen.4th
6 : escc  ( -- )  \ emit Esc-[
7         91 27 emit emit
10 : ho    ( -- )  \ Home cursor
11         escc 72 emit    \ Esc-[H
14 : cld   ( -- )  \ Clear from current position to end of display
15         escc 74 emit    \ Esc-[J
18 : clear ( -- )  \ clear screen
19         ho cld
22 : at-xy ( x y -- )      \ move cursor to x rows, y cols (1-based coords)
23         escc .# 59 emit .# 72 emit      \ Esc-[%d;%dH
26 : fg    ( x -- )        \ Set foreground color
27         escc 3 .# .# 109 emit   \ Esc-[3%dm
30 : bg    ( x -- )        \ Set background color
31         escc 4 .# .# 109 emit   \ Esc-[4%dm
34 : me    ( -- )  \ Mode end (clear attributes)
35         escc 109 emit