Advertisement
Hppavilion1

TestOS.sb

Jan 31st, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Highlighted for brainfuck, but /not/ brainfuck
  2.  
  3. {  # The INTERVAL interrupt- currently, it just records how often it's been called in cell 3
  4.    =>>  # Go to the first cell then go right by 2 (to cell #3)
  5.    +  # Increment cell 3
  6.    %  # Return to whatever was going on previously
  7. }
  8.  
  9. + {  # ZERO DIVISION INTERRUPT: Called when a number is divided by 0
  10.    # Nothing to do here (we don't even use div`, so you never divide by 0)
  11. }
  12.  
  13. +2 {  # The KEYBOARD interrupt- Triggered when a key is pressed
  14.    [>]  # Find a cell we can interfere with
  15.    +753664*  # Go to the terminal register
  16.    [>]  # Go to the fist cell the terminal has that isn't open
  17.    ?    # Query hardware 0 (KEYBOAaD) for what key was most recently pressed
  18.    +2560  # Colorize the cell
  19.    % # Return to whatever was going on before (jump back to the old cell)
  20. }
  21.  
  22. +16{  # Main method- called when the kernel loads
  23.    +753664*  # Go to the proper register
  24.  
  25.    +2560  # Colorize
  26.    +107>  # Print "k"
  27.    +2560
  28.    +101>  # Print "e"
  29.    +2560
  30.    +114>  # Print "r"
  31.    +2560
  32.    +110>  # Print "n"
  33.    +2560
  34.    +101>  # Print "e"
  35.    +2560
  36.    +108>  # Print "l"
  37.    +2560
  38.    +32>   # Print <space>
  39.    +2560
  40.    +98>   # Print "b"
  41.    +2560
  42.    +111>  # Print "o"
  43.    +2560
  44.    +111>  # Print "o"
  45.    +2560
  46.    +116>  # Print "t"
  47.    +2560
  48.    +105>  # Print "i"
  49.    +2560
  50.    +110>  # Print "n"
  51.    +2560
  52.    +103>  # Print "g"
  53.    (+>)66    # Go to the next line (width-80 display)
  54.    +[]    # Hang forever without terminating
  55. }:  # Execute the main method
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement