ccc が一行コメント // に対応
Success

diff --git a/compiler_set/ccc/src/lexer.mll b/compiler_set/ccc/src/lexer.mll
index 0df68f0..68032a6 100644
--- a/compiler_set/ccc/src/lexer.mll
+++ b/compiler_set/ccc/src/lexer.mll
@@ -17,6 +17,9 @@ let ascii = [' ' - '~']              (* 0 - 127 *)
     | "//" [^ '\n']*
         { token lexbuf } (* eat up one-line comments *)

+    | "0x"
+        { hex_literal lexbuf }
+
     | digit+
         { INT_VAL(int_of_string (Lexing.lexeme lexbuf)) }
     | digit+ ('.' digit*)? (['e' 'E'] ['+' '-']? digit+)?
@@ -160,3 +163,6 @@ let ascii = [' ' - '~']              (* 0 - 127 *)
         { failwith "warning: unterminated comment@." }
     | _
         { comment lexbuf }
+  and hex_literal = parse
+    | ['0' - '9' 'a' - 'f' 'A' - 'F']+
+        { INT_VAL(int_of_string (Lexing.lexeme lexbuf)) }
Success

diff --git a/compiler_set/ccc/programs/OMakefile b/compiler_set/ccc/programs/OMakefile
index 72f24dd..bb900de 100644
--- a/compiler_set/ccc/programs/OMakefile
+++ b/compiler_set/ccc/programs/OMakefile
@@ -9,9 +9,9 @@ LINKER = ../helper/linker.sh
 %.bin: %.s
 	$(ASSEMBLER) $< $@

-%.s: %.c ../helper/assembly.s
-	$(COMPILER) $< > /dev/null
-	$(LINKER) $@
+# %.s: %.c ../helper/assembly.s
+# 	$(COMPILER) $< > /dev/null
+# 	$(LINKER) $@

 clean:
 	rm -f *.s *.sim *.bin
Success

diff --git a/compiler_set/ccc/src/parser.mly b/compiler_set/ccc/src/parser.mly
index 6f79321..b41451e 100644
--- a/compiler_set/ccc/src/parser.mly
+++ b/compiler_set/ccc/src/parser.mly
@@ -229,7 +229,7 @@ assignment_exp:
 | assignee_exp PLUS_EQUAL assignment_exp
     { Assign($1, Add(ref_of $1, $3)) }
 | assignee_exp MINUS_EQUAL assignment_exp
-    { Assign($1, Add(ref_of $1, $3)) }
+    { Assign($1, Sub(ref_of $1, $3)) }

 assignee_exp:
 | ID
Success

diff --git a/compiler_set/ccc/programs/OMakefile b/compiler_set/ccc/programs/OMakefile
index bb900de..72f24dd 100644
--- a/compiler_set/ccc/programs/OMakefile
+++ b/compiler_set/ccc/programs/OMakefile
@@ -9,9 +9,9 @@ LINKER = ../helper/linker.sh
 %.bin: %.s
 	$(ASSEMBLER) $< $@

-# %.s: %.c ../helper/assembly.s
-# 	$(COMPILER) $< > /dev/null
-# 	$(LINKER) $@
+%.s: %.c ../helper/assembly.s
+	$(COMPILER) $< > /dev/null
+	$(LINKER) $@

 clean:
 	rm -f *.s *.sim *.bin
[from now] Tue Dec  4 01:11:21 JST 2012

diff --git a/compiler_set/simulator/simulator.cpp b/compiler_set/simulator/simulator.cpp
index 9ed79dc..165f793 100644
--- a/compiler_set/simulator/simulator.cpp
+++ b/compiler_set/simulator/simulator.cpp
@@ -533,8 +533,18 @@ int simulate(simulation_options * opt)
 					fprintf(stderr, "Send 0x1C(A) for READKEY\n");
 					usleep(10*1000);
 				}
+				if (counter < 5) {
+					IRT = 0x40;
+				} else if (counter < 8) {
+					IRT = 0x0a;
+				} else if (counter < 14) {
+					IRT = 0x40;
+				} else if (counter < 18) {
+					IRT = 0x7f;
+				} else {
+					return 0;
+				}
 				counter++;
-				IRT = counter % 20 == 0 ? 0x0a : 0x1c;
 				break;
 			case DEBUG:
 				if (opt->lib_test_mode) {
[from now] Tue Dec  4 01:21:34 JST 2012

diff --git a/2nd/keyboard/keyboard_driver.v b/2nd/keyboard/keyboard_driver.v
index a84020e..b4f6641 100644
--- a/2nd/keyboard/keyboard_driver.v
+++ b/2nd/keyboard/keyboard_driver.v
@@ -11,6 +11,7 @@ module keyboard_driver(input clk,
    reg [7:0] recent_data[2:0];
    reg [7:0] data_buffer;
    reg [3:0] counter;
+   reg [2:0] special_key_pressed;

    initial begin
       recent_data[2] <= 0;
@@ -19,6 +20,8 @@ module keyboard_driver(input clk,

       data_buffer <= 0;
       counter <= 0;
+
+      special_key_pressed <= 0;
    end

    // 0: no data
@@ -70,6 +73,37 @@ module keyboard_driver(input clk,

    assign is_break = next_break;

+   always @ (posedge (clk)) begin
+      if (special_key_pressed[2] == 1'b1
+          && is_special_key[2] == 1'b1
+          && next_break == 1'b1)
+        special_key_pressed[2] <= 1'b0;
+      else if (special_key_pressed[2] == 1'b0
+               && is_special_key[2] == 1'b1
+               && next_break == 1'b0)
+        special_key_pressed[2] <= 1'b1;
+
+
+      if (special_key_pressed[1] == 1'b1
+          && is_special_key[1] == 1'b1
+          && next_break == 1'b1)
+        special_key_pressed[1] <= 1'b0;
+      else if (special_key_pressed[1] == 1'b0
+               && is_special_key[1] == 1'b1
+               && next_break == 1'b0)
+        special_key_pressed[1] <= 1'b1;
+
+
+      if (special_key_pressed[0] == 1'b1
+          && is_special_key[0] == 1'b1
+          && next_break == 1'b1)
+        special_key_pressed[0] <= 1'b0;
+      else if (special_key_pressed[0] == 1'b0
+               && is_special_key[0] == 1'b1
+               && next_break == 1'b0)
+        special_key_pressed[0] <= 1'b1;
+   end
+
    always @ (posedge(clk)) begin
       prev_code <= next_code;
       prev_break <= next_break;
@@ -95,5 +129,5 @@ module keyboard_driver(input clk,
       end
    end

-   assign key_status = {6'b0, new_break_code, is_break};
+   assign key_status = {3'b0, special_key_pressed, new_break_code, is_break};
 endmodule