flat assembler
Message board for the users of flat assembler.
Index
> DOS > TASM -> FASM syntax question. |
Author |
|
revolution 02 Jun 2008, 09:15
Sure you can, just remove the word "offset".
|
|||
02 Jun 2008, 09:15 |
|
FASMresearcher 02 Jun 2008, 10:06
Great thanks!
|
|||
02 Jun 2008, 10:06 |
|
DOS386 02 Jun 2008, 23:29
> want to generate tables during code execution and append them to the end
Of what ? _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
02 Jun 2008, 23:29 |
|
SFeLi 03 Jun 2008, 05:18
Code: begin: ........ ;end begin table_1 rb 0x0300 table_2 rb 0x0100 table_3 rb 0x???? |
|||
03 Jun 2008, 05:18 |
|
Picnic 10 Apr 2010, 20:15
Good evening,
I would like to ask a question. How such TASM declarations translated in fasm syntax. Code: mystruc struc string db 20 dup (0h) n db 0h mystruc ends table mystruc <'One',const1> mystruc <'Two',const2> mystruc <'Three',const3> mystruc <0> Is it like this? (un-elegant) Code: table db 'One' db 17 dup 0, const1 db 'Two' db 17 dup 0, const2 db 'Three' db 16 dup 0, const3 db 0 |
|||
10 Apr 2010, 20:15 |
|
shutdownall 10 Apr 2010, 20:58
I think there is an error.
Three has 5 characters so your constant should be 15 instead of 16. Better to use a macro I think. Code: macro myTASMmacro data,constx { local cnt1,cnt2 cnt1: db data cnt2: db count-(cnt2-cnt1) dup 0 db constx } ; and then use table myTASMmacro 'One',const1 myTASMmacro 'Two',const2 myTASMmacro 'Three',const3 db 0 |
|||
10 Apr 2010, 20:58 |
|
nop 10 Apr 2010, 21:37
revolution wrote: Sure you can, just remove the word "offset". or keep the TASM syntax but add Code: offset equ |
|||
10 Apr 2010, 21:37 |
|
Picnic 11 Apr 2010, 00:26
shutdownall wrote: Better to use a macro I think. Yes, a macro can do the job easy. Fasm syntax is very close to Tasm ideal mode, that is a feature i always like in fasm. |
|||
11 Apr 2010, 00:26 |
|
baldr 11 Apr 2010, 01:42
shutdownall,
That won't compile. myTASMmacro macro name would not be recognized as its invocation if it is second token on the line (not counting label_name: definitions), because it's macro macro . Use struc macro and make macro thunk: Code: struc mystruc string, n { .string db string db .string+20-$ dup 0 .n db n+0 } macro mystruc string, n { local . . mystruc string, n } table mystruc 'One',const1 mystruc 'Two',const2 mystruc 'Three',const3 mystruc 0 ---------- Picnic, Basic headers contain struct macro: Code: include "Win32A.Inc" struct mystruct string db 20 dup 0 n db 0 ends table2 mystruct 'One',const1 mystruct 'Two',const2 mystruct 'Three',const3 mystruct 0 |
|||
11 Apr 2010, 01:42 |
|
Picnic 11 Apr 2010, 13:17
It does baldr, and this way it declares sizeof. automatically, i omit that.
|
|||
11 Apr 2010, 13:17 |
|
shutdownall 11 Apr 2010, 21:17
baldr wrote: shutdownall, You are right, i forgot ":" after table and count has to be replaced by constant 20. But your solution is more elegant, I think. |
|||
11 Apr 2010, 21:17 |
|
monk 15 Mar 2011, 06:34
I've a question how to translate that code[tasm] in fasm:
MOV AH,0AH LEA DX,NAMEPAR INT 21H mov ah,9 mov dx, NAMEFLD int 21h ;------------------------------------------------------- NAMEPAR LABEL BYTE MAXLEN DB 20 ACTLEN DB ? NAMEFLD DB 20 DUP (?) |
|||
15 Mar 2011, 06:34 |
|
Picnic 15 Mar 2011, 14:06
Hi,
Try this, and also check daluca's post here Code: ORG 100H MOV AH,0AH MOV DX,NAMEPAR INT 21H MOV AH,9 MOV DX, NAMEFLD INT 21H RET NAMEPAR: MAXLEN DB 20 ACTLEN DB ? NAMEFLD DB 20 DUP ("$") |
|||
15 Mar 2011, 14:06 |
|
monk 16 Mar 2011, 05:59
Thank you very much !
|
|||
16 Mar 2011, 05:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.