From c05803edb72e909ffc1730ccd23eccb918781421 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Wed, 10 Sep 2014 15:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=A6=E5=A4=96=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04_day/bootpack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/04_day/bootpack.c b/04_day/bootpack.c index cda3b75..4098857 100644 --- a/04_day/bootpack.c +++ b/04_day/bootpack.c @@ -5,10 +5,10 @@ void HariMain(void) int i; /* 声明变量i,i是32位整数 */ char *p; /* 声明变量p、用于BYTE [...]地址 */ - for (i = 0xa0000; i <= 0xaffff; i++) { - p = (char *)i; - *p = i & 0x0f; - /* 替代write_mem8(i, i & 0x0f); */ + p = (char *) 0xa0000; /* 地址变量赋值 */ + + for (i = 0; i <= 0xffff; i++) { + *(p + i) = i & 0x0f; } for (;;) {