汇编一日一学(3)--调用调用汇编宏库程序

INCLUDE MACROOUT.LIB

DATAS SEGMENT

STRING DB 'Hello World',13,10,'$'

DATAS ENDS

CODES SEGMENT

ASSUME CS:CODES,DS:DATAS

START:

MOV AX,DATAS

MOV DS,AX

OUTPUT STRING

MOV AH,4CH

INT 21H

CODES ENDS

END START

Output: 在宏汇编中定义:

INPUT MACRO

MOV AH,01H

INT 21H

ENDM

OUTPUT MACRO ADDR

MOV DX,OFFSET ADDR

MOV AH,09H

INT 21H

MULT MACRO MULT1,MULT2,MULT3

LOCAL LOP,EXIT1

MOV DX,MULT1

MOV CX,MULT2

XOR AX,AX

JCXZ EXIT1

LOP: ADD AX,DX

LOOP LOP

EXIT1: MOV MULT3,AX

ENDM

ENDM

源文档 <http://blog.csdn.net/jjcrazy/archive/2007/02/02/1501461.aspx>

你可能感兴趣的:(汇编)