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 6

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
                tfr     x,u     ; 16 bit transfer
9
                tfr     a,u     ; high to high
10
                tfr     b,u
11
                tfr     x,a     ; gets high byte
12
                tfr     x,b     ; gets low byte
13
 
14
 
15 4 ale500
                lda     #$02
16
                ldb     #$00
17
                sta     $0
18
                stb     $1
19
                ldx     $0      ; load saved value
20
                ldy     #$0
21
                cmpx    ,y      ; compare
22
                beq     test_push_pull
23
 
24
error:          bra     error
25
 
26
test_push_pull: lds     #$00ff
27
                pshs    a,b
28
                puls    x
29
                cmpx    ,y      ; compare again
30
                bne     error
31
 
32
                bsr     test_bsr
33
                bne     error   ; push/pull with sub don't work
34
                lbsr    test_lea
35
                bne     error
36
ok:             bra     ok
37
 
38
test_bsr:       pshs    y
39
                puls    y
40
                cmpx    0,y
41
                rts
42
 
43
test_lea:       leau    1,y
44
                leay    0,y
45
                rts

powered by: WebSVN 2.1.0

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