flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4, 5, 6 Next |
Author |
|
AsmGuru62 03 Oct 2012, 16:09
Yet using a long labels makes readable code.
Also, a good editor will auto-complete long labels, names, etc. |
|||
![]() |
|
nmake 03 Oct 2012, 23:11
I have a question about optimization. I have a suspicion that jumping with an immediate is faster than jumping to the content of a register because the processor cannot tell what the register contains at the time the jump is done.
like: jmp dword [eax] or jmp immediate which is faster? |
|||
![]() |
|
revolution 04 Oct 2012, 00:22
nmake wrote: which is faster? |
|||
![]() |
|
nmake 07 Oct 2012, 10:58
If I pass a string to a macro call, how can I access character 2 in that string from within the macro?
|
|||
![]() |
|
nmake 07 Oct 2012, 11:00
I don't know if I already asked this, in one situation I understand the difference between rept and repeat but in another situation I don't understand the difference between the two. Maybe it is the purpose I don't understand, in addition you have the times directive. Could anyone (in simple terms) explain the major difference between rept, repeat and times once and for all. I would highly appreciate it, I think other people who are new to fasm will appreciate it also.
I understand that times deals with a single instruction only. |
|||
![]() |
|
revolution 07 Oct 2012, 11:05
rept is a preprocessor directive.
repeat is an assembly time directive. rept uses {} to delimit blocks. repeat uses end repeat to finish blocks. Anyhow it is all in the manual. http://flatassembler.net/docs.php |
|||
![]() |
|
revolution 07 Oct 2012, 11:08
nmake wrote: If I pass a string to a macro call, how can I access character 2 in that string from within the macro? And with the new namespace capability you can also read the string characters outside of the virtual block. |
|||
![]() |
|
nmake 07 Oct 2012, 11:39
The virtual directive is pretty cool. I like how it can be used to load generated code too, quite useful thing to have.
Could you give a specific example of a very simple situation where rept and repeat differs and the difference would matter. Although I now understand the definitive difference, I want to see this difference in a practical sample. Thanks ![]() |
|||
![]() |
|
revolution 07 Oct 2012, 11:58
rept can generate new labels, something that repeat can't do.
repeat can do complex computations and generate bytes for the output, something that rept can't do. It is all tied the to the preprocessor/assembler separation paradigm. |
|||
![]() |
|
nmake 07 Oct 2012, 17:12
Can you give an example of using namespace?
|
|||
![]() |
|
nmake 07 Oct 2012, 18:19
I am confused about local labels in macros. Am I forced to use double-dots?
Code: macro fastmessage [msgstring] { local ..label jmp ..label A=$ db msgstring,0 ..label: invoke MessageBox,[hwnd],A,A,MB_OK } |
|||
![]() |
|
nmake 07 Oct 2012, 22:17
Quite a few questions today. hehe. Why do some programs use this:
Code: somevar dd ? and some programs use Code: somevar rd 1 Isn't both doing the same thing? |
|||
![]() |
|
revolution 08 Oct 2012, 01:53
nmake wrote: Can you give an example of using namespace? nmake wrote: I am confused about local labels in macros. Am I forced to use double-dots? nmake wrote: Quite a few questions today. hehe. Why do some programs use this: Last edited by revolution on 08 Oct 2012, 13:20; edited 1 time in total |
|||
![]() |
|
nmake 08 Oct 2012, 11:46
revolution, I have previously been coding direct3d9 in masm and I had the include files for it but the only include files for d3d9 i've found for fasm i found it in _FASMW64_3-28-2012.zip but it doesn't work if you don't use the entire package at once, which I don't want to do. If I copy the include files from that package into my fasm folder, they contain many inconsistencies and refuse to compile. Do you know where I can find pure and clean d3d9 include and equate files for fasm only? Google is not much help here.
|
|||
![]() |
|
revolution 08 Oct 2012, 13:20
This maybe?
https://encrypted.google.com/search?num=100&as_qdr=all&gbv=1&q=site:board.flatassembler.net%20d3d9 If you posted some code someone might be able to help you to get it working. |
|||
![]() |
|
nmake 08 Oct 2012, 17:07
There were two zip files in that thread, I downloaded both and settled for the zip file called d3d9.zip as it was newer and seem to contain an example which is useful. Tell me if I should use the other one instead because I have no idea what the difference is between the two, they are both created by two different individuals and they seem to contain more or less the same data in the include files.
|
|||
![]() |
|
nmake 08 Oct 2012, 17:38
If you have 2 different kind of work-sets to do in your program. Would you recommend creating 4 new threads for each work-set or do you recommend creating only 4 threads in total and do both work-sets in each thread? Do you recommend creating 4 separate threads for each new work set? When is too many threads too many? When you are done executing one work set, you sleep the threads of course using a mutex or some other synchronization object. But do you recommend creating 16 threads if you have 4 different kind of work-sets?
Assuming you have 4 cores in your processor. |
|||
![]() |
|
nmake 08 Oct 2012, 22:14
I would be happy to also find the include files for d3d9x, the extension library to d3d9, used for loading textures from files, sprites etc.
![]() |
|||
![]() |
|
AsmGuru62 09 Oct 2012, 14:31
What I often see in multi-threading products is the ability to set the number of worker threads
by a command line parameter (or with GUI 'Options' dialog), so it will be flexible and on more cores the product can run with more threads. Obviously, running with a lot of threads on one core is counter productive, because of thread switching overhead. |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4, 5, 6 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.