-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.asm
64 lines (53 loc) · 1004 Bytes
/
main.asm
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
#include "kernel.inc"
#include "corelib.inc"
#include "expr.inc"
.db "KEXC"
.db KEXC_ENTRY_POINT
.dw start
.db KEXC_STACK_SIZE
.dw 64
.db KEXC_NAME
.dw name
.db KEXC_HEADER_END
name:
.db "Calculator", 0
start:
kld(de, corelib_path)
pcall(loadLibrary)
pcall(getKeypadLock)
kcall(parser_init)
kcall(init_ui)
kcall(redraw_ui)
kld(hl, .test_expr)
ld de, 0x0808
pcall(drawStr)
kcall(parse_expr)
kcall(eval_expr)
ld a, 0xF
kld(ix, result)
kld(hl, .output_str)
pcall(fptostr)
kld(iy, (screen_buffer))
ld de, 0x080F
pcall(drawStr)
jr main_loop
.test_expr:
.db "2-1", 0
.output_str:
.block 20
main_loop:
kld(iy, (screen_buffer))
.loop:
pcall(fastCopy)
pcall(flushKeys)
corelib(appWaitKey)
cp kMODE
jr nz, .loop
ret
corelib_path:
.db "/lib/core", 0
window_title:
.db "Calculator", 0
#include "ui.asm"
#include "expr.asm"
#include "operations.asm"