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.
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...
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.
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.
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
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)
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 (http://www.emu8086.com/") if you had understand it use OllyDbg.
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.
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.
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.
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.
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.
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:
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
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.
Hi,
Quotedo you know of some rules I can use to know the limit of the registers?
Well an eight bit register can hold unsigned values from zero to 2^8 - 1
(two to the eighth power minus 1) or 255 decimal, A 16 bit register holds
0 to 2^16 - 1 which is 65535. And 32 bit is left as an exercise.
As to a label, if you think of memory as a sequence of numbered bytes, 0,
1, 2, 3, ... N, and you pretend they are pages in a book, then I can tell you
to go to page 20, you can do it. But now I "label" some of the pages, I
can now tell you to go to chapter two. Labels are a convenience to us
humans so we don't have to count bytes.
HTH,
Steve N.
Quote from: PauloH on October 27, 2008, 11:20:17 AM
Why don't you learn C first ? It would make your steps a little smooth.
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.
I agree,too. I think you could learn C first.After you exactly know the ABCs of program and programming,to learn Assembly languages will be more easier,I think.
Regards,
David Feng
Quote from: dottywine on October 27, 2008, 04:24:37 PM
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.
The information in the manuals is the basics, just not in a condensed form.
QuoteWhat are some ways to "process" an array?
See Defining and Using Complex Data Types
here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_05.htm).
QuoteWhat is DUP(?)?
See the above link, under Declaring and Referencing Arrays, The DUP Operator.
QuoteWhat does it mean if there is a question mark? ex: var1 WORD ?
See Defining and Using Simple Data Types
here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_04.htm), under Data Initialization.
QuoteWhat is the OFFSET operator?
See Using Addresses and Pointers
here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_03.htm), under Immediate Operands.
QuoteWhat is the LABEL operator?
LABEL is a directive. See Directives
here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ReferenceGuide/Chap_02.htm).
QuoteWhen is the overflow flag set?
See Understanding Global Concepts
here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_01.htm), under Flags Register.
QuoteHow do you make a code with multiple procedures?
See Controlling Program Flow
here (http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_07.htm), under Procedures.
QuoteWhy make multiple procedures when you can just have different labels that you can jump to?
See the above link, and consider the many features that procedures provide, that would need to be coded manually with a label.
Wow! Gracias, grazi :)
Quote from: dottywine on October 27, 2008, 04:24:37 PM
Hey, I apologize if I am coming off as ill-mannered.
My apologies. Absolutely no idea how I got that totally wrong impression.
Quote
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.
We are
very helpful in general. The problem is some of us old folks here start from the assumption that you first read the manuals, then come to ask specific questions :wink
Welcome on board - we expect many good questions from you.
Also Dotty, if you have already downloaded the MASM32 package and installed it, then study the \masm32\help\ASMINTRO.CHM file and others. These provide key information for starting this journey. BTW, congratulations on taking an assembly language programming course. :bg
Over the years, quite a few students have asked questions stemming from Kip's book. However, just so you know, most of the answers are from people whom have never read that book -- so our answers are going to lean more towards the MASM32 package, or assembly language in general. (I know that Kip uses some libraries and stuff in his book which we obviously do not have, and will not be able to help you with. But general questions are fine.)
Quote from: dottywine on October 27, 2008, 04:08:06 AM
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... :/
Hi dottywine,
dummy variable ? variable ? Hummmm
See this code:
Quote
cmp eax, 5 means -> compare EAX with 5
jne _notequal " -> jump to the LABEL _notequal if not equal
mov eax, 10
_notequal:
So, the label means an address to where we want to jump if eax is
not equal to 5. I wrote «_notequal» but it can be one name we choose.
In the Data Section, we can use the name LABEL
to mark an address where we reserve some bytes. For instance:
Quote
.data
_space20 label byte here is the initial address _space20
db 20 dup (?) here we reserve 20 bytes
Sorry if it doesnt help you
Rui
Hi dottywine,
QuoteSecond of all, I am definitely not over 20.
I'm getting confused that you'd hided your age. it's girly enough.
today learnning Assembler is luck. more help documents,editors, Compilers, OS, debugers,high performance computer,and more examples are there.
Hutch-- and his copartners let it's more easily. likes C language.
when i learned Assembler, pen and paper was the editor. books and Instruction tables was Compiler. computer was a piece of integrate circuit. Monitor was LED. no OS. I had to translate a bit coders into binary and input integrate circuit with hands for running.
I don't know if jj is being sarcastic or not, but I hope I don't have to block someone so soon on a forum.
Thankyou everyone for the more information!
six_L, hi, you are like my dad. He told me coding now is so easy. It makes me feel dumb. I hid my age for no particular reason. I usually don't hide my age. I'm too lazy to go and change that. I'm surprised my age is hidden. Maybe I didn't want to be discriminated against or anything... the last time I joined a forum with older members, I got picked on a lot by older women because I was younger than them.
Ms. dottywine ,
You don't need to be ashamed for your age. You are welcome, no matter if you're 10 or 20 etc. I'm not a professional programmer and I can tell you that any task in our life is very difficult... But once we study (and practice) it as a continuous process the shadows become thin and our vision better. The understanding of programming you want is a matter of time. Don't give up and go on with baby steps.
Visit some links like these:
The fasm forum http://board.flatassembler.net/index.php
The goasm assembler: http://www.jorgon.freeserve.co.uk/
Please, note that the syntax is different from one compiler to another.
When I told you to learn C I was talking seriously! I learned C just one year ago and loved it. Give it another try. :U
Kind regards,
Paulo H.
dottywine,
Welcome. Here is a link to the MASM Programmer's Guide (http://www.box.net/shared/qkpzlg42hf) in a help file format.