home *** CD-ROM | disk | FTP | other *** search
- !
- ! test addition/subtraction insns
- !
- ! add
- mov 123,%o1
- mov 456,%o2
- add %o1,%o2,%o3
- cmp %o3,579
- bne,a .+0x8
- unimp 0
- add %o1,789,%o3
- cmp %o3,912
- bne,a .+0x8
- unimp 0
- mov -456,%o0
- add %o1,%o0,%o3
- cmp %o3,-333
- bne,a .+0x8
- unimp 0
- add %o0,-321,%o3
- cmp %o3,-777
- bne,a .+0x8
- unimp 0
- ! addcc
- addcc %o1,%o2,%g0
- be,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- addcc %o1,-123,%g0
- bne,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- set 0x7fffffff,%l1
- addcc %l1,%l1,%g0
- be,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bpos,a .+0x8
- unimp 0
- set 0x80000001,%l2
- addcc %l2,%l2,%g0
- be,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- ! addx
- addx %o1,1,%o3
- cmp %o3,125
- bne,a .+0x8
- unimp 0
- addx %o1,1,%o3
- cmp %o3,124
- bne,a .+0x8
- unimp 0
- ! addxcc
- addxcc %o1,%o2,%g0
- be,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- addxcc %o1,-123,%g0
- bne,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- set 0x7fffffff,%l1
- addxcc %l1,%l1,%g0
- be,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bpos,a .+0x8
- unimp 0
- set 0x80000001,%l2
- addxcc %l2,%l2,%g0
- be,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- subcc %g0,1,%g0
- addxcc %l1,%g0,%g0
- bvc,a .+0x8
- unimp 0
- ! sub
- sub %o1,%o2,%o3
- cmp %o3,-333
- bne,a .+0x8
- unimp 0
- sub %o1,788,%o3
- cmp %o3,-665
- bne,a .+0x8
- unimp 0
- mov -456,%o0
- sub %o1,%o0,%o3
- cmp %o3,579
- bne,a .+0x8
- unimp 0
- sub %o0,-321,%o3
- cmp %o3,-135
- bne,a .+0x8
- unimp 0
- ! subcc
- subcc %o1,%o2,%g0
- be,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bpos,a .+0x8
- unimp 0
- subcc %o1,123,%g0
- bne,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- set 0x7fffffff,%l1
- set 0x80000001,%l2
- subcc %l1,%l2,%g0
- be,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bpos,a .+0x8
- unimp 0
- subcc %l2,%l1,%g0
- be,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- ! subx
- cmp %g0,-1
- subx %o1,1,%o3
- cmp %o3,121
- bne,a .+0x8
- unimp 0
- subx %o1,1,%o3
- cmp %o3,122
- bne,a .+0x8
- unimp 0
- ! subxcc
- subxcc %o1,%o2,%g0
- be,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bpos,a .+0x8
- unimp 0
- subxcc %o1,122,%g0
- bne,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvs,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- set 0x7fffffff,%l1
- set 0x80000001,%l2
- subxcc %l1,%l2,%g0
- be,a .+0x8
- unimp 0
- bcc,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bpos,a .+0x8
- unimp 0
- subxcc %l2,%l1,%g0
- be,a .+0x8
- unimp 0
- bcs,a .+0x8
- unimp 0
- bvc,a .+0x8
- unimp 0
- bneg,a .+0x8
- unimp 0
- subcc %g0,1,%g0
- subxcc %l2,1,%g0
- bvc,a .+0x8
- unimp 0
- ! taddcc
- taddcc %g0,1,%g0
- bvc,a .+0x8
- unimp 0
- taddcc %l1,%g0,%g0
- bvc,a .+0x8
- unimp 0
- !
- ! setup SIGEMT signal handler for taddcctv
- !
- set sigtramp,%o1
- set sv1,%o0
- st %o1,[%o0] ! init sigvec struct
- mov %o0,%o1
- clr %o2
- mov 7,%o0
- mov 0x6c,%g1 ! sigvec system call
- ta 0
- ! taddcctv
- taddcctv %g0,1,%g0
- unimp 0
- taddcctv %l1,%g0,%g0
- unimp 0
- ! tsubcc
- tsubcc %g0,1,%g0
- bvc,a .+0x8
- unimp 0
- tsubcc %l1,%g0,%g0
- bvc,a .+0x8
- unimp 0
- ! tsubcctv
- tsubcctv %g0,1,%g0
- unimp 0
- tsubcctv %l1,%g0,%g0
- unimp 0
-
- exit:
- mov 1,%g1
- clr %o0
- ta 0
- nop
-
-
- .seg "bss"
- sv1:
- .skip 0xc
- !
- ! handler skips 2 insns and returns
- !
- .seg "text"
- handler:
- ld [%o2+0xc],%l0 ! return pc
- ld [%o2+0x10],%l1 ! return npc
- inc 8,%l0
- inc 8,%l1
- st %l0,[%o2+0xc]
- st %l1,[%o2+0x10]
- retl
- nop
-
- !
- ! sigtramp sets up arguments for and calls the user handler,
- ! which is assumed not to touch the fp regs
- !
- .seg "text"
- sigtramp:
- save %sp,-128,%sp ! protect ins, locals
- mov %y,%l0
- st %l0,[%sp+0x60]
- std %g6,[%sp+0x68]
- std %g4,[%sp+0x70]
- std %g2,[%sp+0x78]
- ld [%fp+0x40],%o0 ! sig
- ld [%fp+0x44],%o1 ! code
- ld [%fp+0x48],%o2 ! sigcontext ptr
- set handler,%g1
- call %g1 ! user's handler
- ld [%fp+0x4c],%o3 ! faulty addr
- ld [%sp+0x60],%l0
- mov %l0,%y
- ldd [%sp+0x68],%g6
- ldd [%sp+0x70],%g4
- ldd [%sp+0x78],%g2
- ld [%fp+0x48],%i0 ! will be %o0 after restore
- mov 0x8b,%g1 ! return to sigcontext syscall
- restore ! regs restored (expect %o0)
- ta 0
-