Line | |
---|
1 | .include IO.asm
|
---|
2 |
|
---|
3 | CALL Start
|
---|
4 | .org 8
|
---|
5 | .dd InterruptHandlerCounter
|
---|
6 | .dd InterruptHandlerMouse
|
---|
7 | .dd InterruptHandlerKeyboard
|
---|
8 |
|
---|
9 | .org $100
|
---|
10 | Start:
|
---|
11 | ;SET R0, $ff7700 ; Color
|
---|
12 | ;SET R1, 100 ; X
|
---|
13 | ;SET R2, 100 ; Y
|
---|
14 | ;SET R3, 100 ; Width
|
---|
15 | ;SET R4, 100 ; Height
|
---|
16 | ;CALL Rectangle
|
---|
17 |
|
---|
18 | SET R0, HelloWorld
|
---|
19 | SET R1, 110
|
---|
20 | SET R2, 110
|
---|
21 | CALL TextOut
|
---|
22 |
|
---|
23 | ;SET R0, 110
|
---|
24 | ;SET R1, 110
|
---|
25 | ;CALL SetPixelAddr
|
---|
26 |
|
---|
27 | ;SET R0, 65
|
---|
28 | ;SET R1, 110
|
---|
29 | ;SET R2, 110
|
---|
30 | ;CALL WriteChar
|
---|
31 |
|
---|
32 | StartLoop:
|
---|
33 | JP StartLoop
|
---|
34 | ;HALT
|
---|
35 |
|
---|
36 | InterruptHandlerCounter:
|
---|
37 | RETI
|
---|
38 |
|
---|
39 | MousePosX:
|
---|
40 | .dd 0
|
---|
41 | MousePosY:
|
---|
42 | .dd 0
|
---|
43 |
|
---|
44 | InterruptHandlerMouse:
|
---|
45 | PUSH R0
|
---|
46 | PUSH R1
|
---|
47 | IN R0, (MouseGetPosX)
|
---|
48 | SET R1, MousePosX
|
---|
49 | ST (R1), R0
|
---|
50 | IN R0, (MouseGetPosY)
|
---|
51 | SET R1, MousePosY
|
---|
52 | ST (R1), R0
|
---|
53 | POP R1
|
---|
54 | POP R0
|
---|
55 | RETI
|
---|
56 |
|
---|
57 | InterruptHandlerKeyboard:
|
---|
58 | RETI
|
---|
59 |
|
---|
60 | HelloWorld: .db "Hello world", 0
|
---|
61 |
|
---|
62 | .include Graphics.asm
|
---|
Note:
See
TracBrowser
for help on using the repository browser.