Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Asm Basics.doc
Nội dung xem thử
Mô tả chi tiết
What Is Assembly Language?
First What is Machine Language:
Although programmers tend to use C or C++ or Pascal these days, the language closest to the PC hardware
is machine language. Not one second during a PCs powered on lifetime passes where the computer is not
executing machine language.
Assembly Language or Machine Language:
To word this simply, you can say that say that assembly language is a human-readable text, and machine
language is machine-readable binary code. When you program in assembly language, you are programming
on the machine language level.
To program directly in machine language is teadious, so you use assembly language instead, and use an
assembler to produce the actual machine code.
The assembler language is the symbolic programming language that lies closest to the machine language in
form and content.
You will, therefore, find the assembler language useful when:
You need to control your program closely, down to the byte and even the bit level.
You must write subroutines for functions that are not provided by other symbolic programming languages,
such as COBOL, FORTRAN, or PL/I.
Windows Memory
The first thing you need to know that windows memory is numbered, the first byte is at offset number 0, and
the highest possible offset for a byte is just over 4.2 billion (ffffffff hex)
When a program executes it will start at the first instruction (starting at 400000 (hex) in windows 95) and then
go onto the next one in a linear fashion, that is until a jump or conditional jump happens.
Conditional jumps are like a choice. If something happens then jump to here, otherwise just keep going in the
code. For instance if a character has 0 hp after being hit it will compare the hp to 0 and if it's 0 then it will jump
to the death routine.
Disassembling (W32Dasm)
Using w32Dasm disassembler on: diablo_s.exe
Start off by loading the project. It may take awhile, go fix yourself a drink :)
After this, go to Disassembler menu/Save Disassembly Txt File and Create Project File
and then next time you load it it'll just take 5 seconds...
Ok, now that you've finshed loading it...Hmm, so what do all these funky symbols mean? :)
Well, now what ya gotta do is this: goto font under the Disassembler menu. Then goto select font and select
fixedsys. Now you can actually read it! :)
Meanings of all those numbers you see: