These following codes make an error... but i dunno why it did.. :(
plz, check up.



_declspec(naked) static void Halp_IRQ_SystemTimer(void)
{
static unsinged int cnt = 0;
static char ch[]={'-', '|'};
_asm {
pushad

inc cnt
cmp cnt, 2
jb next
mov cnt, 0

next:
mov ebx, ch ; <=== error!
add ebx, cnt
mov al, [ebx]
mov ebx, 0b8000h+(80-1)*2
mov [ebx], al

mov al, 20h
out 20h, al

popad
iretd
}
}


At "mov ebx, ch" line, i want to store the address of ch(array) into ebx register.
But, VC compiler makes an error message saying "size is not equal".... why..??
"mov ebx, dword ptr " or "mov ebx, dword ptr ch" also makes a same error....
how can i do that..??? how can i store "ch array's address"..???

help me.. give me a hint..
thank you for reading..
regards..
Posted on 2003-08-19 04:18:46 by Yeori
Probably you were thinking in C and forgot CH is high byte of CX. :)
Posted on 2003-08-19 05:50:44 by Starless
MOV transfers VALUES
use LEA instead
Posted on 2003-08-19 06:05:08 by S.T.A.S.
try
movzx ebx, ch
Posted on 2003-08-19 06:24:04 by roticv
Thank you all guys. :)

I found a bug & fixed it~
You guys make me happy. :grin:

Have a nice day!
Posted on 2003-08-19 06:38:14 by Yeori