-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm_test.c
84 lines (80 loc) · 2.47 KB
/
vm_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright 2014, 2015, Jacques Deschênes
* This file is part of CHIPcon v2.
*
* CHIPcon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CHIPcon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CHIPcon v2. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* vm_test.c
*
* Created: 2014-10-15 22:33:17
* Author: Jacques
*/
#include "vm_test.h"
#include <avr/pgmspace.h>
PROGMEM const uint8_t test_info[]="vm test\n";
PROGMEM const uint8_t test[TEST_SIZE]={
0x00, 0xe0, //0x200 CLS
0x00, 0xff, //0x202 HIGH
0xf3, 0x85, //0x204 LD V3, RPL
0x64, 0x00, //0x206 LD V4, #00
0x65, 0x00, //0x208 LD V5, #00
0xa2, 0x46, //0x20a LD I, #0x246 ld I, schip
0xd4, 0x50, //0x20c loop: DRAW V4, V5, 0 16x16
0x66, 0x02, //0x20e LD V6, #2
0xf6, 0x15, //0x210 LD DT, V6
0xf6, 0x07, //0x212 wait: LD V6, DT
0x36, 0x00, //0x214 SE V6, #00
0x12, 0x12, //0x216 JP #0x212 jump wait
0xd4, 0x50, //0x218 DRAW V4, V5, 0 16x16
0x54, 0x00, //0x21a SE V4, V0
0x12, 0x26, //0x21c JP #0x226 jump no_down
0x95, 0x10, //0x21e SNE V5, V1
0x12, 0x2a, //0x220 JP #0x22a jump no_up
0x75, 0x01, //0x222 ADD V5, #1
0x12, 0x0c, //0x224 JP #20c jump loop
0x74, 0x01, //0x226 no_down: ADD V4, #1
0x12, 0x0c, //0x228 JP #0x20c jump loop
0x64, 0x00,//0xd4, 0x50, //0x22a no_up: DRAW V4, V5, 0
0x64, 0x00, //0x22c LD V4, #0
0xf4, 0x30, //0x22e show_font: LD HF, V4
0xd2, 0x3a, //0x230 DRAW V2, V3, 10
0x65, 0x14, //0x232 LD V5, #14
0xf5, 0x15, //0x234 LD DT, V5
0xf5, 0x07, //0x236 wait2: LD V5, DT
0x35, 0x00, //0x238 SE V5, #00
0x12, 0x36, //0x23a JP #0x236 jump wait2
0xd2, 0x3a, //0x23c DRAW V2, V3 , 10
0x74, 0x01, //0x23e ADD V4, #1
0x44, 0x0a, //0x240 SNE V4, #10
0x00, 0xfd, //0x242 EXIT
0x12, 0x2e, //0x244 JP #0x22e jump show_font
0x80, 0x01, //0x246 schip:
0x03, 0x80,
0x04, 0x40,
0x04, 0x00,
0x03, 0x80,
0x00, 0x40,
0x04, 0x40,
0x03, 0x80,
0x00, 0x00,
0x35, 0x58,
0x45, 0x54,
0x47, 0x58,
0x45, 0x50,
0x35, 0x50,
0x00, 0x00,
0x80, 0x01,
0xff, // fin de fichier
};