Hi.
I began learning ASM programming a couple of weeks ago. I really enjoy 16bit ASM programming, although I prefer C++. Nonetheless, ASM forces me to appreciate higher level level including C++. It would be nice to be able to disassembly any program and see what really goes on under the binary code.
What is a good reference book covering 16bit and 32bit 80x86 ASM programming?
Thanks,
Kuphryn
Comments
: Hi.
:
: I began learning ASM programming a couple of weeks ago. I really enjoy 16bit ASM programming, although I prefer C++. Nonetheless, ASM forces me to appreciate higher level level including C++. It would be nice to be able to disassembly any program and see what really goes on under the binary code.
:
: What is a good reference book covering 16bit and 32bit 80x86 ASM programming?
:
: Thanks,
: Kuphryn
:
The Art of Assembly (there's a DOS, Win32, and Linux version). I recommend reading the DOS version first. The Linux and Win32 versions are identical (to each other, not to the DOS version) last I checked. Anyways, the URL webster.ucr.edu.
"We can't do nothing and think someone else will make it right."
-Kyoto Now, Bad Religion
Most responses I received mentionee "The Art of Assembly." I will definitely print a copy, read it, and learn about ASM via "The Art of Assembly."
Kuphryn
I am an experience C++ coder, and love working in C++.. but i feel that assembly for X86 would be a nice touch to learn....
32bit ASM should be exciting too, although I am learning 16bit ASM righ tnow.
Kuphryn
I am studying 16bit ASM because I feel it is the foundation for 32bit ASM. At least that is how programming with high-level languages work. For example, we learn C/C++ before learning Win32 API and MFC.
Kuphryn
:
: I am studying 16bit ASM because I feel it is the foundation for 32bit ASM. At least that is how programming with high-level languages work. For example, we learn C/C++ before learning Win32 API and MFC.
:
: Kuphryn
:
That's because you can't program Win32 API or MFC without first knowing C/C++. The same is definitely not true of 16-bit and 32-bit x86 assembly. 32-bit assembly isn't 'on top of' 16-bit assembly as MFC is a layer above C++.
16-bit assembly is actually more difficult than 32-bit assembly (well more 'more of a pain in the ass', than 'more difficult'). Really the main difference is memory layout. 32-bit application level code usually has one giant flat memory layout.
However, typically 32-bit application level code doesn't have direct access to the hardware. If you want to mess around with hardware (for your own entertainment and education) then typically using 16-bit DOS is easiest (the alternative would be to write device driver code).
"We can't do nothing and think someone else will make it right."
-Kyoto Now, Bad Religion
Kuphryn
http://webster.cs.ucr.edu/Page_asm/ArtofAssembly/0_ArtofAsm.html
Kuphryn
emu8086 combines an advanced source editor, assembler, disassembler, software emulator (Virtual PC) with debugger, and step by step tutorials.
http://www.programmersheaven.com/search/download.asp?FileID=20562
emu8086 could be the Windows ASM editor and compiler I am searching for. Do you need MASM for emu8086 to work? How does it compare to MASM and CodeView?
Thanks,
Kuphryn
:
: emu8086 could be the Windows ASM editor and compiler I am
: searching for.
: Do you need MASM for emu8086 to work?
- No, emu8086 has everything you may need, editor, assembler and
even 8086 microprocessor simulator (this enables to see what
happens inside CPU).
: How does it compare to MASM and CodeView?
- emu8086 was designed as a learning tool, it has pure Windows
interface. See "MASM / TASM compatibility" in
"emu8086 reference" for more info.
I installed emu8086 and tried to compile a 16-bit ASM source code I designed using MASM 6.15 and CodeView debugger. emu8086 would not compiler it. It displayed a long list of errors.
Is emu8086 compatible with 16-bit MASM ASM?
Kuphryn
: Is emu8086 compatible with 16-bit MASM ASM?
- I may say not fully compatible. May we see your source?
-----
;-----------------------------------------------;
; ;
; ASM Code: c14pp141.asm ;
; Developer: Kuphryn ;
; Platform: x86 16bits DOS Assembly ;
; Compiled: September 23, 2002 - MASM 6.15 ;
; Misc: Calculates Fibonacci Number using ;
; multiple precision arithmetic. ;
; ;
;-----------------------------------------------;
INCLUDE PCMAC.INC
.MODEL SMALL
.586 ; Indicates support for Pentium chip.
.STACK 100h
.DATA
CR EQU 13
LF EQU 10
ProMsg DB CR, LF, 'Multi Precision Fibonacci', CR, LF, '$'
NMsg DB CR, LF, 'Enter a number: $'
FMsg DB CR, LF, 'Fib: $'
NNum DW 0
FibNum0 DD 0
FibNum1 DD 0
SumNum0 DD 0
SumNum1 DD 0
PreNum0 DD 0
PreNum1 DD 0
.CODE
EXTRN GetDec : NEAR, PutDDec : NEAR
Program PROC
mov ax, @data ; Copy data address to register.
mov ds, ax ; Copy register ax to data register.
mov dx, OFFSET ProMsg
mov ah, 9h ; Display text message.
int 21h ; Call DOS.
_PutStr NMsg ; Ask for a number to cal. Fib.
call GetDec ; Get number input.
mov NNum, ax
call CalFib ; Call function to cal. Fib.
_PutStr FMsg
cmp FibNum1, 0
je OutFN1
mov eax, FibNum1
call PutDDec
OutFN1:
mov eax, FibNum0
call PutDDec
PEnd:
mov al, 0 ; Return 0.
mov ah, 4ch ; Exit to DOS
int 21h
Program ENDP
;--------------;
CalFib PROC
CFBeg:
cmp NNum, 0
jl CFLess
cmp NNum, 1
jg CFLp
mov ax, NNum
mov FibNum0, eax
jmp CFEnd
CFLess:
mov NNum, 0
jmp CFEnd
CFLp:
mov FibNum0, 1
sub NNum, 1
mov cx, NNum
CFLoop:
mov eax, FibNum0
add eax, PreNum0
mov SumNum0, eax
mov eax, FibNum1
adc eax, PreNum1
mov SumNum1, eax
mov eax, FibNum0
mov PreNum0, eax
mov eax, FibNum1
mov PreNum1, eax
mov eax, SumNum0
mov FibNum0, eax
mov eax, SumNum1
mov FibNum1, eax
dec cx
jnz CFLoop
CFEnd:
ret
CalFib ENDP
;--------------;
END Program
-----
Kuphryn