Assembly language > Assembly discussions

ALIAS sample

(1/1)

Vortex:
Quick example to use the keyword ALIAS :


--- Code: ---.386
.model flat,stdcall
option casemap:none

ExitProcess PROTO :DWORD
printf PROTO C :DWORD,:VARARG
OutputText PROTO C :DWORD,:VARARG

ALIAS "OutputText"="printf"

includelib  \PellesC\lib\Win\kernel32.lib
includelib  msvcrt.lib


DefStr MACRO id,str

.data

    id  db str
    db  0

    slen SIZESTR str

.code

ENDM


.data

msg db 'Lenght of the string = %u',0

.code

start:

    DefStr  string,"Hello world!"

    invoke  OutputText,ADDR msg,slen

    invoke  ExitProcess,0

END start

--- End code ---

Navigation

[0] Message Index

Go to full version