2021-01-12 07:59:17 +00:00
|
|
|
# Draw a single line of ASCII text using the built-in font (GNU unifont)
|
|
|
|
# Also demonstrates bounds-checking _before_ drawing.
|
2021-01-10 02:28:27 +00:00
|
|
|
#
|
|
|
|
# To build a disk image:
|
2021-07-16 15:09:42 +00:00
|
|
|
# ./translate apps/ex5.mu # emits code.img
|
2021-01-10 02:28:27 +00:00
|
|
|
# To run:
|
2021-04-17 03:26:42 +00:00
|
|
|
# qemu-system-i386 code.img
|
2021-01-10 02:28:27 +00:00
|
|
|
#
|
|
|
|
# Expected output: text in green near the top-left corner of screen
|
|
|
|
|
2021-03-28 00:47:23 +00:00
|
|
|
fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
|
2021-03-27 06:05:54 +00:00
|
|
|
var dummy/eax: int <- draw-text-rightward screen, "hello from baremetal Mu!", 0x10/x, 0x400/xmax, 0x10/y, 0xa/fg, 0/bg
|
|
|
|
dummy <- draw-text-rightward screen, "you shouldn't see this", 0x10/x, 0xa0/xmax, 0x30/y, 3/fg, 0/bg # xmax is too narrow
|
2021-01-10 02:28:27 +00:00
|
|
|
}
|