This preview shows page 1-2-3-4-5 out of 14 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Which Version of MASM are you Using?Assembling and Linking Using Masm613What to type on the Command Line to assemble hello.asmMASM.exeWhat to type on the Command Line to Link Hello.objLink.exeAppendix D and QHWhere is Your Irvine libraryML.exeAssembling and Linking with MASM 6.15Slide 11Irvine16.INCMemory ModelsLab 6 changesWhich Version of MASM are you Using?•Like most function files, the MASM.exe file is constantly updated. In production, typically some date is chosen as a production date, but changes continue.•If you are using only the Purple version of the Irvine book (3rd Edition), you are probably using MASM 6.13.•If you have the 4th Edition of the book, you are using MASM 6.15.•To be certain, type from the command line–C:> dir MASM*•The lab has MASM 6.15 installed.Assembling and Linking Using Masm613•Template for Programs if you are using 6.13•Hello.asm•You have a choice of how to assemble–As explained in the lab•Masm.exe •Link.exe•CV.exeWhat to type on the Command Line to assemble hello.asmC:> Path = c:\masm613\binC:> Masm hello•This assumes that masm.exe is in the bin subdirectory.•Note that the extension of the file is not typed on the command line (it is assumed to be asm)•This function creates an object file (file containing machine language code – binary file) named hello.objMASM.exe•In lab, you type:C:> masm hello,hello,helloThis is (source filename, object filename, listing filename)•MASM.exe is an executable file that has a lot of options. /Zi (generates Codeview information in object file)•In order to run codeview, you type:C:> masm /zi hello, hello, hello•Can just commas to use default valuesWhat to type on the Command Line to Link Hello.obj•Want to link Hello.obj with any external files used in the source code (none needed)•Want to create an executable fileC:> Path = c:\masm613\binrC:> Link hello•This creates an executable file. If you don’t put any of the extensions, it will ask you.•This assumes that Link.exe is located in the binr subdirectory.Link.exe•16-bit linker supplied with Microsoft Assembler.•Link.exe also has many options.•Use /CO to add Codeview information into the executable file.•You type:C:> Link /CO hello,,,,, This is (objectfile, executable filename, mapfile, libraries, deffile)Appendix D and QH•Appendix D in the 4th Edition has the options for LINK listed.•QH – Microsoft Helper You type:C:> qhWhere is Your Irvine library•You type:C:> dir c:\irvine\i*•There should be a file called irvine.lib•This is the file of irvine library functions.•It must be linked with your object code if you are using any of the irvine libraries (Writeint, RandomRange, etc….)•Copy irvine.lib to your current directory•You type:C:> link hello,,,irvine,,•Link should give a series of questions if no commasML.exe•When you type masm …, another program is invoked.•MLAssembles and links one or more assembly language source files. The command line options are case sensitive.ML options fn options fn … /link linkoptions•Options listed in Appendix DAssembling and Linking with MASM 6.15•You type:C:> path = c:\masm615C:> masm /Zi sourcefilename,,,•You type•C:>link /CO objectfilename,,,c:\masm615\lib\irvine16,,Assembling and Linking with MASM 6.15•More details are hidden•Some lines of code are to removed from the template. (These lines of code are included in the Irvine.INC file)•Template for MASM 615•You type:C:> path = c:\masm615C:> make16 helloIrvine16.INC•This is a text file that can be modified. You can modify it to meet your needs. Note that the model size is set. That line could be changed. Also with the .386 line.Memory Models•SMALL memory model–One code segment(64K) and one data segment(64K). All code and data are near, by default.•MEDIUM memory model–Multiple code segments and a single data segmentLab 6 changes•Part A does not have to be changed to use MASM 6.15•Part B –Note that Writeint does not allow outputs for bin, octal, unsigned, etc… (use WriteBin, WriteDec, WriteHex, WriteInt instead)–Need to add Include Irvine16.inc•Part C–Again need to change Writeint to Writedec–Need to add Include


View Full Document

MSU ECE 3724 - MASM Version

Documents in this Course
Timers

Timers

38 pages

TEST 4

TEST 4

9 pages

Flags

Flags

6 pages

Timers

Timers

6 pages

Timers

Timers

54 pages

TEST2

TEST2

8 pages

Load more
Download MASM Version
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view MASM Version and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view MASM Version 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?