Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Can't find a good ASM tutorial

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Caelestis
Expert Cheater
Reputation: 0

Joined: 03 May 2007
Posts: 153

PostPosted: Tue Nov 18, 2008 7:36 pm    Post subject: Can't find a good ASM tutorial Reply with quote

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. Sad
Back to top
View user's profile Send private message
sphere90
Grandmaster Cheater
Reputation: 0

Joined: 24 Jun 2006
Posts: 912

PostPosted: Tue Nov 18, 2008 8:27 pm    Post subject: Re: Can't find a good ASM tutorial Reply with quote

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. Sad


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
View user's profile Send private message
Mindw0rk
Newbie cheater
Reputation: 0

Joined: 07 Oct 2007
Posts: 16

PostPosted: Tue Nov 18, 2008 8:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Nov 18, 2008 9:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites