comparison lib/alib/sho_regs.a @ 2474:7d70b7e1cb21

Moved net and alib files into here
author boisy
date Tue, 30 Mar 2010 02:44:42 +0000
parents
children aaba193af04f
comparison
equal deleted inserted replaced
2473:dac1ff96637f 2474:7d70b7e1cb21
1 ************************************
2
3 * Display the 6809 registers to standard error
4
5 * OTHER MODULES NEEDED: BIN2HEX, BIN_HEX, PUTS
6
7
8 * ENTRY: none
9 * EXIT: none
10
11
12 * NOTE: The value used for PC is that of the calling routine
13 * S is assumed to be 2 greater than actual to comp for
14 * the subroutine call...
15
16
17 nam Show Register Values
18 ttl Assembler Library Module
19
20
21 psect SHO_REGS,0,0,0,0,0
22
23 csect
24
25 count rmb 1 counter for 9 regs.
26 buffer rmb 8 buffer for ascii strings
27 cc.r rmb 1 offsets to access values
28 a.r rmb 1
29 b.r rmb 1
30 dp.r rmb 1
31 x.r rmb 2
32 y.r rmb 2
33 u.r rmb 2
34 s.r rmb 2
35 pc.r rmb 2
36
37 endsect
38
39 SHO_REGS:
40 leas -2,s room for copy of <S>
41 pshs cc,a,b,dp,x,y,u save rest
42 leas -cc.r,s room for ascii strings
43 tfr s,x
44 leax pc.r,x get old <S>
45 stx s.r,s stick on stack
46 leay cc.r,s point to regs
47 leau text,pcr register names
48 clr count,s int. counter
49
50 * now we loop and display all the registers
51
52 loop1
53 leax buffer,s point to ascii buffer
54 ldd ,u++ get reg. name
55 std ,x++
56 lda #'= add a "="
57 sta ,x+
58 lda count,s 1st 4 are 1 byte
59 cmpa #4
60 bhs loop2 no, do a 2byte
61 ldb ,y+ get single value
62 lbsr BIN2HEX
63 std ,x save ascii number
64 clr 2,x
65 bra report go report
66 loop2
67 cmpa #9 done all?
68 bhs exit yes, go home
69 ldd ,y++ get reg value
70 lbsr BIN_HEX convert it
71
72 * report reg. value
73
74 report
75 leax buffer,s start of buffer
76 lda #2 std err
77 lbsr FPUTS print it
78 ldb #$20 space
79 lbsr FPUTC
80 inc count,s do next reg
81 bra loop1
82
83 exit
84 ldb #$0d
85 lda #2
86 lbsr FPUTC start new line
87 leas cc.r,s clear up stack
88 puls cc,a,b,dp,x,y,u
89 leas 2,s
90 rts go home
91
92 text
93 fcc /cc/
94 fcc / a/
95 fcc / b/
96 fcc /dp/
97 fcc / x/
98 fcc / y/
99 fcc / u/
100 fcc / s/
101 fcc /pc/
102
103 endsect