Post view

Assembly組合語言程式:assembly.asm、winslib.asm、winslib.inc

;  File Name : assembly.asm

        .286
        .model  small
        .stack
        .data
        .code
main:
        mov     ax,@data
        mov     ds,ax
        mov     ax,4c00H
        int     21H
        end     main

;  File Name : window.asm

        .286
        .model  small
        .stack
        .data
window  db      "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»",10,13
        db      "º                        º",10,13
        db      "º                        º",10,13
        db      "º                        º",10,13
        db      "º                        º",10,13
        db      "º                        º",10,13
        db      "º                        º",10,13
        db      "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ",10,13,"$"

        .code
main:
        mov     dx,@data
        mov     ds,dx

        lea     dx,window
        mov     ah,09H
        int     21H

        mov     ax,4c00H
        int     21H
        end     main

;  File Name : winslib.asm

        .286
        .model  small
        .code
public  printch, newline, ShowWindow

        .code
printch proc
        push    ax
        mov     ah,02H
        int     21H
        pop     ax
        ret
printch endp

newline proc
        push    dx
        mov     dl,13
        call    printch
        mov     dl,10
        call    printch
        pop     dx
        ret
newline endp

ShowWindow    proc
        mov     bx,dx
        mov     dl,218
        call    printch
        mov     cx,0
        mov     cl,[bx]         ;cl = width
        sub     cx,2            ;cx = cx - 2
line1:
        mov     dl,196
        call    printch
        loop    line1
        mov     dl,191
        call    printch
        call    newline

        mov     cl,[bx+1]       ;cl = length
        sub     cx,2            ;cx = cx - 2
        mov     di,cx
line2:
        mov     dl,179
        call    printch
        mov     cl,[bx]         ;cl = width
        sub     cx,2            ;cx = cx - 2
space:
        mov     dl,32
        call    printch
        loop    space
        mov     dl,179
        call    printch
        call    newline
        dec     di
        jnz     line2
        mov     dl,192
        call    printch
        mov     cl,[bx]         ;cl = width
        sub     cx,2            ;cx = cx - 2
line3:
        mov     dl,196
        call    printch
        loop    line3
        mov     dl,217
        call    printch
        call    newline
        ret
ShowWindow    endp

        end

;  File Name : winslib.inc

includelib winslib.lib

        .286
        .model  small
        .stack

        .code
extrn   printch:proc
extrn   newline:proc
extrn   ShowWindow:proc

蘇言霖 2013/09/11 0 1469
Comments
Order by: 
Per page:
 
  • There are no comments yet
Rate
0 votes
Post info
蘇言霖
「超級懶貓級」社群網站站長
2013/09/11 (3852 days ago)
Actions