; CIS-261 Lab exercise M09
; M09_prototype.asm
; Program that beeps
;
.386 ; Tells MASM to use Intel 80386 instruction set.
.MODEL FLAT ; Flat memory model
option casemap:none ; Treat labels as case-sensitive
EXTERN _Beep@8:NEAR ; takes 2 DWORD parameters
EXTERN _Sleep@4:NEAR ; takes 1 DWORD parameter
.CONST ; Constant data segment
.DATA ; Begin initialised data segment
.CODE ; Begin code segment
_main PROC ; Main entry point into program
; __stdcall calling convention: args pushed R to L
mov eax, 500 ; duration, milliseconds
push eax
mov eax, 1000 ; frequency, Hertz
push eax
call _Beep@8 ; Beep( frequency, duration );
mov eax, 500 ; sleep time in milliseconds
push eax ; param on the stack
call _Sleep@4
ret
_main ENDP
END _main ; Marks the end of the module and sets the program entry point label