944,028 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 9455
  • Assembly RSS
May 22nd, 2005
0

Introduction to 80 x 86 Assembly Language and Computer Architecture - no CD - help

Expand Post »
I recently bought this book online used, it came with no CD. Many of the code examples in this book rely on some file called IO.h that apparently came with the CD. I downloaded this file and I still get many errors. Does anyone have these files, or do I even need them? Can I just learn assembly without even assembling files?

Here is what the program looks like, I cant even assemble it because I dont have IO.h, kind of stupid that this book relies on some header file rather than showing you how to do it without header files though

; Example assembly language program -- adds two numbers
; Author: R. Detmer
; Date: revised 7/97
.386
.MODEL FLAT

ExitProcess PROTO NEAR32 stdcall, dwExitCodeWORD

INCLUDE io.h ; header file for input/output

cr EQU 0dh ; carriage return character
Lf EQU 0ah ; line feed

.STACK 4096 ; reserve 4096-byte stack

.DATA ; reserve storage for data
number1 DWORD ?
number2 DWORD ?
prompt1 BYTE "Enter first number: ", 0
prompt2 BYTE "Enter second number: ", 0
string BYTE 40 DUP (?)
label1 BYTE cr, Lf, "The sum is "
sum BYTE 11 DUP (?)
BYTE cr, Lf, 0

.CODE ; start of main program code
_start:
output prompt1 ; prompt for first number
input string, 40 ; read ASCII characters
atod string ; convert to integer
mov number1, eax ; store in memory

output prompt2 ; repeat for second number
input string, 40
atod string
mov number2, eax


mov eax, number1 ; first number to EAX
add eax, number2 ; add second number
dtoa sum, eax ; convert to ASCII characters
output label1 ; output label and sum

INVOKE ExitProcess, 0 ; exit with return code 0

PUBLIC _start ; make entry point public
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Gink is offline Offline
46 posts
since Feb 2005
May 23rd, 2005
0

Re: Introduction to 80 x 86 Assembly Language and Computer Architecture - no CD - hel

Well, you can assemble your code in memory and run it from there...a perfect place to start for small DOS programs...you probably already have the tool (Debug), just need the tutorial:

http://www.datainstitute.com/debug1.htm

The IO.H file that your book wants is just assembly code for handling the input/output functions so you wont have to code this yourself. Actually, the book is doing you a disservice because you really should learn to code these yourself and this isn't difficult to learn. Check out Ralph Brown's Interupt List at:

http://www-2.cs.cmu.edu/afs/cs.cmu.e...ralf-home.html

You will eventually discover that a lot of asmers have given up DOS in favor of Windows programming (which isn't that difficult to learn) and there are plenty of assemblers and resources available for this. Check out the links in the following thread:

http://www.daniweb.com/techtalkforums/thread22522.html

Happy asming!
Reputation Points: 99
Solved Threads: 5
Junior Poster
Evenbit is offline Offline
140 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Questions about assembly and boolean algebra
Next Thread in Assembly Forum Timeline: ASM Game Coding Problem/Question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC