Post view

Assembly組合語言程式:XASM.MAK、clrscr.asm、print.asm、clrscr2.asm、print2.asm

XASM.MAK :
object\$(FILE).obj: $(FILE).asm a:\include\stdio.inc a:\lib\stdio.lib
    masm /zi /zd $(FILE),object\$(FILE)$(LIST);

$(FILE).exe: object\$(FILE).obj
    link /co object\$(FILE);

; clrscr.asm

        .286
        .model  small
        .stack
        .data

; Assembly Function
        .code
clrscr  proc
        mov     al,0
        mov     bh,07H
        mov     cx,0
        mov     dh,24
        mov     dl,79
        mov     ah,06H
        int     10H
        mov     dx,0
        mov     bh,0
        mov     ah,02H
        int     10H
        ret
clrscr  endp

; main program
        .code
start:
        mov     ax,@data
        mov     ds,ax

        call    clrscr

        mov     ax,4c00H
        int     21H

        end     start


; File Name : print.asm

        .286
        .model  small
        .stack
        .data
ver     db      'MASM Version 5.1$'

; Assembly Function
        .code
printstr proc
        mov     ah,09H
        int     21H
        ret
printstr endp

printchar proc
        mov     ah,02H
        int     21H
        ret
printchar endp

printline proc
        mov     ah,09H
        int     21H
        mov     dl,10
        call    printchar
        mov     dl,13
        call    printchar
        ret
printline endp

; main program
        .code
start:
        mov     ax,@data
        mov     ds,ax

        lea     dx,ver
        call    printline

        mov     ax,4c00H
        int     21H

        end     start


; File Name : clrscr2.asm

include stdio.inc

        .data
; main program
BeginPrg
        clrscr
EndPrg
        end     start


; File Name : print2.asm

include stdio.inc

        .data
ver     db      'MASM Version 5.1$'

; main program
        .code
BeginPrg
        prints  ver, enter
EndPrg
        end     start

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