Hi, Why do I get multiple base registers not allowed error with this (.if bl != 48) ?

	mov i,0
	.while i<=3
		mov bl,byte ptr 
		.if bl != 48                   ;error
			sub al,48
		.endif
		shl ebx,8
	.endw
OK, I found out (by excluding one line after another) that you can't add a variable to buffer. So how is it done instead ? This message was edited by goofee, on 5/25/2001 4:02:56 PM
Posted on 2001-05-25 15:48:00 by goofee
   mov edx,0  ;xor edx,edx  ;this works, too
   .while edx<=3
      mov bl, byte ptr 
      .if bl != 48                   ;error
         sub al,48
      .endif
      shl ebx,8
   .endw
This is one possible solution - replace i with edx. I can't help but to think that there is a piece of code missing here - as in it's current state, it will loop forever. :) i/edx isn't changing. If i/buffer are local varibles, then remember that they are offsets from EBP. Anyhow, the move instruction doesn't allow a memory access within the address calculation of the memory access. :D Hope that isn't as confusing as it sounds. :D This message was edited by bitrake, on 5/25/2001 5:57:39 PM
Posted on 2001-05-25 17:30:00 by bitRAKE
Sure is. But I guess I got it now ( after looking up what ebp holds in Exagone's tutorial :D ). Thanks for now. I'll try this now but I think I will run into further problems 'cause I tried some alternatives in between - like copying the buffer to ebx and substracting 48 off of each byte in it to get the right value from ascii - it just wouldn't come out right. So for now: Thanks,later.
Posted on 2001-05-25 18:54:00 by goofee