Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 00:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Guide] ASM 101 - Introduction to the Assembly language

Discussion on [Guide] ASM 101 - Introduction to the Assembly language within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
[Guide] ASM 101 - Introduction to the Assembly language

Hello, fellow epvpers.

In the last few weeks/months I have seen a steep rise on people who wanted to give reverse engineering a try, so I figured I help a few people with a basic introduction to the assembly language.

IMPROTANT! This is NOT a reverse engineering tutorial!!! These will be just a few assembly tutorials, then at the end I might show you some basic things you can do with OllyDBG. This series is intended to help you understand that nightmare of code which appears in Olly, then you apply this to Conquer Online

Update : (Thanks to a friend of mine )Do you need an editor to work in 8086 assembly and don`t like Notepad or Notepad++? Use Sublime_text. You will need to make it work.

If you find any errors, and I`m sure you will, probably multiple times, please PM me or post it here and I`ll fix it. Thanks you in advance.

This thread will be updated with more tutorials, of course.

So yeah, let`s get started!

Lesson 0 - Compiling your first 8086 assembly program and set up the dev enviroment


Lesson 1 - Basic arithmetic operations


Lesson 2 - Advanced arithmetic operations. Signed representations.


Lesson 3 - Loops, logical satements


Lesson 4 (really short one) - using arrays


Lesson 5 - some interrupts - print "Hello World"

Attached Files
File Type: zip tasm-tlink-td.zip (368.1 KB, 88 views)
KraHen is offline  
Thanks
3 Users
Old 01/29/2014, 14:05   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
My brains :S This is worse than lisp.
Y u k i is offline  
Old 01/29/2014, 14:14   #3


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
Try Haskell.
KraHen is offline  
Old 01/29/2014, 14:51   #4
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
(((((Not even close to being worse than lisp.)))))()()()()

Not a bad tutorial. I certainly wouldn't start off learning x86 as an introduction to assembly though. I'd start off with a RISC architecture first for learning general assembly concepts (which is why they usually teach MIPS in school), then go to x86.
Lateralus is offline  
Thanks
1 User
Old 01/29/2014, 19:18   #5


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
@Lateralus : Yeah, it would be a viable choice, but I`m not really familiar with either of them, and 8086 seems closer to 32-bit assembly as well. Also thank you.

Added lesson 2!
KraHen is offline  
Old 01/29/2014, 22:55   #6
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,113
If I could recommend something, you can make and run assembly programs for windows using MASM and Textpad 7. I'll post a program that uses it, if I remember to get it off my college network drive tomorrow.
Spirited is offline  
Thanks
1 User
Old 01/29/2014, 22:57   #7


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
This code won`t run with a MASM compiler, nor will it run with a 8086 emulator. If someone wants to convert it to MASM though, it won`t be hard at all.
KraHen is offline  
Old 01/29/2014, 22:58   #8
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,113
Quote:
Originally Posted by KraHen View Post
This code won`t run with a MASM compiler, nor will it run with a 8086 emulator. If someone wants to convert it to MASM though, it won`t be hard at all.
Right, which is why I was offering to post a program for it. Should I not then? I don't want to ruin your little tutorial.
Spirited is offline  
Old 01/29/2014, 23:23   #9


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
Quote:
Originally Posted by Spirited Fang View Post
Right, which is why I was offering to post a program for it. Should I not then? I don't want to ruin your little tutorial.
You absolutely should, and welcome to do so.

Also added lesson 3 in the meantime!
KraHen is offline  
Thanks
1 User
Old 01/30/2014, 00:20   #10
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,113
Awesome! I'll do that tomorrow at the lab.
Btw, the lessons are looking really nice. Good job. Nothing I'll post will be at the level you're making lessons for, but hopefully it'll help for anyone interested in seeing it for Windows using MASM.
Spirited is offline  
Thanks
1 User
Old 01/30/2014, 14:08   #11


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
I`m eager to see it as well.

In the meantime, added a few more guides!
KraHen is offline  
Old 01/31/2014, 17:10   #12
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 12
keep it up, nice tutorials buddy
OverKill. is offline  
Old 01/31/2014, 17:37   #13
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,113
Alright. Sorry, I forgot yesterday. Here's the make file for my little program:
Code:
# Declare & Initialize Constants:
EXECUTABLE = Lab1.exe		# The executable file.
ASSEMBLY = Lab1.asm		# The assembly file.
LINKER_INPUT = Lab1.ilk		# The linker input file.
PROJ_DEBUG = Lab1.pdb		# The project debugger file.
OBJECT_FILE = Lab1.obj		# The object file for assembly.
LIST_FILE = Lab1.lst		# The list file.


ALL: $(EXECUTABLE)


CLEAN:
	-@erase $(EXECUTABLE)
	-@erase $(LINKER_INPUT)
	-@erase $(PROJ_DEBUG)
	-@erase $(OBJECT_FILE)
	-@erase $(LIST_FILE)

	
$(ASSEMBLY):


$(OBJECT_FILE): $(ASSEMBLY)
	ml /c /coff /Zi $(ASSEMBLY)

		
# If the object file, executable, kernel, or io object has changed, 
# remake the executable file:
$(EXECUTABLE): $(OBJECT_FILE) 
	link /debug /subsystem:console /out:$(EXECUTABLE) \
		/entry:start $(OBJECT_FILE) KERNEL32.LIB IO.OBJ
And here's the assembly file:
Code:
.386

; The memory model:
.MODEL FLAT

; We don't know where this prototype is, but it's in the address space
; (NEAR32), and we're passing in a dword parameter.
ExitProcess PROTO NEAR32 stdcall, dwExitCode:dword

include io.h

cr EQU 0dh; cr = carriage return
lf EQU 0ah; lf = line feed

; Remember, memory is broken up into four types:
; Stack, data, code, and heap.
.STACK 4096

.DATA
szPrompt1 BYTE "Enter first number: ",0
szPrompt2 BYTE "Enter second number: ",0
szLabel1 BYTE "The sum is:",0
dwNumber1 DWORD ? 		; numbers to be added
dwNumber2 DWORD ?
szString BYTE 16 DUP(?) 	; input string for numbers
szSum BYTE 12 DUP(0) 		; sum in string form
szNewline BYTE cr,lf,0

.CODE
_start:
	output szPrompt1 	; prompt for the first number
	input szString, 16 	; input first number as ASCII
	atod szString 		; convert to integer (ASCII to decimal)
	mov dwNumber1, eax 	; and store in memory.
	output szPrompt2 	; repeat for second number
	input szString, 16 	; input second number as ASCII
	atod szString 		; convert to integer - always goes to eax
	mov dwNumber2, eax 	; and store in memory.
	mov eax, dwNumber1
	add eax, dwNumber2 	; add second number to first number
	dtoa szSum, eax 	; convert to ASCII
	output szLabel1 	; output label and results
	output szSum
	output szNewline
	INVOKE ExitProcess,0
	
PUBLIC _start
END
Spirited is offline  
Thanks
2 Users
Old 01/31/2014, 19:49   #14


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
Quote:
include io.h
I wish we had this in my lab as well lol.
KraHen is offline  
Old 01/31/2014, 20:17   #15
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,113
Quote:
Originally Posted by KraHen View Post
I wish we had this in my lab as well lol.
The magic of the MASM linker.
Spirited is offline  
Reply


Similar Threads Similar Threads
[Guide] Assembly guides to improve your VSRO Server!
12/28/2021 - SRO PServer Guides & Releases - 79 Replies
This Thread contains many Assembly edits which are useful if you run a Vsro P-Server. Requirments: Ollydbg (download here) Dezimal -> Hex Converter (This or This) they are all the same. Small tutorial how to use OllyDBG: - if you start OllyDBG, simply drag the file you want to check in the OllyDBG window (in this case the SR_GameServer.exe of VSRO). Let Olly analyze the file completly (black bar at the bottom) - The lines are working like this: Expression |. Binary | Assemble |...
[Guide] Introduction to DLL Modding
09/18/2018 - Mabinogi Hacks, Bots, Cheats & Exploits - 8 Replies
Now in order to successfully mod a dll file you need to understand exactly how it is map'd out IDA Pro witch can be found on thepiratebay is great for something like this because it has a graph view that shows all subroutines that a specific line may call upon or transfer/read data to and from. it is important that when modding to only pay attention to an address when your switching from IDA Pro to OllyDBG, olydbg allows for quick modification. Pay attention to the name of the function...
[Help]assembly language tutorials
06/12/2010 - General Coding - 1 Replies
Can someone recommend me some assembly language tutorials, please?
[GUIDE]EO Class Introduction
11/05/2009 - Eudemons Online - 0 Replies
Here is an introduction for each classes. I hope this is useful for beginners;). http://i590.photobucket.com/albums/ss347/PhoeNix4 Real/10_1.jpg A powerfull class, that is good in fights. They are good at magicranging, but not at melee. They are maybe one of the mighest classes in EO.



All times are GMT +2. The time now is 00:57.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.