home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
PP911.ZIP
/
HELLO386
< prev
Wrap
Text File
|
1990-05-07
|
1KB
|
47 lines
POWER PROGRAMMING
RAY DUNCAN
Vol. 9, No. 11
HELLO386
.386
assume cs:FLAT,ds:FLAT,es:FLAT,ss:FLAT
_DATA segment dword use32 public 'CODE'
msg db 0ah,'Hello World!',0 ; text to display
_DATA ends
_TEXT segment dword use32 public 'CODE'
wlen equ dword ptr [bp-12] ; assign stack locations
rc equ dword ptr [bp-8] ; of local variables
p equ dword ptr [bp-4]
_main proc near
push ebp ; set up stack frame
mov ebp,esp
sub esp,12 ; allocate local vars
mov p,offset msg ; initialize variable p
; set up Dos32Write call
lea eax,wlen ; push address of wlen
push eax
push offset msg ; find length of text
call _strlen
lea esp,dword ptr [ebp-16] ; clear stack
push eax ; push length of text
push p ; push address of text
push 1 ; push stdout handle
call Dos32Write ; transfer to OS/2
lea esp,wlen ; clear args from stack
mov rc,eax ; save error/success code
leave ; discard stack frame
ret ; return to caller
_main endp
_TEXT ends