ec2-18-219-158-84.us-east-2.compute.amazonaws.com , 109902nd | 1999/09/07 UPDATED |
% ./configure --prefix=/usr/local --target=h8300-hms % make % make installとかやって、インストールする。
% ./configure --prefix=/usr/local --target=h8300-hms --exec-prefix=/usr/local % make % make install
% ./configure --prefix=/usr/local --target=h8300-hms --exec-prefix=/usr/local % make % make install
% ./configure --prefix=/usr/local --target=h8300-hms --exec-prefix=/usr/local % make % make installメークはほかのGNUツールと一緒だ。
[monitor.subの内容] INPUT ADVANCED,MONITOR INPUT CMD01,CMD02,CMD03,CMD04,CMD05,CMD06,CMD07,CMD08,CMD09,CMD10 INPUT CMD11,CMD12,CMD13,CMD14,CMD15,CMD16,CMD17,CMD18,CMD19,CMD20 INPUT CMD21,CMD22,CMD23,CMD24,CMD25,CMD26,CMD27,CMD28,CMD29,CMD30 INPUT CMD31,CMD32,CMD33,CMD34,CMD35,CMD36,CMD37,CMD38,CMD39,DMY40 INPUT cpu01,cpu02,cpu03,cpu04,cpu05 INPUT mod01,mod02,mod03,mod04,mod05,mod06,mod07,mod08,mod09,mod10 INPUT mod11,mod12,mod13,mod14,mod15,mod16,mod17,mod18,mod19,mod20 INPUT mod21,mod22,mod23,mod24,mod25,mod26,mod27,mod28,mod29,mod30 INPUT mod31,mod32,mod33,mod34,mod35, mod37,mod38,mod39 DEFINE $BRR(03) DEFINE $STACK(0800000) PRINT MONITOR.MAP OUTPUT MONITOR.ABS START VECTOR(0),ROM(200),RAM(0FFF710),USER(0600000),SCI(0FFFFB8) EXIT
[cmd24.srcの変更] 100: BNE ERR11 ; Check Sum Error (旧) 100: BRN ERR11 ; Ignore Check Sum Error (改)
MODE | ADDR PIN | A20 | A19 | A18 | A17 | A10 | A9 | A8 | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
M9/~M8 = 0 | ROW | A20 | A19 | A18 | A17 | A10 | A9 | A8 | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | |
COLUMN | A20 | A19 | A18 | A17 | A10 | A9 | A9 | A16 | A15 | A14 | A13 | A12 | A11 | A10 | A0 | ||
HM5116160 | A11 | A10 | A9 | A8 | - | - | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | - | ||
M9/~M8 = 1 | ROW | A20 | A19 | A18 | A17 | A10 | A9 | A8 | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | |
COLUMN | A20 | A19 | A18 | A17 | A10 | A18 | A17 | A16 | A15 | A14 | A13 | A12 | A11 | A10 | A0 | ||
HM5118160 | A9 | - | - | - | A8 | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | - | |||
M9/~M8 = 1 | ROW | A20 | A19 | A18 | A17 | A10 | A9 | A8 | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | |
COLUMN | A20 | A19 | A18 | A17 | A10 | A18 | A17 | A16 | A15 | A14 | A13 | A12 | A11 | A10 | A0 | ||
HM5117800 | A9 | - | - | - | A8 | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | A10 |
% h8300-hms-gcc -mh -mrelax -T ~/ldscripts/aki-h8.x foo.c
; PA.DR.BYTE = 0x01 fa 01 mov.b #0x1,r2l 6a aa 00 ff ff d3 mov.b r2l,@0xffffd3:32
fa 01 mov.b #0x1,r2l 3a d3 mov.b r2l,@0xd3:8
C source | assembler out |
---|---|
int i; main() { asm("trapa #0"); } #pragma interrupt void int_trap0() { i++; } |
| _int_trap0: push.l er6 mov.l er7,er6 push.l er5 push.l er4 push.l er3 push.l er2 push.l er1 push.l er0 mov.w @_i,r3 mov.w r3,r2 adds #1,er2 mov.w r2,r3 mov.w r3,@_i .L2: pop.l er0 pop.l er1 pop.l er2 pop.l er3 pop.l er4 pop.l er5 pop.l er6 rte |
(gdb) x/16 0x600000 0x600000: 0x00600200 0x00600200 0x00600200 0x00600200 0x600010: 0x00600200 0x00600200 0x00600200 0x00600200 0x600020: 0x00600236 0x00600200 0x00600200 0x00600200 0x600030: 0x00600200 0x00600200 0x00600200 0x00600200 (gdb) disass 0x600236 Dump of assembler code for function int_trap0: 0x600236 <int_trap0>: 01 00 6d f6 mov.l er6,@-er7 0x60023a <int_trap0+4>: 0f f6 mov.l er7,er6 0x60023c <int_trap0+6>: 01 00 6d f5 mov.l er5,@-er7 0x600240 <int_trap0+10>: 01 00 6d f4 mov.l er4,@-er7 0x600244 <int_trap0+14>: 01 00 6d f3 mov.l er3,@-er7 0x600248 <int_trap0+18>: 01 00 6d f2 mov.l er2,@-er7 0x60024c <int_trap0+22>: 01 00 6d f1 mov.l er1,@-er7 (後略)ほらね。
[ソースリスト] #define BITSET(a, b) asm("bset.b %0, @%c1:8" ::"g" (b), "g" (a) ) #define BITCLR(a, b) asm("bclr.b %0, @%c1:8" ::"g" (b), "g" (a) ) #define BITTST(a, b) ({char __ccr; asm("btst.b %1, @%c2:8\n\tstc ccr, %0l\n\tand.b #4:8, %0l" : "=r" (__ccr) : "g" (b), "g" (a) : "r0" ); __ccr; }) main(){ char i; BITSET( 0xd3, 6); i = BITTST( 0xd3, 6); } [逆アセンブル結果] 0x60024a: 7f d3 70 60 bset #0x6,@0xd3:8 0x60024e : 7e d3 73 60 btst #0x6,@0xd3:8 0x600252 : 02 08 stc ccr,r0l 0x600254 : e8 04 and.b #0x4,r0l 0x600256 : 6e e8 ff fe mov.b r0l,@(0xfffe:16,er6)
% h8300-hms-gcc -mh -mrelax -Xlinker -M foo.c >& output.map
% h8300-hms-gdb a.out (gdb) set machine h8300h ; ターゲットは H8/300H (gdb) set remotebaud 38400 ; 通信速度は 38,400bps (gdb) target hms /dev/cua0 ; 通信ポートは COM0 Remote target hms connected to /dev/cua0 0x600200 in start () (gdb) load ; 実行ファイルをダウンロード .vectors : 0x00600000 .. 0x006000f4 .text : 0x00600200 .. 0x00601f94 .tors : 0x00601f94 .. 0x00601f94 .data : 0x00601f94 .. 0x0060265c .stack : 0x007ffffc .. 0x00800000 Transfer rate: 9556 bits/sec. (gdb) run ; 実行とかやって、aki-h8と通信させよう。
-- LINK FREE -- |
||
HOME | LAST |