================start16.s================
#define BOOT_SEG 0xffff0000 /* linear segment of boot code */
#define a32 .byte 0x67;
#define o32 .byte 0x66;
.section .start16, "ax"
.code16
.globl start16
start16:
/* First we let the BSP do some early initialization
* this code have to map the flash to its final position
*/
mov $board_init16_ret, %bp
jmp board_init16
================sc520_cdp_asm16.s================
/*
* 16bit initialization code.
* This code have to map the area of the boot flash
* that is used by U-boot to its final destination.
*/
/* Set ds to point to MMCR alias */
movw $0xdf00, %ax
movw %ax, %ds <-----DS段寄存器指向0xdf000(映射后的MMCR起始地址)
/* Map the entire flash at 0x38000000
* (with BOOTCS and PAR14, use 0xabfff800 for ROMCS1) */
movl $0xc0, %edi
movl $0x8bfff800, %eax
movl %eax, (%di) <------这里应该是想将MMCR中偏移地址0xc0的寄存器赋值为0x8bfff800。前面将DS赋了值,但并没有看见对ES的赋值操作。用DI就指飞了~~ 印象中EDI是配合ES使用的吧。
1. 芯片手册中描述,ES的默认值是不确定的(Undefined)。
2. 芯片手册中描述,EDI/DI只能配合ES使用。The DI register can only point to operands in the
memory space specified by the ES segment register.
3. 好几个版本的U-BOOT代码都是这样。