例一
; Test6_1.asm
.386
.model flat, stdcall
include msvcrt.inc
includelib msvcrt.lib
.data
szFmt db '%s', 0DH, 0AH, 0
v1 db 'ABCDEFG', 0
v2 db "ABCDEFG", 0
v3 db 'A', 'B', 'C', 'D', 'E', 'F', 'G', 0
v4 db 'ABC', 'DEFG', 0
v5 db 65, 66, 67, 68, 69, 70, 71, 0
v6 db 'A', 'A'+1, "C", 44h, 105o, 70, 1000111b, 0
.code
start:
invoke crt_printf, addr szFmt, addr v1 ;ABCDEFG
invoke crt_printf, addr szFmt, addr v2 ;ABCDEFG
invoke crt_printf, addr szFmt, addr v3 ;ABCDEFG
invoke crt_printf, addr szFmt, addr v4 ;ABCDEFG
invoke crt_printf, addr szFmt, addr v5 ;ABCDEFG
invoke crt_printf, addr szFmt, addr v6 ;ABCDEFG
ret
end start
例二:
; Test6_2.asm
.386
.model flat, stdcall
include msvcrt.inc
includelib msvcrt.lib
.data
szFmt db '%s', 0DH, 0AH, 0
v1 db 3 dup('A'), 0
v2 db 3 dup('Del'), 0
.code
start:
invoke crt_printf, addr szFmt, addr v1 ;AAA
invoke crt_printf, addr szFmt, addr v2 ;DelDelDel
ret
end start