News:

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

Answer some Simple Questions, thanks!!

Started by dottywine, October 26, 2008, 11:16:00 PM

Previous topic - Next topic

dottywine

Also, this assembly language...I am using Intel 32 (something like that).

Firstly, is anyone familiar with what Irvine 32 is?

1. What are some ways to "process" an array?
2. What is DUP(?)?
3. What does it mean if there is a question mark? ex: var1 WORD ?
4. What is the OFFSET operator?
5. What is the LABEL operator?
6. When is the overflow flag set?
7. How do you make a code with multiple procedures?
8. Why make multiple procedures when you can just have different labels that you can jump to?

Please do not tell me to look in my textbook because I have done so several times and I do not understand. I would like an explanation. Explain as if I was 10 years old.

Thankyou extremely.

NightWare

irvine 32 ? i suppose it's the library of kip irvine, it's some functions you can call for your programs (if you are courageous).

1. i don't know what you mean here...
2. x DUP(?) mean value ? (undefined) dupplicate x time
3. var1 word ? <= undefined, or zero if you prefer
4. give you the location of the following variable
5. a label is a line identifier, generally to jump to
6. when you exceed the register capacity by an operation
7. just put them on your file/source, the program will not access them until you call them... there is several source code on this forum, downloading some of them will certainly help you...
8. because you may want to jump SEVERAL times to the same location/procedures, but anyway basically procs are jump/ret
9. i understand i'm 11

edit :
5. hmm, maybe here you speak of the second name/label possibility for the same location...

dottywine

2. Can you explain that more thoroughly or better?
4. What does something like mov esi, OFFSET bVal mean?
5. What does something like val16 LABEL WORD mean?
7. I don't understand what you're talking about?
9. Yeah, I meant a 10 year old who never used Assembly Language before. So people will be thorogh with their explanation and not use ASM terminology.

hutch--

Hi Dotty,

Welcome on board. Don't look for an argument in here, its a waste of time, most here will help you if they understand the question.

Sounds like you are using Kip Irvine's book. His libraries and code are a bit different but most of it is standard MASM style code. Here are a few of the operators you have asked about.

OFFSET refers to data in either the initialised or UNinitialised data sections.
.DATA
  item dd 0
....
.CODE
  mov eax, OFFSET item  ; copy the ADDRESS of the variable "item" into the register EAX.

LABEL is a location in code that you can weither JUMP to or CALL.

The OVERFLOW flag is set when data overflows a register.

A procedure has advantages over simple labels, you can pass arguments to it on the stack. MASM uses the PROC / ENDP notation for procedures which allows you local variables and to pass arguments to the procedure.

DUP is a notation for making epeat data in the .DATA section.

.DATA
  byte_array 128 DUP (0)

The "?" notation in the .DATA section means the value is NOT initialised.

Understand this much, assembler programing ids an advanced subject that assumes you have enough experience to start it. This usually means knowing how to write Windows code in a proper compiler and at least having some understanding of how assembler programming works. You may be better off to start with a simpler task as you will have a better chance of succeeding that way.

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

NightWare

2. ex:
txt byte 10 dup(?) = txt byte 0,0,0,0,0,0,0,0,0,0 (or txt byte ?,?,?,?,?,?,?,?,?,?) it's to make things shorter...

4. mov esi,OFFSET bVal mean you put the memory location of bVal in esi, and not the content of bVal

5. you create a label with a size of WORD, but like explained in kip irvine's book, here it's a "virtual" size, in fact you just double the label val16=val32, but you can access the value stocked here with those 2 labels (with differents size)... hmm, you shoul forget that for the moment... it's not really usefull for a beginner

7. you need a skeleton (shearch on the forum you will find some...) in this skeleton there is a location for your procedures, a location for the entry point of your program, etc... it's a structured texte file (also named source code). if you download masm32 here : http://masm32.com/ you will find several examples (and you will learn more stuff than K.I.'s book, i know i have the same...)

9. exactly like me  :wink

dottywine

Thanks for the help. I didn't understand the LABEL thing still but someone who took computer science tried to figure it out with me. He said it is like a dummy variable and you can access the real variable with it or something... :/

I cannot choose what I learn. I am taking an assembly language class. I have a test tomorrow.

Yes, I am using Kip Irvine's book. Did he invent this?

Well... I'm looking at everything else I need to know for the test. It seems like I am only struggling with this OVERFLOW flag thing. Can someone explain it well to me? Very confused.
When I add hex, I change them to binary and then add them. So... I guess if both operands begin with 1 and their sum begin with 0 the OF is set? And if both begin with 0 and sum begin with 1 OF is set, as well.

I also need to study this multiple procedure thing a bit more. And have better understanding of how that affects the stack (meaning push pop instructions)

Farabi

Quote
Well... I'm looking at everything else I need to know for the test. It seems like I am only struggling with this OVERFLOW flag thing. Can someone explain it well to me? Very confused.

AX register is 16-bit so it can hold a value at maximum 0xFFFF (65535), if you use an instruction that cause it have a value more than it can handle you will have the OF flag set (CMIIW).
For example
mov ax,0FFFFh ; ax hold the maximum value
add ax,1      ; add ax with 1 so it have value 0x10000, but the register cannot hold it, so OF is set

To see how it really work I suggest you to temporary use emu 8086 if you had understand it use  OllyDbg.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

dottywine

Wait, woah... Please explain in simpler terms! Like I said, a 10 year old who has never seen assembler before.

I don't understand why you are bothering to put a 0 infront of all the FFFs. I don't understand how you know what the maximum value for each register is. I don't understand what  0XFFF is? I've never seen an X before in hex. And thanks for the emu suggestion, but I am confused enough as it is. I am not about to try and download something that runs a mini OS and all this other stuff I don't understand.

Farabi

Quote from: dottywine on October 27, 2008, 05:24:52 AM
Wait, woah... Please explain in simpler terms! Like I said, a 10 year old who has never seen assembler before.

I don't understand why you are bothering to put a 0 infront of all the FFFs. I don't understand how you know what the maximum value for each register is. I don't understand what  0XFFF is? I've never seen an X before in hex. And thanks for the emu suggestion, but I am confused enough as it is. I am not about to try and download something that runs a mini OS and all this other stuff I don't understand.
"0x" simbol mean it was a value on hex. "0" in front of FFFs is used on MASM to tell MASM if it was a hex value.
Register is used for holding a temporary value, and it have a limitation. For example, register AX only can hold a value of 65535 on decimal. You cannot make it have a value more than 65535 for example 65536. Tell me if it still not clear, sorry english is not my native language.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

hutch--

#9
hmmmmm,

> 9. Yeah, I meant a 10 year old who never used Assembly Language before. So people will be thorogh with their explanation and not use ASM terminology.

Understand this much, this forum is not a paid help desk and trying to dial in what people are supposed to respond to you with is both a waste of members time and bad mannered to boot. If you don't know the bare basics of assembler programming, make the effort to learn it as no-one here will do it for you.

If you don't know the type of stuff you are asking in here, it is because you have not done your course work correctly, we are not going to do it for you.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

rags

Quote from: dottywine on October 27, 2008, 04:08:06 AM
I cannot choose what I learn. I am taking an assembly language class. I have a test tomorrow.
I think you have to pay a little more attention in the classroom, and ask the teacher questions
when you don't understand something instead of waiting to the night before a test.
Also, where in the world is it required to teach 10 year olds assembly?
It's a quite advanced subject for someone that young.

God made Man, but the monkey applied the glue -DEVO

PauloH

Hello dottywine,

Why don't you learn C first ? It would make your steps a little smooth. I learned assembler when I was 13 (that old Z80 language).
I can see that you have trouble understanding the compiler itself and I recommend you study it with more attention. By the way, study any subject always and just not the day before your test (this applies for any student in the world). Masm is not so difficult like that and X86 assembler is easier than you think.

Kind regards,
Paulo H.

jj2007

Quote from: rags on October 27, 2008, 09:23:41 AM
Also, where in the world is it required to teach 10 year olds assembly?
It's a quite advanced subject for someone that young.


Rags, you misunderstood him: He wanted answer as if he was ten years old. Probably, he is over 20 - but anyway, he behaves like a ten-year old single child: "I have a test tomorrow, hey guys, teach me assembly, quickly!!".  :cheekygreen:

MichaelW

You can find an answer for most of your questions in the MASM manuals, available here:

http://webster.cs.ucr.edu/Page_TechDocs/index.html

eschew obfuscation

dottywine

First of all, I am a "she". (usually my username is questionable, but I thought this may have been girly enough)
Second of all, I am definitely not over 20.

Hey, I apologize if I am coming off as ill-mannered. Listen, I see my professor quite often. I ask a lot of questions in class. I'm not a bad student. These questions are last minute things that I may have forgotten to ask in class. I thought this forum is supposed to help those without judging them.

Thankyou to those who did help.

Also, to the Farabi, do you know of some rules I can use to know the limit of the registers?

Micheal, thanks for the link. I'm not exactly sure where to find some basics. It looks like there is information on how to make it look nice and documented, but if you know of some more links with the basics, then I would appreciate it.

Also, to whomever said I need to learn C... My dad gave me a book on C when I was 10 and I was getting confused so I put it off for a very long time. I learned java and its really easy! Now, I am learning C++ and Assembler at the same time. I'm having trouble. I'm just now beginning for figure them out.