flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > movv macro |
Author |
|
asmgges 30 Jan 2004, 19:26
3/4 of solution
Code: d equ dword ;;;;;;; movv dword[reg+d],dword[reg+d] movv d[reg+d],d[reg+d] better no ? For many lines of code, it's less tired for fingers Friendly..Gges |
|||
30 Jan 2004, 19:26 |
|
Tomasz Grysztar 30 Jan 2004, 19:51
You can use pushd and popd mnemonics.
|
|||
30 Jan 2004, 19:51 |
|
vid 30 Jan 2004, 20:12
ehm, how often do you move value between two memory variables? Me only very rarely and usualy through some register (and in place where all registers are used i usually dont move much data between two memory variables without modification)
|
|||
30 Jan 2004, 20:12 |
|
asmgges 30 Jan 2004, 20:25
Privalov thanks
I should look at my book of instructions from time to time There is so for a long time that I did not use them that I have forgotten. vid It is just a personal suitability and it is shorter. I do not have to worry if a register is available or not. Friendly..Gges |
|||
30 Jan 2004, 20:25 |
|
Bitdog 09 Feb 2004, 06:21
macro movB op1,op2
{ push byte op2 pop pop op1 } macro movW op1,op2 { push word op2 pop word op1 } macro movD op1,op2 { push dword op2 pop dword op1 } Untested guess ? I'm not sure about PUSH BYTE [VAR] but I've seen it before.... |
|||
09 Feb 2004, 06:21 |
|
vid 09 Feb 2004, 06:31
1. you have error in movB - pop pop
2. push byte [] is allright 3. isn't 'movv dword a1, dword a2' enough? (in fact, isnt writing push/pop without macros enough) |
|||
09 Feb 2004, 06:31 |
|
Bitdog 11 Feb 2004, 09:24
Hello,
1. I got to popping & did know when to be stoppin. 2. Definately untested code ideas. 3. The PUSH POP works for immediates & seg regs where MOV doesn't. 4. I got another big idea...... Today I thought I would try to solve the .asm code size problem. One can't see the forrest through the trees with .asm code. It's so spread out that a screen full doesn't show the goal, it only shows a lot of push pop meaningless move instuction type junk. Yet you can look at & decypher a C code screen for quite a while, & see the full function, from beginning to end. So how does one compress .asm code ? My NC DOS editor allows any char 0-255 to be shown exactly like it is, and it uses CRLF 13,10 for EOL where a .doc editor only uses LF= 10 BUT, Fasm & Nasm allow .doc style code as input. SO, I can group many lines into one line using CTRL+Q+J to make the LF char = 10 I try to get the rows of LF even, then add a comment & CRLF. The lines are grouped according to their function as described by the comment, and by "if they need a label or not". I don't know the full implications of this yet? One down side is my Fasm assembler line errors are different than my editor line count, because it counts each LF=10 character as another line. If there was a newline character in the Fasm assembler, I could group lines like the example below. It takes a bit of getting use to, to read fluently. I like it & use it, but will it stand the test of time ? Example below has 11 lines converted to 4. The message board formatting doesn't allow LF=10 char, so I substuted the | more char. To try it, save as x?, then change the | to LF=10 with Ctrl+Q+J or Ctrl+J ? With your Norton Commander editor It almost looks like 3 instructions per line, makes 3 neat columns of code? Code: isNEAR: LODSW | CMP AX,0x3D00 | JZ doHDR | JB doSMAL ;chk mach code JMP size doBIG: CALL POPSTR | DB "The header is > 64 bytes.",13,10,36 doSMAL: CALL POPSTR | DB "The header is < 64 bytes.",13,10,36 POPSTR: POP DX | MOV AH,9 | INT 21h ; print string adr on stack doHDR: I was going to add a SHIFT+ENTER to my KBD TSR asm editor that added a space,LF=10,space so I could group lines easily. Just some ideas to kick around anyway. Bitdog |
|||
11 Feb 2004, 09:24 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.