Skip to content

Commit

Permalink
Colorize the system
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Apr 6, 2012
1 parent ef0c07b commit 08b9f26
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ require @vocabulary.fs
require @kernel/console.fs
require @colors.fs
require @output.fs
LIGHT GRAY UPON BLACK
.( Loading...) CR
require @kernel/multiboot.fs
require @memory.fs
Expand Down
4 changes: 3 additions & 1 deletion disassem.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
create distable 256 cells allot

: unknown-opcode
attr >r light red
." [unkown opcode "
dup c@ print-number
." '"
dup c@ emit
." ']"
1+ ;
1+
r> attr! ;

\ Initialize the entries with the unknown-opcode controller
: init-distable
Expand Down
1 change: 0 additions & 1 deletion kernel/console.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ variable color-attr

: attr color-attr @ ;
: attr! color-attr ! ;
10 attr!

: newline? ( ch -- flag )
case
Expand Down
4 changes: 2 additions & 2 deletions lisp/lisp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ unary function: eval
defer repl-function

: repl-iteration #read #eval ;
: user-repl-iteration ." * " query #read #eval #print CR ;
: user-repl-iteration ." * " query #read #eval >r attr red r> #print attr! CR ;

: process-toplevels
begin repl-function again ;
Expand Down Expand Up @@ -740,7 +740,7 @@ defer repl-function
; execute-parsing

: run-lisp
page 0 0 at-xy ." RUNNING EULEX LISP." CR CR
attr page 0 0 at-xy white ." RUNNING EULEX LISP." attr! CR CR
refill-silent? on
get-order get-current
in-lisp-package: definitions
Expand Down
3 changes: 1 addition & 2 deletions output.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ variable .index
;

: print-hex-number ( n -- )
[char] 0 emit
[char] x emit
[char] $ emit
dup 28 rshift 15 and emit-hex-digit
dup 24 rshift 15 and emit-hex-digit
dup 20 rshift 15 and emit-hex-digit
Expand Down
2 changes: 1 addition & 1 deletion tools.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
\ along with Eulex. If not, see <http://www.gnu.org/licenses/>.

: addr-column
print-hex-number [char] : emit space ;
attr gray swap print-hex-number [char] : emit space attr! ;

\ Dump n bytes of the memory from ADDR, in a readable way.
: dump ( addr n -- )
Expand Down
9 changes: 6 additions & 3 deletions user.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
\ along with Eulex. If not, see <http://www.gnu.org/licenses/>.

page
." Welcome to Eulex!" cr
attr white ." Welcome to Eulex!" attr! cr
cr
." Copyright (C) 2011,2012 David Vazquez" cr
." This is free software; see the source for copying conditions. There is NO" cr
." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." cr cr

: license
cr
." This program is free software; you can redistribute it and/or modify" cr
." it under the terms of the GNU General Public License as published by" cr
." the Free Software Foundation; either version 3 of the License, or" cr
Expand Down Expand Up @@ -60,7 +61,8 @@ variable error-message-size

: catch-errors ( xt -- )
%catch-without-unwind ?dup 0<> if
CR ." ERROR: "
cr attr red ." ERROR: " attr!
attr white swap
case
-1 of ." Aborted" cr endof
-2 of exception-message type CR endof
Expand All @@ -71,7 +73,8 @@ variable error-message-size
-14 of ." Compile-only word" cr endof
." Ocurred an unexpected error of code " dup . cr
endcase
." >>>" read_word_buffer count type ." <<<" cr
white ." >>>" read_word_buffer count type ." <<<" cr
attr!
backtrace
state 0!
clearstack
Expand Down

0 comments on commit 08b9f26

Please sign in to comment.