summary refs log tree commit diff stats
path: root/.github
Commit message (Expand)AuthorAgeFilesLines
* removed duplicate templateBen Morrison2019-06-121-27/+0
* Update issue templatesBen Morrison2019-06-123-0/+74
0:09:22 -0700 6409 - primitives for text-mode UIs' href='/akkartik/mu/commit/apps/screen.mu?h=hlt&id=9511ff5cd7aeef4ccf501920e6969d2b15ecf2d5'>9511ff5c ^
c8e41a47 ^
9511ff5c ^

6b343a82 ^
9511ff5c ^
6b343a82 ^










41535426 ^
6b343a82 ^
41535426 ^
7ecfd5eb ^
41535426 ^

6b343a82 ^
8c78c3eb ^
9b873e3b ^
6b343a82 ^
c8e41a47 ^
9511ff5c ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34




                                     
 
                       

                              
                               
                         










                                    
 
                                                 
                                
                                                    

                           
                                
                              
                          
                      
          
 
# Test some primitives for text-mode.
#
# To run:
#   $ ./translate_mu apps/tui.mu
#   $ ./a.elf

fn main -> _/ebx: int {
  var nrows/eax: int <- copy 0
  var ncols/ecx: int <- copy 0
  nrows, ncols <- screen-size 0
  enable-screen-grid-mode
  move-cursor 0, 5, 0x22
  start-color 0, 1, 0x7a
  start-blinking 0
  print-string 0, "Hello world!"
  reset-formatting 0
  move-cursor 0, 6, 0x22
  print-string 0, "tty dimensions: "
  print-int32-hex 0, nrows
  print-string 0, " rows, "
  print-int32-hex 0, ncols
  print-string 0, " rows\n"

  print-string 0, "press a key to see its code: "
  enable-keyboard-immediate-mode
  var x/eax: grapheme <- read-key-from-real-keyboard
  enable-keyboard-type-mode
  enable-screen-type-mode
  print-string 0, "You pressed "
  var x-int/eax: int <- copy x
  print-int32-hex 0, x-int
  print-string 0, "\n"
  return 0
}