Compile a simulated piano

Source: Internet
Author: User
; Compare low piano assume Cs: code, DS: data, SS: stackdata segment; set the keyboard location; audio Area A: 7 S: 8 d: 9 F: 10 J: 11 K: 12 L: 13; Q: 14 W: 15 E: 16 R: 17 U: 18 I: 19 o: 20; bass Z: 0 x: 1 C: 2 V: 3 B: 4 N: 5 m: 6; fill area T: 17 y: 18G: 10 h: 11 P: 20 ;'[': 20'] ': 20';': 14' "': 14' <':; '<': 5'> ': 5' \': 6; '^': 0'-': 0''': 0. because the number of acⅱ 'A' is small, it must be case-insensitive, subtract 'A' to get the sequence number normalf dd 119000 time DW 0 ind dB, 131,147,165,175,196,220,247,262,294,330,349,392,440,494,524,587,659,698,784,880,988, 0 fre DW str1 DB "Welcome !! $"Str2 DB" the keyboard is distributed like that: $"str3 DB" 0 exit $"str4 DB" high Q w e r u I o $"str5 DB" Medium A S D f J K L $"str6 DB" low Z x c v B N M $ "lenstr DW 10, 39, 7, 21, 21 Data endsstack segment buff dB 80 h DUP (0) stack endscode segment init proc; divide all frequencies by reference frequencies mov CX, 21 mov Di, 0 loop1: mov dx, normalf [2] mov ax, normalf Div fre [di] mov fre [di], ax add Di, 2 loop loop1 mov CX, 5; Output prompt language Lea Di, str1 mov ax, 0900 H mov dx, di mov Si, 0 int 21 h call newline loop3: Add Di, lenstr [Si] Add Si, 2 mov dx, di mov ax, 0900 H int 21 h call newline loop loop3 RET init endp ring proc; The called characters are stored in the stack pop Si pop di sub Di, 'A' mov Al, IND [di] mov Di, ax add Di, di mov ax, 0 mov Al, 0b6h out 43 H, Al mov Al, byte PTR fre [di] out 42 h, al mov Al, byte PTR fre [di + 1] out 42 h, Al in Al, 61 h or Al, 3 out 61 H, Al mov Al, 0 int 1ah mov time, DX back1: mov Al, 0 int 1ah sub dx, time CMP dx, 5 h JB back1 mov ax, 0 out 61 H, Al push Si RET ring endp newline proc mov ah, 02 h mov DL, 0dh int 21 h mov ah, 02 h mov DL, 0ah int 21 h RET newline endp begin: mov ax, data mov ds, ax mov ax, stack mov SS, ax call init loop2: mov ah, 01 H int 21 h CMP Al, 'A' JB exit CMP Al, 'z' ja exit mov ah, 0 push ax call ring JMP loop2 Exit: mov ax, 4c00h int 21 hcode endsend begin

  

Compile a simulated piano

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.