flat assembler
Message board for the users of flat assembler.
Index
> Windows > moving bytes |
Author |
|
zhak 27 Jun 2006, 10:02
you cannot use 8- or 16-bit registers for addressing.
Try mov cl, byte [hexarray+edx] but don't forget to XOR EDX, EDX at the beginning |
|||
27 Jun 2006, 10:02 |
|
jacko221 27 Jun 2006, 10:46
thanks... that got rid of the "Error: Reserved word used as symbol" but now it gives me this "memory could not be "read"" error. oh well... ill try something different.
Thanks again, Jack |
|||
27 Jun 2006, 10:46 |
|
0x4e71 27 Jun 2006, 17:15
did you zero extend edx
|
|||
27 Jun 2006, 17:15 |
|
jacko221 28 Jun 2006, 00:06
Quote:
I do not understand... im still new to asm. So please help me. |
|||
28 Jun 2006, 00:06 |
|
zhak 28 Jun 2006, 06:29
you should insert
xor edx, edx instruction at the very beginning of your program. Before mov dl, 5 EDX register contains non-zero value when your application starts. You'are using not only DL part of EDX, but the whole register for addressing. That's why higher bytes should be cleared first. 'xor edx, edx' instruction will clear EDX register.[/code] |
|||
28 Jun 2006, 06:29 |
|
jacko221 28 Jun 2006, 08:15
Thanks both for your help... really appreciate it
|
|||
28 Jun 2006, 08:15 |
|
ChrisLeslie 28 Jun 2006, 09:57
zhak
Quote: you should insert Should not "mov edx,5" zero the high bits more easily? Chris |
|||
28 Jun 2006, 09:57 |
|
vid 28 Jun 2006, 10:16
ChrisLeslie wrote: zhak mov edx,5 can be encoded only as mov r32, imm32 eg. with 32bit immediate. that's 2 bytes for mov r32, imm32 and 4 bytes for value of imm32. xor edx, edx takes two bytes, mov dl,5 takes 2 bytes, that's 4 bytes. so you save 2 bytes. in reality, it doen't matter very much in handwritten assembly code, this habit just remained to asm programmmers from old times when resources weren't wasted |
|||
28 Jun 2006, 10:16 |
|
LocoDelAssembly 28 Jun 2006, 17:11
Actually mov edx, imm is 5 bytes (one byte for the opcode "mov edx, imm").
|
|||
28 Jun 2006, 17:11 |
|
0x4e71 28 Jun 2006, 18:24
Yeah, pity there is no movzx r32, imm8
Again, not that it matters that much anymore. The 68000 had MOVEQ imm8,r32 (2 bytes) and SUBQ/ADDQ for values 1-8, these were very very useful, well, back then anyway /L |
|||
28 Jun 2006, 18:24 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.