<commit_before>#include <interrupts.h>
#include <stdlib.h>
#include <kernel.h>
#include <ports.h>
#include <screen.h>

struct cpu_state * interrupts_callback(struct cpu_state *state)
{
	char str[32];

	switch(state->interrupt)
	{
		case EXC_DIVIDE_BY_ZERO:
			kernel_panic("divide by zero exception");
			break;
		case IRQ0:
			break;
		case IRQ1:
			uitoa(ports_inb(0x60), str, 2);
			screen_puts("scancode 0b");
			screen_puts(str);
			screen_putc('\n');
			break;
	}
	return state;
}<commit_msg>Print key up/down messages<commit_after>#include <interrupts.h>
#include <stdlib.h>
#include <kernel.h>
#include <ports.h>
#include <screen.h>

struct cpu_state * interrupts_callback(struct cpu_state *state)
{
	char str[32];
	unsigned char scancode;

	switch(state->interrupt)
	{
		case EXC_DIVIDE_BY_ZERO:
			kernel_panic("divide by zero exception");
			break;
		case IRQ0:
			break;
		case IRQ1:
			scancode = ports_inb(0x60);
			screen_puts("key ");
			screen_puts(scancode & 0x80 ? "up" : "down");
			screen_puts(": ");
			screen_puts(uitoa(scancode & 0x7F, str, 16));
			screen_putc('\n');
			break;
	}
	return state;
}
{'fraction_non_alphanumeric': 0.1443850267379679, 'fraction_numerical': 0.020499108734402853, 'mean_word_length': 4.504901960784314, 'pattern_counts': {'":': 1, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3693045', 'n_tokens_mistral': 507, 'n_tokens_neox': 448, 'n_words': 92}