Skip to content

Updated Readme #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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