flat assembler
Message board for the users of flat assembler.
Index
> Main > C to Asm |
Author |
|
gorshing 15 Mar 2004, 14:52
I believe that a long is only four bytes long, so I would change n, ln, rn, leftbegin, leftend, rightbegin, rightend to dword. An easy way to check that would be to output sizeof(long) from a C program.
And Code: mov eax, [window_p] Should be Code: mov [eax], [window_p] Or am I wrong? _________________ gorshing |
|||
15 Mar 2004, 14:52 |
|
jInuQ 15 Mar 2004, 18:57
yeah, a long on my box is 4.
This is how I understand the whole braket thing with regard to registers. Am I confused? Code: ;This moves 15 to eax mov eax, 15 ; And this moves the dword pointed to by eax to ecx mov [ecx], [eax] _________________ jInuQ "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint Exupery |
|||
15 Mar 2004, 18:57 |
|
roticv 15 Mar 2004, 19:33
It is not possible to move from memory to memory...
|
|||
15 Mar 2004, 19:33 |
|
vid 15 Mar 2004, 20:13
did you check my tuts? There are answers on some of your questions
http://board.flatassembler.net/topic.php?t=1178 |
|||
15 Mar 2004, 20:13 |
|
jInuQ 16 Mar 2004, 08:09
My problem is not moving from memory to memory. As this is not what I am tring to do. I am trying to copy the address of the two pointers in the window_p array.
Code: ; Is this what I am looing for? mov eax, [window_p] mov ecx, [window_p+4] _________________ jInuQ "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint Exupery |
|||
16 Mar 2004, 08:09 |
|
aaro 16 Mar 2004, 10:08
window_p is pointer to table of to pointers, am i right?
So you have to do it like this: Code: mov eax, [window_p] mov ecx, [eax+4] mov eax, [eax] Now eax has value of the first pointer and ecx has the second. Now to modify memory the pointers are pointing to: Code: mov [eax], 1 mov [ecx], 2 |
|||
16 Mar 2004, 10:08 |
|
jInuQ 16 Mar 2004, 17:17
Sounds right. Thanks for the help. 8^)
_________________ jInuQ "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint Exupery |
|||
16 Mar 2004, 17:17 |
|
Matrix 27 Oct 2004, 13:01
roticv wrote: It is not possible to move from memory to memory... yess? why not? Code: org 256 push es push ds pop es mov dx,msg mov ah,9 int 21h mov di,chgstring mov si,string2 mov cx,length_string2 call movestring2string int 21h pop es int 20h movestring2string: ; ds:si > es:di , cx = count rep movs byte [es:di],byte [ds:si] ; alternatively : movsb ret msg: db 'Hello World!' chgstring:db 'Is it possible to move string 2 string?',13,10,'$' string2: db 'It is possible to move string 2 string!',13,10,'$' endstring2: length_string2 dw endstring2-string2 |
|||
27 Oct 2004, 13:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.