Compilation Language Keyboard Design (2)

zhaozj2021-02-16  59

Six, procedural list:

The main program code is as follows:; macro definition

Draw Macro Start_x, Start_Y, End_x, End_y, Color

Local Draw_next

; LOCAL: Repeat of the label when avoiding macros.

Function: Drawing Rectangle

Use conditions: start_x

Push AX

Push bx

PUSH CX

Push dx

MOV AH, 0CH; write pixel point

MOV Al, Color; Settings Colors

MOV BH, 0; selected page number 0

MOV CX, Start_X; Leading Site

MOV DX, START_Y; Row start point

Draw_next:

INT 10h; painting point

INC CX; painting horizontal line

CMP CX, END_X; compare whether the line is painted

JNE DRAW_NEXT;

MOV CX, Start_x; starting point of another line

INC DX

CMP DX, END_Y; Compare Columns Draw

JNE DRAW_NEXT; continued

POP DX

POP CX

POP BX

POP AX

ENDM

Drawsqre Macro Start_x, Start_Y, End_x, End_y, Color

Local Row_up, Row_Down, Rank_lef, Rank_right

; Function: Rectangle not filled

Push AX

Push bx

PUSH CX

Push dx

Push Si

Mov Ah, 0ch

MOV

Al

, Color

MOV BH, 0

MOV CX, Start_x

MOV DX, Start_Y

Row_up:;

INT 10h

INC CX

CMP CX, END_X

JNE row_up

Rank_right:; Painting Right

INT 10h

INC DX

CMP DX, END_Y

JNE RANK_RIGHT

MOV CX, START_X; starting point below

MOV Si, End_x

Inc Si

Row_down:;

INT 10h

INC CX

CMP CX, Si

JNE row_down

MOV DX, START_Y; Right Start Point MOV CX, Start_x

Rank_left:; Painting Right

INT 10h

INC DX

CMP DX, END_Y

JNE Rank_left

POP Si

POP DX

POP CX

POP BX

POP AX

ENDM

Data segment

Data segment

Define on the screen drawn word

START_COL DB?; Storage starting line

TEXT DB 16; starting line

DB 2; starting columns

DB 06H; font color

DB 'PIANO XP', 0FFH, 'CopyRight (C) Auto-5-5th', 0FFH, 0FFH; Display Word

DB 10 DUP (2 DUP (0DBH), 2 DUP (20H)), 0FFH; Color Cross Rectangle

DB 10 DUP (2 DUP (20H), 2 DUP (0DBH)), 0FFH

DB 10 DUP (2 DUP (0DBH), 2 DUP (20H)), 0FFH

DB 10 DUP (2 DUP (20H), 2 DUP (0DBH)), 0FFH

DB 10 DUP (2 DUP (0DBH), 2 DUP (20H)), 0FFH

DB 10 DUP (2 DUP (20H), 2 DUP (0DBH)), 0FFH

DB 00

White piano coordinates

ST_LX DW 50, 61, 72, 83, 94, 105, 116

ST_MX DW 127, 138, 149, 160, 171, 182, 193

ST_HX DW 204, 215, 226, 237, 248, 259, 270

ST_Y DW 50

ED_LX DW 60, 71, 82, 93, 104, 115, 126

ED_MX DW 137, 148, 159, 170, 181, 192, 203

ED_HX DW 214, 225, 236, 247, 258, 269, 280

ED_Y DW 90

Black keys coordinates

BT_X DW 57, 68, 90, 101, 112

DW 134, 145, 167, 178, 189

DW 211, 222, 244, 254, 265

BT_Y DW 50

BD_X DW 64, 75, 97, 108, 119

DW 141, 152, 174, 185, 196

DW 218, 229, 251, 262, 273

BD_Y DW 70

Music frequency value

Lowd DW 131

Lowdd DW 147, 165, 175, 196, 220, 247

Mid dw 262

Midd dw 294, 330, 349, 392, 440, 494

HGH DW 523

HGHD DW 587, 659, 797, 783, 879, 987, 1046

Keyflag db 1; low mark (0), medium (1), high (2) tone keys

Keynum dw 1; storage 1 ~ 7

DELAY_TIME DW 7000; Delayed Song DW 100; Save the selected auto-played track

Tune DW 1; Marker C Tone or D Tone

Audio DW 1; Low (1), Medium (2), Trules (3)

; Automatic performance song frequency and delay

Mus_freq1 dw 440, 392, 330, 392, 523, 440, 392, 440

DW 330, 392, 440, 392, 330, 262, 220, 392

DW 330, 2 DUP (294), 330, 2 DUP (392), 440, 330

DW 294, 262, 392, 330, 294, 262, 220, 262, 196

DW -1

Mus_time1 DW 37, 12, 3 DUP (25), 2 DUP (12), 50

DW 25, 2 DUP (12), 2 DUP (25), 4 DUP (12), 50

DW 37, 12, 25, 2 DUP (12), 2 DUP (25), 50

DW 37, 5 DUP (12), 100

Mus_FREQ2 DW 392, 523, 392, 330, 2 DUP (262, 330, 392), 2 DUP (523)

DW 349, 3 DUP (440), 330, 3 DUP (392), 294, 349, 330, 294, 262

DW 392, 523, 392, 330, 2 DUP (262, 330, 392), 2 DUP (523)

DW 349, 3 DUP (440), 330, 3 DUP (392), 294, 349, 330, 294, 262

DW 392, 3 DUP (523), 494, 587, 392, 392, 3 DUP (587), 523, 659, 392

DW 3 DUP (523), 330, 3 DUP (392), 294, 349, 330, 294, 262

DW -1

MUS_TIME2 DW 12, 3 DUP (25, 2 DUP (12)), 2 DUP (25)

DW 2 DUP (19,6,2 dup (12)), 4 DUP (12)

DW 25, 12, 3 DUP (25, 2 DUP (12)), 2 DUP (25)

DW 2 DUP (19, 6, 2 dup (12)), 5 DUP (12)

DW 2 DUP (19,6,4 dup (12), 25)

DW 25, 2 DUP (12), 19, 6, 6 DUP (12), 25

Mus_Freq3 DW 262, 262, 294, 330, 330, 349, 392, 440, 392, 330

DW 392, 349, 330, 294, 349, 330, 294, 262

DW 262, 262, 294, 330, 330, 349, 392, 440, 392, 330

DW 392, 349, 330, 294, 330, 294, 262, 196

DW 392, 349, 330, 294, 196, 196, 349, 330, 294, 262

DW 392, 349, 330, 294, 196, 196, 349, 330, 294, 262

DW 262, 262, 294, 330, 330, 349, 392, 440, 392, 330

DW 392, 349, 330, 294, 330, 294, 262

DW -1

MUS_TIME3 DW 3 DUP (25, 2 DUP (12)), 50

DW 2 DUP (25, 2 DUP (12), 50)

DW 3 DUP (25, 2 dup (12)), 50

DW 2 DUP (25, 2 DUP (12)), 2 DUP (50)

DW 3 DUP (25, 2 dup (12)), 50

DW 3 DUP (25, 2 dup (12)), 50

DW 3 DUP (25, 2 DUP (12)), 50DW 2 DUP (25, 2 DUP (12)), 50

Mus_freq4 dw 262, 262, 294, 330, 330, 294, 262, 262, 220, 196

DW 262, 294, 330, 294, 262, 294

DW 262, 294, 330, 330, 294, 294, 262, 220, 220, 294, 262, 262, 220, 196

DW 196, 220, 220, 262, 262, 294, 294, 262, 220

DW 294, 330, 294, 262, 262, 294, 262, 220, 196, 220

DW 196, 220, 262, 294, 330, 392, 294, 330, 262, 294, 262, 220

DW 220, 294, 247, 220, 196, 196

DW 4 DUP (392), 330, 392, 440, 440, 392, 330

DW 5 DUP (440), 392, 392, 330, 294

DW 440, 392, 440, 392, 330, 294, 330, 294, 262, 220

DW 4 DUP (294), 262, 220, 196

DW 2 DUP (440, 392), 2 DUP (330, 294), 262, 220

DW 3 DUP (294), 262, 220, 392

DW -1

MUS_TIME4 DW 3 DUP (20, 10, 10), 50

DW 20, 10, 20, 10, 10, 80

DW 20, 10, 20, 10, 10, 3 DUP (20, 10), 20, 20, 80

DW 20, 10, 10, 20, 20, 20, 10, 10, 40

DW 20, 10, 20, 20, 10, 5, 5, 10, 10, 40

DW 20, 10, 2 DUP (20, 10, 10), 10, 5, 5, 20

DW 20, 20, 20, 10, 10, 80

DW 10, 20, 10, 20, 10, 10, 40, 10, 10, 20

DW 8 DUP (10), 80

DW 20, 10, 10, 20, 20, 4 DUP (10), 40

DW 15, 5, 10, 10, 20, 20, 80

DW 20, 10, 10, 20, 20, 4 DUP (10), 40

DW 40, 20, 20, 40, 40, 100

Mus_freq5 dw 330, 392, 440, 330, 392, 294

DW 330, 392, 440, 523, 440, 392, 220, 262, 330, 294

DW 294, 330, 392, 294, 330, 294, 220, 220

DW 220, 262, 294, 330, 294, 247, 220, 262, 196

DW 294, 330, 294, 247, 220, 196, 262

DW 523, 523, 440, 523, 440, 523, 440, 392

DW 392, 330, 440, 392, 262, 294, 262, 292, 330

DW 330, 330, 294, 330

DW 523, 523, 494, 440

DW 330, 330, 294, 330, 523, 494, 440, 330, 392

DW -1

MUS_TIME5 DW 2 DUP (12, 12, 75), 3 DUP (12), 25, 12, 25, 6, 6, 12, 75; # 1, 2

DW 12, 12, 75, 4 DUP (12), 75, 12, 12, 37, 5 DUP (12), 75

DW 37, 12, 12, 12, 12, 12, 50

DW 12, 12, 12, 50, 12, 12, 12, 75

DW 12, 12, 37, 12, 25, 6, 6, 12, 50, 12, 12, 12, 50, 12, 12, 12, 75

DW 12, 12, 37, 12, 12, 12, 12, 12, 75

Data ends

转载请注明原文地址:https://www.9cbs.com/read-22906.html

New Post(0)