fn print(item: u32, line: u8) {
    let vga = 0xb8000 as *mut u16;
    unsafe {
        for i in (0..8).rev() {
            let mut acc = 1_u32;
            for _ in 0..i {
                acc *= 10;
            }
            if acc > 0 {
                let num: u8 = ((item / acc) % 10) as u8;
                let c: u16 = num as u16 | (0x0F << 8);
                core::ptr::write(vga.offset(i + (line * 80_u8) as isize), c as u16 + 48);
            }
        }
    }
}
// prints item in little-endian decimal order
// useful for debugging
prints item in little-endian decimal order
useful for debugging
prints item in little - endian decimal order useful for debugging
fn print(item: u32, line: u8) {
    let vga = 0xb8000 as *mut u16;
    unsafe {
        for i in (0..8).rev() {
            let mut acc = 1_u32;
            for _ in 0..i {
                acc *= 10;
            }
            if acc > 0 {
                let num: u8 = ((item / acc) % 10) as u8;
                let c: u16 = num as u16 | (0x0F << 8);
                core::ptr::write(vga.offset(i + (line * 80_u8) as isize), c as u16 + 48);
            }
        }
    }
}
fn print ( item : u32 , line : u8 ) { let vga = 0xb8000 as * mut u16 ; unsafe { for i in ( 0 .. 8 ) . rev ( ) { let mut acc = 1_u32 ; for _ in 0 .. i { acc *= 10 ; } if acc > 0 { let num : u8 = ( ( item / acc ) % 10 ) as u8 ; let c : u16 = num as u16 | ( 0x0F << 8 ) ; core :: ptr :: write ( vga . offset ( i + ( line * 80_u8 ) as isize ) , c as u16 + 48 ) ; } } } }
prints item in little-endian decimal order
useful for debugging
prints item in little - endian decimal order useful for debugging
item
u32
line
u8
item
u32
line
u8