⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib.h

📁 用开源软件自己动手写操作系统的源码,在linux下面实现
💻 H
字号:
/* chapter3/7/lib.h   Author: Wenbo Yang <solrex@gmail.com> <http://solrex.cn>   This file is part of the source code of book "Write Your Own OS with Free   and Open Source Software". Homepage @ <http://share.solrex.cn/WriteOS/>.   This file is licensed under the GNU General Public License; either   version 3 of the License, or (at your option) any later version. */DispAL:    push   %ecx    push   %edx    push   %edi    mov    (CursorPos), %edi    mov    $0xf, %ah    mov    %al, %dl    shrb   $4, %al    mov    $2, %ecxDispAL.begin:    and    $0xf, %al    cmp    $9, %al    ja     DispAL.1    add    $'0', %al    jmp    DispAL.2DispAL.1:    sub    $0xA, %al    add    $'A', %alDispAL.2:    mov    %ax, %gs:(%edi)    add    $2, %edi    mov    %dl, %al    loop   DispAL.begin    mov    %edi, (CursorPos)    pop    %edi    pop    %edx    pop    %ecx    retDispInt:    movl    4(%esp), %eax    shr     $24, %eax    call    DispAL    movl    4(%esp), %eax    shr     $16, %eax    call    DispAL    movl    4(%esp), %eax    shr     $8, %eax    call    DispAL    movl    4(%esp), %eax    call    DispAL    movb    $0x7, %ah    movb    $'h', %al    pushl   %edi    movl    (CursorPos), %edi    movw    %ax, %gs:(%edi)    addl    $4, %edi    movl    %edi, (CursorPos)    popl    %edi    retDispStr:    pushl   %ebp    movl    %esp, %ebp    pushl   %ebx    pushl   %esi    pushl   %edi    movl    8(%ebp), %esi    movl    (CursorPos), %edi    movb    $0xF, %ahDispStr.1:    lodsb    testb   %al, %al    jz      DispStr.2    cmpb    $0xA, %al    jnz     DispStr.3    pushl   %eax    movl    %edi, %eax    movb    $160, %bl    divb    %bl    andl    $0xFF, %eax    incl    %eax    movb    $160, %bl    mulb    %bl    movl    %eax, %edi    popl    %eax    jmp     DispStr.1DispStr.3:    movw    %ax, %gs:(%edi)    addl    $2, %edi    jmp     DispStr.1DispStr.2:    movl    %edi, (CursorPos)    popl    %edi    popl    %esi    popl    %ebx    popl    %ebp    retDispLF:    pushl  $(LFMes)    call    DispStr    addl    $4, %esp    ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -