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

📄 graphics.asm

📁 一个微型操作系统源码
💻 ASM
字号:
;  Display space character
_display_space:
    mov ah, 0x0E    ; BIOS teletype
    mov al, 0x20    ; space character
    mov bh, 0x00    ; display page 0
    mov bl, 0x07    ; text attribute
    int 0x10        ; invoke BIOS
    ret
; CRLF
_display_endl:
    mov ah, 0x0E        ; BIOS teletype acts on newline!
    mov al, 0x0D
    mov bh, 0x00
    mov bl, 0x07
    int 0x10
    mov ah, 0x0E        ; BIOS teletype acts on linefeed!
    mov al, 0x0A
    mov bh, 0x00
    mov bl, 0x07
    int 0x10
    ret
;** ChaOS>>
_display_prompt:
    mov si, strPrompt   ;load message
    mov al, 0x01        ;request sub-service 0x01
    int 0x21
    ret
;** Get User Command
_get_cmd:
    mov BYTE[nCmdSize],0x00 ; set 0 cmd length
    mov di,strCmd
   _get_cmd_begin:
    mov ah,0x10 ; read a char
    int 0x16
    
    cmp al,0x08; check back space
    je  _backspace
    
    cmp al, 0x0D        ;check if Enter pressed
    je _enter_key
    
    mov bh,[cmdLen]
    mov bl,[nCmdSize]
    cmp bh,bl   ; is max len  reached ?
    je _get_cmd_begin
    
    mov [di],al        ; add it to buffer
    inc di
    inc BYTE[nCmdSize] ;increment counter
    
    mov ah,0x0E ; Display char
    mov bl,0x07
    int 0x10
    jmp _get_cmd_begin;
  _backspace:
    mov bh,0x00
    mov bl,[nCmdSize]
    cmp bh,bl        ; if counter = 0 do nothing
    je _get_cmd_begin
    
    dec BYTE[nCmdSize]
    dec di
    
    mov ah,0x03  ; read cursor position
    mov bh,0x00
    int 0x10
    
    cmp dl,0x00
    jne _move_back
    dec dh
    mov dl,79
    mov ah,0x02
    int 0x10
    
    mov ah,0x09  ;display
    mov al,' '
    mov bh,0x00
    mov bl,0x07
    mov cx,1
    int 0x10
    jmp _get_cmd_begin
    
  _move_back:
    mov ah,0x0E
    mov bh,0x00
    mov bl,0x07
    int 10h
    mov ah,0x09
    mov al,' '
    mov bh,0x00
    mov bl,0x07
    mov cx,1
    int 0x10
    jmp _get_cmd_begin
    
  _enter_key:
    mov BYTE[di],0x00
    ret
  _disp_logo:
    mov si,logo1
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo2
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo3
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo4
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo5
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo6
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo7
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo8
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo9
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo10
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo11
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo12
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo13
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo14
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo15
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo16
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo17
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo18
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo19
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo20
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo21
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo22
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo23
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo24
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo25
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo26
    mov al,0x01
    int 0x21
    call _display_endl
    
    mov si,logo28
    mov al,0x01
    int 0x21
    call _display_endl
    
    
    ret

⌨️ 快捷键说明

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