 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Caelestis Expert Cheater
Reputation: 0
Joined: 03 May 2007 Posts: 153
|
Posted: Tue Nov 18, 2008 7:36 pm Post subject: Can't find a good ASM tutorial |
|
|
Unlike C++ where you could find any tutorial and start regardless of what compiler you have, I can't find an ASM tutorial that fits my needs. I think I would like to use FASM but none of them have the same syntax.
So far I'm just trying to Display all ASCII characters from 1-255 but all I got done was a simple base that won't stop jumping.
| Code: | include '%fasminc%/win32ax.inc'
.data
inchar DB ?
numread DD ?
inh DD ?
outh DD ?
numwrit DD ?
num DB ?
endl DB 0,10,13
.code
main:
invoke AllocConsole
invoke GetStdHandle,STD_INPUT_HANDLE
mov [inh],eax
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov [outh],eax
xor eax, eax
displayascii:
invoke WriteConsole,[outh],'e',1,numwrit,0
invoke WriteConsole,[outh],endl,3,numwrit,0
add eax,1
cmp eax,255
jne displayascii
invoke ReadConsole,[inh],inchar,1,numread,0
invoke ExitProcess,0
.end main |
If you could point me tutorial or recommend me to do something I would be very happy.
|
|
| Back to top |
|
 |
sphere90 Grandmaster Cheater
Reputation: 0
Joined: 24 Jun 2006 Posts: 912
|
Posted: Tue Nov 18, 2008 8:27 pm Post subject: Re: Can't find a good ASM tutorial |
|
|
| Caelestis wrote: | Unlike C++ where you could find any tutorial and start regardless of what compiler you have, I can't find an ASM tutorial that fits my needs. I think I would like to use FASM but none of them have the same syntax.
So far I'm just trying to Display all ASCII characters from 1-255 but all I got done was a simple base that won't stop jumping.
| Code: | include '%fasminc%/win32ax.inc'
.data
inchar DB ?
numread DD ?
inh DD ?
outh DD ?
numwrit DD ?
num DB ?
endl DB 0,10,13
.code
main:
invoke AllocConsole
invoke GetStdHandle,STD_INPUT_HANDLE
mov [inh],eax
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov [outh],eax
xor eax, eax
displayascii:
invoke WriteConsole,[outh],'e',1,numwrit,0
invoke WriteConsole,[outh],endl,3,numwrit,0
add eax,1
cmp eax,255
jne displayascii
invoke ReadConsole,[inh],inchar,1,numread,0
invoke ExitProcess,0
.end main |
If you could point me tutorial or recommend me to do something I would be very happy.  |
Don't use EAX as a counter. This is because most functions (WriteConsole in this case) use EAX as a register to store the return value and that messes up your counter. Therefore, you will get an infinite loop. Besides, use JLE instead of JNE.
|
|
| Back to top |
|
 |
Mindw0rk Newbie cheater
Reputation: 0
Joined: 07 Oct 2007 Posts: 16
|
Posted: Tue Nov 18, 2008 8:50 pm Post subject: |
|
|
for asm you dont need tutorials because it is done with the same instructions and the same methods you do basic things, if you know the basics (clearly you don't) i suggest to just go and pick some asm sources written in fasm, in my opinion fastest way to learn is to learn from the sources. Im not going to do your search here though, you are going to do that yourself. If you know the basics learning the syntax of assembler is very easy after you look at some sources. So for now go and learn the basics (theory)
some hints what to look for: fasm board, masm board, iczcelion tutorials, art of assembly book at webster. This should be enough to get you started.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Nov 18, 2008 9:23 pm Post subject: |
|
|
How about?
| Code: | org $0100
use16
xor cx, cx
go:
mov dl, cl
mov ah, $02
int $21
inc cl
cmp cl, 255
jne go
done:
xor ax, ax
ret |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|