News:

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

A newbie story and need help.

Started by benji, March 10, 2008, 03:52:21 AM

Previous topic - Next topic

benji

Hai,....

I've posted the same topics in the 16bit segment, i don't know if this is wrong to put the same topics in other segment, if i'm wrong than .... sorry you guys, but i need help.

I'm a newbie in this world of assembly, i've code in VB6 and Java before.
And now i'm trying to study the assembly.
I've posted my question once in the CAMPUS section and people told me to start with 32bit and some with 16bit.
So, i choose to start with 16bit (but i also try to read the 32bit at the same time).
But now i'm concentrating in 16bit and forget about the 32bit.
I have Masm32 with 16bit linker, so all the ammo are set.

I read the Art of Asembly Language(16bit), Windows Assembly Language & Systems Programming, and some books related to computer architecture & organization that student use in college.
I haven't finish them all, because now i'm under the "stress" mode. ^_^
I understand all the text in those books, but there are major problems.
I don't know what to do......(in 16bit).
For example: I don't know how to get user input from keyboard, print user input to screen, how to make input box, why can people use :
   message    db    "Hello Word!"
(they said that it's a byte, but "Hello World!" is more than 1 byte, so is it an array or something?), when segment concept is really2 use, when segment override is useful, etc.....

That kind of question is really2 bothering me.

So, is there good tutorial or books or is there someone who is willing to tutor me from the basic?
Maybe i need someone that tell me "Just follow me and later on you will understand!" or "Just shut up and do what i told you!" ^_^
I am really2 lack of guidance, and if i stayed in this situation long enough i think i can gone crazy. hua-hua-hua......

So, is there any advice or tutorial or something for someone like me?
Is there any tutorial from the basic with it's sample code ?

Thx,
Benji

ecube

in this day and age 16bit is useless and pointless, if you really want to jumpstart your masm development check out icezlions tuts(some are in the masm32 package you can find the rest online) check out the other masm32 examples check out http://www.madwizard.org/ for more tuts, code examples, although hes dropped masm recently which I hate when people turn their back on the one true language. and continue on your development as someone whos programmed over 10 years in C/C++, 5 in php, 7 in vb, 3 in python and perl delphi, and for linux aswell as windows, i'm telling you asm is where it's at I absolutely LOVE masm and nothing will change that, i'll never turn my back on the language or the compiler unless microsoft makes things too difficult with disclaimers etc.. then i'll change compiler.

Rainstorm

hi benji.
am learning 32bit asm too.
if you try out experimenting with some code it will help
& i think it would be easier to experiment with 32bit at first.. cause there's much more support for it in diff ways.

http://www.madwizard.org/programming/tutorials/

there's a very basic tutorial on that page.

http://website.masm32.com/files/td_win32asm_all.zip

that one uses push & pop i think instead of invoke.. but its well commented.

benji wrote
Quotemessage    db    "Hello Word!"
(they said that it's a byte, but "Hello World!" is more than 1 byte, so is it an array or something?),

"Hello Word!" is a string made up of more than 1 byte
db tells you that the size of each character in the string is 1 byte - so H is 1byte, e is 1byte & so on. - byte is the type i guess; ..so the actual space it would occupy in memory is the sum of all the bytes of that string.

E^cube wrote..
Quotei'm telling you asm is where it's at I absolutely LOVE masm and nothing will change that, i'll never turn my back on the language
..That is encouraging to hear.
-

hutch--

benji,

I will let you in on a little secret, almost all of the older guys wrote 16 bit DOS assembler and many (like me) hated it because of its limitations. In 32 bit its simpler, clearer, far better documented, much faster and has many more instructions available. Unless you are specifically writing legacy 16 bit code for a purpose, learn assembler programming in 32 bit as it is presently useful and not that much different to the coming 64 bit assembler.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

benji

Hai,...

i want to ask, so..... what does 16bit good for nowadays?
making graphic apps, virus, or what?
Can i do everyting that 16bit can do with 32bit assembly?

Thx,
Benji

BogdanOntanu

Quote from: benji on March 10, 2008, 10:06:50 AM
i want to ask, so..... what does 16bit good for nowadays?
making graphic apps, virus, or what?

16 bits ASM has almost zero use today.

The CPU does start in 16 bits hence some initializations must be done in 16 bits and parts of BIOS are written in 16 bits for the same reason. But usually everybody gets out of 16 bits as fast as possible.

Quote
Can i do everyting that 16bit can do with 32bit assembly?

Yes 32 bits can do everything that 16 bits can do ...  and much more.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

ybdesire

if you are interested in hardware development,such as MCU and embeded application.i tink it`s will be better to learn from 16bits.
what` more , it will be good for you to learn the basic process of the CPU from 16bits

BogdanOntanu

Quote from: ybdesire on March 10, 2008, 12:06:09 PM
if you are interested in hardware development,such as MCU and embeded application.i tink it`s will be better to learn from 16bits.

No it will not be better. Most embedded CPU's today are either 8 bits or 32 bits. Chances are you will handle a 32 bits CPU if you ever get the expertise required to be allowed to handle an embedded project. I handled a few and did not meet a 16bits CPU only 32 bits or 8 bits CPU's.

Besides the architecture uniformity of the Intel CPU in 32 bits mode it is much closer to what you will find in embedded devices.

If you want direct access to I/O ports it is better to either write a driver (for windows) or develop for an smaller hobby OS that does allow direct I/O but in full 32 bits (like my Solar OS for example, but I guess Menuet or OctaOS or other small OSes can be useful for this also)

However since you are a beginner it is better to say away from such issues. The hardware has it's own learning curve and you do not want to handle 2 problems in the same time: learning ASM and learning hardware/electronics/devices.

Make a few small ASM applications in Windows 32 bits, then make a few bigger applications in Windows in 32 bits and once this is done you can return to study hardware, I/O ports, electronics, embedded development and 16 bits ASM if you still need it.

You need to start somewhere in order to obtain the experience that will provide a basis for your future evolution. And 16 bits is the wrong place to start. It gives you the wrong skills, the wrong concepts of CPU architecture.  And you can not yet understand that because you do not have the experience needed to make a fair judgment.

Quote
what` more , it will be good for you to learn the basic process of the CPU from 16bits

No. The basics of CPU are not dependent of 8bits,16 bits, 32 bits or 64 bits. The basics are registers, program counter, stack, RAM / ROM memory, addressing modes, number representations, CPU rings and protection, I/O space etc.

It so happens that in 16 bits ASM some of those concepts are "perverted" and will give you the wrong understandings if you are a beginer.

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

benji

I understand what "BogdanOntanu" means by starting with 32bit. After i try to code using 16bit and 32bit, i can see the major different.

There are alot of 16bit concept that confusing for newbie like me, and the 32bit is more clearer.

QuoteNo. The basics of CPU are not dependent of 8bits,16 bits, 32 bits or 64 bits. The basics are registers, program counter, stack, RAM / ROM memory, addressing modes, number representations, CPU rings and protection, I/O space etc.

After reading several books, i understand the concept of computer system (just a little), and you are right: it's not about the number of bits but the concept of the system itself. And the computer system basic component concept (architecture & organization) is the major thing: CPU, Bus, I/O and Memory. As long as i understand the basic of those component i can code using any bits, because every system has its own specification but they use the same basic concept. Just like we can segment in 16bit processor & the 64K limitation, segment is only a technique that the intel engineer use so the user can address more than 64K but the concept of addressing is still the same: the register, the bus, word length, addressing mode, etc still use the same basic concept. The basic architecture is still the same : Von Neuman and Harvard.

So now i will stick to the "basic", try to code and see the connection between the theory concept and the implementation. And just like BogdanOntanu said : "because you do not have the experience needed to make a fair judgment." So i'm searching for that experience now.

Thank you all of you, now i'm so excited to study this assembly. This will open a "new world" for me.

And i'm always open for suggestion. Feel free to tell me anything.

Benji

BytePtr

One MS-DOS freak is back again (myself) and has one question for public.


I agree that 16bit stuff is complicated. But I'm using 16bit stuff already more than 4,5 years, since i started programming. I'm still using it.
I see good point in using 16bit for programming because its a must have if you want to code some interesting stuff if you love DOS (like i do). Where i don't see the point? Its the programming in 32bit ASM. Whats the point of coding full applications in pure 32bit asm when there is VC++, Delphi,that can do the same work? I don't understand why people are coding BIG apps in pure 32bit asm.
OK, i understand that you use some in-line __asm in your Delphi or Visual C++ project but full app in pure asm?

Why?

I have nothing against 32 bit asm, nor MASM32. I'm using also this but pretty rarely. I'm not coding applications purely in asm.

Just wondering why people are doing this?

..and peace.

NightWare

BytePtr,

why ?
maybe because we are curious to understand how things work,
maybe because speed/size is sometime essential,
maybe because we want to try a different approach,
maybe because we want procs doing exactly/only what we really need,
maybe because we don't want to be c/winapi slaves,
maybe because it's fun,
maybe because we have time to loose...

make your choice  :wink

arroso

unless you got old hardware to run 16bit apps it is almost a waste not to use 32bit asm. and it is ways easier.
think about memory limitations, just to mention one of the major points.
and in my very case I do enjoy the multithreading developement on my stable win2000 with Masm32.
when I need c++ I use gcc after paper and pencil. VC++: no, thanks.

l started with the z80 and ol sweet 6502 thru the mc68xxx in the eighties. I see right today the same story hasn't changed: why to use asm
for big apps. well, if we talk about d3d it's more than a challenge and it's getting harder. yes in that very case c++ would be right.
but for anything else, nothing compares to asm32. for it's fun and easy and a lot more. but only once you know it well.

as you see, it's a matter of choice indeed.

raymond

For me, it's NOT a matter of choice.

I also started with Z80 and fell in love with assembly when compared to BASIC which was just about the only choice then. Started by hand coding then wrote my own assembler when I got tired of "patching". When I purchased an XT, I then learned 16-bit x86 assembly (which was the only thing available at the time) and continued with it until I switched eventually to 32-bit. Not having bothered to learn any other programming language (except a bit of Fortran in the late 60s and some BASIC with the TRS-80), I must do everything in assembly; it's only for a hobby.
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

ic2

BytePtr,  I wish I had start off with 16bit.  I'll be smarter today using 32bit masm.  You are for real in your ways just like E^cube.  I never hear nothing that strong before.

benji , if you got time to do nothing go with 16bit for the education, the smarts.  If you want to do something extra fun "right now" and be a man about the times you got to start off with 32bit because 64bit is HERE already, waiting for it fuse to get lit. 

I love writing tons of code in a app and watch it turn small, and small, byte by byte.  It tells me I'm doing a good job as long as it beats out c,  c++ and  .NET else in SPEED.  The rest don't stand a chance becase these don't anyway.

Also, you'll never get a job programming for 16bit these days.  I'ts hard to get one using 32bit ASM.  Assembler is for knowledge, personal tools, or the coolest fastest user application ever at the market place.

You can apply your basics and understand to any programming tool in the world and catch on quicker, faster, with lighting speed that takes the average person 10 years of school to make since of a the tons of books he had to read.

Just imagine you got a job doing java and no one know asm for SURE, and you apply a few simple but better ASM idea to make thing tick even faster.  Now you got a Raise and a Promotion.  Trust me the World needs you and your going to love it regardless.

jj2007

#14
About 20 years ago I started programming in assembler. WordStar was not good enough for my taste,  so I wrote my own word processor (in BASIC) and coded some fast routines for the screen display and the printer driver in assembler. The result was a blazingly fast word processor, with embedded graphics and many advanced features. I printed and published a book on agriculture with this word processor, with one of the major scientific publishers.
That was around 1988. The processor was an eight MHz Motorola 68000, and of course, I wrote my code with a 32-bit assembler. Many years later I had a superficial look at DOS assembly and decided it was something for masochists.