Author Topic: phonecall  (Read 160 times)

felipe

  • Member
  • ***
  • Posts: 280
  • I love assembly language programming.
phonecall
« on: May 17, 2017, 08:41:38 AM »
Ok i know this is stupid, but when you are learning (some difficult subject), you like to study the theory (what you must know ) and also apply what you have learned so far. And while i reach the creation of a window, i put here the " phone call" program, which is quite stupid, but fun too.  :lol:

Code: [Select]
.386
.model  flat,stdcall
option  casemap:none

include c:\masm32\include\kernel32.inc
includelib c:\masm32\lib\kernel32.lib

.code

start:
    mov     ebx,10
   
again:
    push    1000 ; 1 second.
    push    500 ; At least in my netbook this sounds like a phone tone.
    call    Beep
    push    2000 ; 2 seconds
    push    0 ;  of silence.
    call    Beep
    dec     ebx ; 10 times.
    jnz     again
 
    push    0
    call    ExitProcess

    end     start

Don't worry, nobody will answer that call... :greensml:
Felipe.