News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

about MASM SDK 11

Started by applechu, February 23, 2012, 03:11:22 PM

Previous topic - Next topic

applechu

Hi:
I am newbie to masm, and try to use masm ide11.
The problem I meet is the difference between masm 6 and masm ide 11.
The codes in some books and web sites can work, but can not work
in masm ide11.
What is the main difference between them, and how to cover these
points. Thanks a lot.




dedndave

welcome to the forum   :U

QuoteThe codes in some books and web sites can work, but can not work in masm ide11.

best thing to do is to show us some code that does not work

i am guessing here...
it's 16-bit code in a 32-bit environment   :P
we get that a lot, in here

applechu

the codes are as following:


.MODEL SMALL
.CODE

begin: mov dl,"L";
       mov ah,02h;
       int 21h;
     
      END begin



thanks

dedndave

that will work, but you have to use the 16-bit linker, Link16.exe
it is 16-bit code - old stuff - will not work directly under 64-bit OS's

dedndave

32-bit version...
        INCLUDE \masm32\include\masm32rt.inc

        .DATA

String1 db 'L',13,10

        .DATA?

dwByteCount dd ?

        .CODE

_main   PROC

        INVOKE  GetStdHandle,STD_OUTPUT_HANDLE
        INVOKE  WriteFile,eax,offset String1,sizeof String1,offset dwByteCount,NULL
        INVOKE  ExitProcess,0

_main   ENDP

        END     _main




applechu

is it possible to run directly under the masm ide?
after using link16, the error message shows invalid object module.
thanks

clive

16-bit code expects objects and libraries to be in OMF, not COFF

For MASM 6.x you'd want to make sure the /coff option is not used, for newer versions you'd need to use /omf where the default is COFF

Working with 16-bit code, especially for someone starting in 2012, should be avoided as it has virtually no commercial application. I guess you have a few people with 80186/80188/V30 type embedded boards, running Borland C applications, DOS, or whatever, but these are rare/niche applications.
It could be a random act of randomness. Those happen a lot as well.

jj2007

As Dave and Clive already mentioned, there is no point in writing 16-bit code unless you have a really good excuse. 32-bit is also much easier. Click on my signature below to get some quickstart info.

"The" Masm IDE does not exist; to avoid confusion,
- Masm is "Microsoft Macro assembler" - see \masm32\bin\ml.exe and link.exe
- Masm32 is the library maintained here in this private forum - see \masm32\help\
- there are several editors and IDEs around, e.g. \masm32\qEditor.exe that you can use for writing code that uses the Masm32 library and assembles with Masm.

Welcome to the Masm32 forum :thumbu

dedndave

yah - he probably got ahold of some older books - a lot of them around, i am sure   :P
i know that some college instructors are also stuck on 16-bit - they don't seem motivated to learn 32-bit assembler
it's fun and interesting to know 16-bit code, but that's as far as it goes - lol

clive

Academics and antiquarians live in the past, most of the people involved in the commercial use of assembly have to keep up with where technology actually is, and where it is going. I guess they are just comfortable with teaching the same old stuff for 20-30 years, but that is the antithesis of the advancing pace of technology.

I could probably make a case for 68K (1979 era) because of it's clean and elegant implementation, but 32-bit ARM captures that ethos and has current relevance.

Learning 16-bit x86 however is dangerously useless.
It could be a random act of randomness. Those happen a lot as well.

hutch--

> Learning 16-bit x86 however is dangerously useless

I would certainly agree with this comment, 16 bit x86 is out of date junk that has very few uses on modern computers. Think of the first 1 meg of memory, it can use 640k by default if DOS is configured correctly (HIMEM.SYS etc ...) the balance up to 1 meg is used by the operating system and BIOS. DOS in non-re-entrant, needs antiquated TSRs to mimic multitasking, uses a complicated and antiquated segment / offset addressing system, has a hard disk limit of about a couple of meg and is much slower than 32 and 64 bit code.

In 32 but code you have 2 gigabyte address space as normal and the OS has the other 2 gig. If you have even vaguely recent hardware you have far more instructions to work with with far fewer restrictions and the massively powerful Windows API functions to design applications with. 32 bit OS version can routinely address multi-terrabyte sized disk drives. 64 bit is still developmental but it is faster again, can address even more memory, has many more registers and has a similar protected mode architecture to the 32 bit Windows versions.

Do yourself a favour, unless you are writing dedicated 16 bit x86 code for hardware purposes, don't waste your life and time with old junk like 16 bit code.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

applechu

Are there any good books for these subject.
And furthermore, I hope to learn more about assembler, how to study these subjects well.
Thanks a lot.

hutch--

If you want modern up to date info on writing 32 bit assembler, use the online resources here and in a few other places, get the Intel manuals and get used to using MSDN or similar online resources for the Windows API functions. There are a lot of them but as normal you use the more common ones to perform the more common tasks.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

Hutch forgot to mention...
the masm32 package has a lot of examples, help files, and tutorials
those, and MSDN, is where i have learned most of it

i also used Iczelion's tutorials to get going on GUI stuff
you must understand that the masm32 package has been updated a few times since that tutorial was written
some of the examples need to be modified slightly to build (pretty easy to do)

applechu