Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Chapter-5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@ void Io::putc(char c){
kattr = 0x07;
unsigned char *video;
video = (unsigned char *) (real_screen+ 2 * x + 160 * y);
// newline
if (c == '\n') {

if (c == '\n') { // newline
x = 0;
y++;
// back space
} else if (c == '\b') {
}
else if (c == '\b') { // back space
if (x) {
*(video + 1) = 0x0;
x--;
}
// horizontal tab
} else if (c == '\t') {
}
else if (c == '\t') { // horizontal tab
x = x + 8 - (x % 8);
// carriage return
} else if (c == '\r') {
}
else if (c == '\r') { // carriage return
x = 0;
} else {
}
else {
*video = c;
*(video + 1) = kattr;

Expand Down