วันพุธที่ 8 มีนาคม พ.ศ. 2560

Assembly code [ การใช้งาน macro ]

Ex. 10 การใช้งาน macro  
.model small

.data
msg      db 'test' ,'$'

.code
dspm    MACRO str
                        lea dx,str
                        mov      ah,9
                        int                     21h
                        ENDM
main     proc
                        mov      ax,@data
                        mov      ds,ax
                        dspm    msg
                        mov      ah,4ch
                        int         21h

main     endp
                        end main
Ex. 11 การใช้งาน macro 

dseg segment
org 100h
msg db 'this message is displayed on screen$'
dseg ends
cseg    segment
dspmsg  macro
                        lea dx,msg
                        mov ah,9
                        rept 10
                        int 21h
                        endm
                        endm

n_line   macro
            mov ah,2
            mov      dl,0ah
            int         21h
            mov      dl,0dh
            int         21h
            endm      
main     proc
             assume cs:cseg; ds:dseg
        dspmsg
             n_line

        mov          ax,4c00h       ;exit program
        int 21h
main     endp

cseg    ends
        end           main

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

Set Enable .Net framework 3.5 on windows 10 (ติดตั้ง .Netframework 3.5 บนวินโดวน์ 10)

1. Download windows 8.1 file [ TH : ดาวน์โหลดไฟล์ ของ windows 8.1 ] 2. Mount File windows Copy file \sources\sxs from mount drive ...