阅读:1247回复:0
为什么I/O memory的值都是0xF2A0啊
写了一个小程序,用到portw,portr指令。build,load后,查看I/O memory的值,结果所有的i/o memory都是0xF2A0。只是软仿,是不是对于portw,portr两条指令得要硬仿啊。
程序如下 .mmregs PA0 .set 4000h PA1 .set 8000h PA2 .set 0F000h .global sstart .text sstart: STM #7000H,SWWSR STM #0100h,AR4 ;ar4 as the data STM #0101h,AR5 ST #0D500h,*AR5 ;ar5 as the high level STM #0102h,AR6 ST #8000h,*AR6 ;ar6 as the low level PORTW *AR6,PA2 * PORTW *AR6,PA1 WAIT XC 2,NBIO B READ B WAIT READ PORTR PA0,*AR4 ANDM #1,*AR4 LD *AR4,A NOP NOP NOP NOP NOP XC 2,ANEQ B OUT1 B OUT0 OUT1 NOP PORTW *AR5,PA1 * PORTW *AR5,PA2 B WAIT OUT0 NOP PORTW *AR6,PA1 * PORTW *AR6,PA2 B WAIT |
|