Mercurial > repos > simple16
annotate vint.s16 @ 48:9a3b9d86dabf
Implement push and pop
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 30 Aug 2016 21:27:33 -0700 |
parents | 083347ccd508 |
children | 03177ff78094 |
rev | line source |
---|---|
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 ldim vectors, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 setvbr r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 ;current color value |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 ldim 0, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 ;color increment |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 ldim $11, r3 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 ldimh $1, r3 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 ;color max |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 ldim $FF, r5 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 ldimh $F, r5 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 ;counter |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 ldim 1, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 ;Palette RAM address |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 ldim 0, r1 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 ldimh $FF, r1 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 ;enable interrupt |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 ori 2, sr |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 ;enable display |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 ldim 0, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 ldimh $80, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 outi $D, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 wait |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 bra wait |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 ;shouldn't get here, disable display so it's clear something broke |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 ldimh $0, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 outi $D, r2 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 bra wait |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 vectors: |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 dc.w 0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 dc.w vint_handler |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 vint_handler |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 addi -1, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 bne done |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 outi $E, r1 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 outi $F, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 cmp r0, r5 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 beq down |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 resume |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 add r3, r0, r0 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 beq up |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 ldim 5, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 done |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 reti r13 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 down |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 ldim $EF, r3 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 ldimh $FE, r3 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 bra resume |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 up |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 ldim $11, r3 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 ldimh $1, r3 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 ldim 5, r4 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 reti r13 |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 |