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

📄 launcher.asm

📁 基于Menuet OS的用户应用程序及其系统应用程序(用户:BMP/jpg图片查看器 系统:CPU 状态监控程序等)
💻 ASM
📖 第 1 页 / 共 2 页
字号:
    inc     esi
    inc     edi
    
    mov     al, [esi]
    cmp     al, ' '
    je      spExit
    cmp     al, 0x09
    je      spExit
    cmp     al, 0x0a
    je      spExit
    cmp     al, 0x0d
    je      spExit
    
    jmp     sp000     
      
spError:
    mov     [fileEnd], esi          ; Abort rest of file
    
spExit:
    ret

  
;***************************************************************************
;   Function
;       storeDecimal
;
;   Description
;       The number that follows in the file is converted to binary and
;       stored. No Range checking is done; Number terminated by whitespace
;       or end of line
;
;***************************************************************************
storeDecimal:
    xor     ebx, ebx

sd000:    
    ; Exit if at end of file
    cmp     esi, [fileEnd]
    jb     sd001
    ret                             ; Abort

sd001:
    movzx   eax, byte [esi]
    cmp     al, ' '
    je      sdExit
    cmp     al, 0x09
    je      sdExit
    cmp     al, 0x0a
    je      sdExit
    cmp     al, 0x0d
    je      sdExit
    
    ; multiply number by ten , then add al - '0' to it
    shl     ebx, 1
    mov     ecx, ebx
    shl     ebx, 2
    add     ebx, ecx
    add     ebx, eax
    sub     ebx, '0'
    mov     [edi], ebx
    inc     esi
    jmp     sd000

sdExit:
    ; Did we get a number? If not, default it to 2000
    cmp     ebx, 0
    jne     sdExit1
    mov     ebx, 2000
    mov     [edi], ebx
    
sdExit1:
    add     edi, 4
    call    nextLine    
    ret
    
  
  
launch_applications:

    pusha
   
    ; Launch application ( old function, undocumented )

    mov  eax,19
    mov  ebx,[applications]
    mov  ecx,ebx    ; Application name
    add  ecx,16     ; Point to the boot option
    int  0x40
   
    push ecx
   
    ; Get the third application option

    mov     eax,[ecx+64]
    mov     cl, 40
    div     cl
    xor     ecx, ecx
    mov     cl, al
               
  newdelay:
   
    mov  eax,5
    mov  ebx,2
    int  0x40       ; Wait 20ms 
    call update_candy
    mov  eax,5
    mov  ebx,2
    int  0x40       ; Wait 20ms 
    call update_candy
   
    loop newdelay   ; wait 40ms * the value defined in 3rd param ( div by 2 )
   
    pop  ecx
   
    dec  [files]
    jne  more
    mov  eax,-1
    int  0x40
  more:
   
    add  [applications],64+16+4
   
    popa
   
    ret
   
   
update_candy:
   
    pusha
   
    sub  [cstate],2
    and  [cstate],63
   
    mov  ecx,[cstate]
    imul ecx,3
    mov  ebx,0x80000+32*3
    add  ebx,ecx
    mov  ecx,271*65536+1
    mov  edx,15*65536+83
    mov  edi,4
  newddd:
    mov  esi,10
  newdd:
    mov  eax,7
    int  0x40
    add  ebx,512*3
    add  edx,1
    dec  esi
    jnz  newdd
   
    popa
   
    ret
   
   
   
make_table:
   
    pusha
   
    mov  edi,0x80000
    mov  eax,0xffffff
   
    mov  ecx,11
  newgg:
    push ecx
    mov  ecx,512
   newg:
    mov  [edi],eax
    add  edi,3
    loop newg
     sub  eax,0x0a0802
     pop  ecx
    loop newgg
   
   
    mov  edi,0x80000+64*3
    mov  eax,0x8899ff
   
    mov  ecx,10
  newgg2:
    push ecx
    mov  ecx,32
  newg2:
    mov  [edi],eax
    mov  [edi+64*3],eax
    mov  [edi+128*3],eax
    mov  [edi+192*3],eax
    mov  [edi+256*3],eax
    mov  [edi+256*3+64*3],eax
    mov  [edi+256*3+128*3],eax
    mov  [edi+256*3+192*3],eax
   
    add  edi,3
    loop newg2
    sub  eax,0x080808
    pop  ecx
    add  edi,3+224*3+256*3
    loop newgg2
   
    popa
   
    ret
   
   
   
;   *********************************************
;   *******  WINDOW DEFINITIONS AND DRAW ********
;   *********************************************
   
   
draw_window:
   
   
    mov  eax,12                    ; function 12:tell os about windowdraw
    mov  ebx,1                     ; 1, start of draw
    int  0x40
   
    mov  eax,14
    int  0x40
   
  ;  mov  ecx,eax
  ;  and  ecx,0xffff
  ;  shr  ecx,1
  ;  sub  ecx,100

    mov  ecx,150
    shl  ecx,16
   
    shr  eax,17
    sub  eax,150
    shl  eax,16
    mov  ebx,eax
   
                                   ; DRAW WINDOW
    mov  eax,0                     ; function 0 : define and draw window
    mov  bx,300                    ; [x start] *65536 + [x size]
    mov  cx,105                    ; [y start] *65536 + [y size]
    mov  edx,0x03ffffff            ; color of work area RRGGBB,8->color gl
    mov  esi,0x805080d0            ; color of grab bar  RRGGBB,8->color gl
    mov  edi,0x005080d0            ; color of frames    RRGGBB
    int  0x40
   
                                   ; WINDOW LABEL
    mov  eax,4                     ; function 4 : write text to window
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
    mov  ecx,0xddeeff            ; color of text RRGGBB
    mov  edx,labelt                ; pointer to text beginning
    mov  esi,labellen-labelt       ; text length
    int  0x40
   
                                   ; APPLICATION // PARAMETER
    mov  eax,4                     ; function 4 : write text to window
    mov  ebx,75*65536+50           ; [x start] *65536 + [y start]
    mov  ecx,0x000000            ; color of text RRGGBB
    mov  edx,text                  ; pointer to text beginning
    mov  esi,textlen-text          ; text length
    int  0x40
   
    mov  eax,12                    ; function 12:tell os about windowdraw
    mov  ebx,2                     ; 2, end of draw
    int  0x40
   
    ret
   
   
   
   
; DATA AREA
   
; The name of the file we will read the settings from
bootFilename  db 'RDBOOT.DAT',0

   
applications  dd  file_list
   
; We may have up to 50 files started
files         dd  3
   


   
star        db  '*'
   
pos         dd   35*65536+45
   
cstate      dd  0x0
    
fileEnd    dd  0

labelt:
            db   'LAUNCHER'
labellen:
   
text:
            db   'Setting up desktop..'
textlen:

; This is the list of files started by launcher. There are three default
; ones, run if the datafile RDBOOT.DAT does not exist.
; If it does exist, the data from RDBOOT.DAT will over write these defaults
file_list:
    db   'JPEGVIEW        '
    db   'BOOT                                                            '
    dd   100
   
    db   'ICONMNGR        '
    db   'BOOT                                                            '
    dd   100
   
    db   'PANEL           '
    db   'BOOT                                                            '
    dd   100
   
I_END:
; There is space for an additional 48 applications here.. and then   
; .. the data read from the file goes after it
   

⌨️ 快捷键说明

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