Archives
It's really a long time since last post. Now I am working on the android mips porting project. I want to run android on the MIPS emulator.
The problem is that when I run mips-android on qemu, it hangs when executing init program in the initramfs root file-system. Then I use the remote gdb to debug [...]
This morning I eventually received my gdium liberty 1000 from zjs express, nearly 5 days after its shipping! Last time I use sf express to ship my mp4 player to Beijing in less than 2 days. I understand, because of the battery stuff can not be shipped by airline, but 5 days is excessive for [...]
I have spent about 1 month in making linux run on onda vx747 and it works now. Although it is a achievement, it's not the end of project jz-hacking.
These days I am always thinking about bringing virtualization into MIPS's world. You know, xen has been ported into ARM by Samsung and kvm into PPC by [...]
ARM和MIPS都是Load-store结构,也就是说CPU只处理寄存器中的数据,而不会直接去处理memory中的数据。要想处理memory中的数据,必须先把memory中的数据load到寄存器中。
那如何load一个32bit的立即数到寄存器中呢?我们知道,ARM和MIPS的指令长度都是32bit,也就是说,不可能用一条指令来直接load一个32bit数据到寄存器中(如果可以的话,数据占了32bit,指令该如何编码?)
ARM中采用了ldr指令来实现这个功能。
LDR {cond} <Rd>,<addressing mode>
ldr 指令将一个memory中的数据load到寄存器Rd中。因此,如果需要load一个32bit立即数的话,先在memory中存放这个数据,然后调用 ldr指令来load这个数据到寄存器中。参考下面的代码中Line3。为了load 0x49020000到r0中,先在地址0x40202428中存入这个立即数,然后在调用ldr将这个数load到寄存器中。
1: 40202418 <serial_getc>:
2: 40202418: e52de004 push {lr} ; (str lr, [sp, #-4]!)
3: 4020241c: e59f0004 ldr r0, [pc, #4] ; 40202428 <serial_getc+0x10>
4: 40202420: eb000042 bl 40202530 <NS16550_getc>
5: 40202424: e49df004 pop [...]
Recent Comments