Jump to content
Tuts 4 You

Assembly Language Question


Guest shadyike

Recommended Posts

Guest shadyike

A friend of mine recently give me Assembly Language step by step by Jeff Duntemann the first book not the newer version.This book is very good at explaining how computers work as far as the ram and the cpu is concerned.

So here's my question the book is old it's was written before windows 3.0 came out and the cpu is segmented to 64k

i just want to know if cpu like the p4 are still like that and if i can take the info in this book and practice on windows xp

and if i can still program 16 bit not 32

Edited by shadyike
Link to comment
Guest shadyike
Segment registers are generally no longer of any concern.

Wow that was truly an in depth explanation to my question you are truly a testament to Programming

Edited by shadyike
Link to comment
A friend of mine recently give me Assembly Language step by step by Jeff Duntemann the first book not the newer version.This book is very good at explaining how computers work as far as the ram and the cpu is concerned.

So here's my question the book is old it's was written before windows 3.0 came out and the cpu is segmented to 64k

i just want to know if cpu like the p4 are still like that and if i can take the info in this book and practice on windows xp

and if i can still program 16 bit not 32

The basic assesmbler language principles on a modern cpu are similar to what they were when microprocessors first appeared. Just the speed, number of registers, instructions sets and addressing methods have improved dramatically over time.

However once you want to start writing some assembler programs you will find an old book (must be mid 80s) is not going to help you and will become frustrating.

I suggest you go to the site http://www.masm32.com/ and download a copy of MASM32 V9.0 - the free Microsoft Assembler. Look at the tutorials and examples included in this package. The package includes code from a a set of tutorials by Iczelion which are the best assembler tutorials by far. You should also go to Iczelion's site http://win32assembly.online.fr and download the full set of tutorials. These tuts will help you understand assembler and how windows works so you can write your own assembler programs. The first 1 or 2 tuts are enough to be able to produce a simple assembler program for windows.

We all had to start at the beginning at one time.

Good Luck

z

Link to comment

I'll just quote Kris Kaspersky:

There are no more _segments_ in win32, I mean _true_ ones. You have to deal with _selectors_ (they are not the same!), you can't assign selector in user mode. cs:, ds: and ss: selectors are mapped onto the same memory region, so, cs:[xxx] _always_ equal_ ds:[xxx] or ss:[xxx]. The only exception is the fs:, it also mapped onto 4 Gb address space, but it's base address and limit are quite different, however, you may get access to fs:[foo] via ds:[bar], to determine base address on fs you must read GDT table.

"linear = segment<<4 + offset" doesn't work in 32-protect mode.

Selectors are not segments, they are like handlers.

0023:[0116005C] is 0023:[0116005C], try to use 0027:[0116001C] and see what happens :)

(23+4):[ 0116005C - 4*0x10]. However, in kernel mode you can create new selector with the same base address and limit as 23, but having #69 number, after that, 0023:[0116005C] and 0069: [0116005C] will point to the same address.

So, to know virtual address, you have to read GDT, take base address of selector and add the offset value. For example, selector #23 have zero base address, so virtual address simple equal offset value.

You may also consider using FASM or NASM/YASM. I think they are better than MASM.

Link to comment

It true About Segment Registeries But

Still they Have An Important Work In CPU's

FASM Or NASM Or YASM OR MASM None Of Them

Is Better Than The Other They Are All Alike And The Only

Difference Is You And With Which One Of Them you Become

More Used To....... ASM Programming Isn't Always Easy When It Comes

To Big Stuff You'll Have A Total Miss Becuase Of Long Codes Too Many Instructions

I Love Programming In It Cause It's A Powerfull Language Which Makes You Feel In

Control Of all Other Things P4 Has Almost The Same Structure As 86 Processor The Only

Improvments Are The Memory Usage Registeries Speed Busses The Semgments Are Better

And It Can Handle Many Thing at Time without crashing Like The Old CPU's When They Usually

Stopped Workign In Such Cases So As you See Simple Differences That's Why Even Guys That

Learn Electronics Still Study About CPU-86 And CPU-88 which Are Really Common In Much Things

If You Study 16-Bit Assembly It Doesn't Mean you Can't Use 32-Bits But It Only Means you'll Have Oly

To Get used To It And By The Time you'll Become real Good With It That's It Nothing More Nothing Less.....!!

Happy Programming To All !!

Link to comment

Shadyike: Your question is rather vague, be more specific if you want better answers. BTW, that attitude won't get you far, I see your american, try not to act like one... plz

Link to comment
Guest shadyike
Shadyike: Your question is rather vague, be more specific if you want better answers. BTW, that attitude won't get you far, I see your american, try not to act like one... plz

Thanks for answering my question ziggy,angel-5-5,moid

lol fungus the other people who answered my question did so perfectly maybe your programming knowledge is just vague see you pointed out i was an American wow your observation skills don't elude you.See in America and other places when we answer question's we do so in a helpful manner because otherwise it would be of no point to even answer the question.

Link to comment

segment registers are still aviable in 32bit, but they are used with global and local descriptors table, you can still under xp use them in 16bit apps, in 64bits they are removed, due to not change cr0 and rest of controls registers, their bits are used to extend memory range from 4gb to 128gb(yeah you dont have 64bit and you will never on pc install 16 Peta Bytes of memory, not enough bits to map it) vista only supports 4-16gb memory, vista business max 128GB, with xp you have only 2gb of memory, with special param to kernel you can have max 3gb

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...