... or questions.
1. What registers can I use in PB3.94/PB4 without worrying about PB trying to use them internally at the same time? Like, can I freely modify ecx in a procedure without worrying that PB will also try to use it? I've had some instances of that happening but I can't remember which register(s) it was.
2. Are there any good books (reference or tutorials) on programming in ASM. Something that can be geared towards FASM. Although I suspect ASM compilers are *somewhat* similar. Are there any "bibles" that I should look into?
Any other general ASM tips, tricks or whatnot would also be appreciated. I've dabbled a little bit but it's really basic stuff. I'd be especially curious about string handling stuff.
3. Almost forgot about this one. How can I create a "variable" in ASM in PB? I use the "!" rather than inline if that makes any difference.
Thanks!
ASM Question
1.
3.remi_meier wrote:Eax, Ecx, Edx should be available.
Code: Select all
;example use
n.l
m.l
k.w
d.d
! fld tword [a]
! fld qword [b]
! fstp qword [v_d]
! mov eax,dword [c]
! mov [v_n],eax
! mov ax,word [d]
! cwde ;convert word in eax to dword
! mov [v_m],eax
! mov al,byte [e]
! cbw ;convert byte in al to word in ax
! mov [v_k],ax
Debug n
Debug m
Debug k
Debug d
End ;put an end so program wont't run into data section
!section '.data' code readable writeable
!a: dt 6.938827757238428549483e-9 ;80 bit real
!b: dq 0.57823984700423848847388532e-11 ;double
!c: dd 123 ;long integer (32 bits)
!d: dw 456 ;word integer (16 bits)
!e: db 78 ;byte (8 bits)
2
In general, which will help with doing inline:
iczelion's tutorials at http://win32assembly.online.fr/ - masm - His is probably the most used set of tutorials and samples available. Very good stuff. Tons of great links as well.
If you can find Randy Hyde's original (versus his HLA) Art of Assembly Language, that was awesome. The HLA version is good but biased towards HLA. Randy Hyde's stuff here: http://webster.cs.ucr.edu/
These and the boards at fasm and www.masmforum.com should cover most things. Lots of similarities fasm to masm, it is the differences that sneak up and bite you.
In general, which will help with doing inline:
iczelion's tutorials at http://win32assembly.online.fr/ - masm - His is probably the most used set of tutorials and samples available. Very good stuff. Tons of great links as well.
If you can find Randy Hyde's original (versus his HLA) Art of Assembly Language, that was awesome. The HLA version is good but biased towards HLA. Randy Hyde's stuff here: http://webster.cs.ucr.edu/
These and the boards at fasm and www.masmforum.com should cover most things. Lots of similarities fasm to masm, it is the differences that sneak up and bite you.
@}--`--,-- A rose by any other name ..
I agree!Xombie wrote:In a way, it seems simpler than C to me.
I'm no expert but I can get things happening in masm - I have yet to get anything decent happening in any C implementation. Some C's I can't even understand the development environment.
One reason I prefer PureBasic uber alles - I understand how to actually write and compile something, however crappy my code may be!
@}--`--,-- A rose by any other name ..

