flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 01 Oct 2019, 17:23
It would not work with fasm 1 either, because what you try to do is assemble instruction like:
Code: mov r9, rbp-48 Code: lea r9, [retrieve.sizeRetrieved] The FASTCALL/INVOKE macros (both for fasm and fasmg) provide special prefix ADDR that makes LEA be generated automatically by macro. But when you write your code directly, you need to choose the appropriate instruction yourself. |
|||
![]() |
|
donn 01 Oct 2019, 17:52
OK gotcha..!
Must have confused this in fasm1 with accessing struc member addresses: Code: struc Record label . .allocAddr dq 0 ; Binary or text allocation addr ... .builtLocation dq 0 ; Built Path .handle dq 0 end struc ; Used with address offsets virtual at 0 Record Record end virtual ... mov rbx, [new.handleAllocatedMemory] add rbx, Record.handle mov rax, 0 mov [rbx], rax Specifically this part: Code:
add rbx, Record.handle Your explanation of what the instruction becomes makes sense. Working on a new project with fasmg now by the way, utilizing GoogleTest with great satisfaction. Unit testing helps when I have to work on a project, switch gears, then come back days or weeks later and ensure things are still working. Curious if anyone else uses a test tool also... |
|||
![]() |
|
guignol 02 Oct 2019, 07:16
only donkeys
|
|||
![]() |
|
donn 04 Oct 2019, 15:08
I see where you're coming from, but when refactoring large assembly projects, how do you test out the components to make sure they're still working? Manually? Isn't that donkey work?
I'm certainly not the authority on assembly unit testing, as you can see from this post I ignored a somewhat fundamental stack concept for years and am just now trying to come to terms with it, but I think assembly could take another step towards becoming a professional alternative to C with testing tooling. Especially on collaborative-projects, an aunit could bridge communication and lead to bigger, more stable projects. I tried building a test tool briefly, fasmg seemed like it could perfectly enable and 'discover' test modules, but I'm not good enough at fasmg and was not sure how to hierarchically define test suite namespaces. Conceptually, I definitely prefer the concept of a test harness as 'test driving' the software, instead of as acting like 'guard rails.' The latter makes the author or tool seem less serious or incapable. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.