OpenCores
URL https://opencores.org/ocsvn/6809_6309_compatible_core/6809_6309_compatible_core/trunk

Subversion Repositories 6809_6309_compatible_core

[/] [6809_6309_compatible_core/] [trunk/] [sim/] [instructions_test.asm] - Blame information for rev 13

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 ale500
 
2
; simple instruction excerciser
3 5 ale500
 
4
                ldd     #$AABB
5 6 ale500
                mul
6 5 ale500
                ldx     #$1234
7
                ldy     #$5678
8 7 ale500
                exg     a,b
9
                ;exg    a,x
10
                exg     y,x
11 5 ale500
                tfr     x,u     ; 16 bit transfer
12
                tfr     a,u     ; high to high
13
                tfr     b,u
14
                tfr     x,a     ; gets high byte
15
                tfr     x,b     ; gets low byte
16 7 ale500
                bra     eatests
17
addr:           fcb     0, 4    ; an address
18 5 ale500
 
19 7 ale500
eatests:        lda     #$02
20 4 ale500
                ldb     #$00
21
                sta     $0
22
                stb     $1
23
                ldx     $0      ; load saved value
24
                ldy     #$0
25
                cmpx    ,y      ; compare
26
                beq     test_push_pull
27
 
28
error:          bra     error
29
 
30
test_push_pull: lds     #$00ff
31
                pshs    a,b
32
                puls    x
33
                cmpx    ,y      ; compare again
34
                bne     error
35
 
36
                bsr     test_bsr
37
                bne     error   ; push/pull with sub don't work
38
                lbsr    test_lea
39
                bne     error
40
ok:             bra     ok
41
 
42
test_bsr:       pshs    y
43
                puls    y
44
                cmpx    0,y
45
                rts
46
 
47
test_lea:       leau    1,y
48
                leay    0,y
49
                rts
50 7 ale500
 
51
_boot:          ldx     #100
52
_loop0:         ldd     #$4100
53
_loop1:         sta     b,x
54
                incb
55
                cmpb    #16
56
                bne     _loop1
57
                inca
58
_loop2:         incb
59
                bne     _loop2  ; delay
60
                cmpa    #128
61
                beq     _loop1  ; another row of characters
62
                bra     _loop0
63
 
64
 
65
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.