Instruction like "if" 
Author Message
 Instruction like "if"

Hi all!
Is there an Assembler instruction like the "if" of the high level language
(ex. Pascal)?
Thanx, Alby.



Wed, 21 Jun 2000 03:00:00 GMT  
 Instruction like "if"

Quote:

> Is there an Assembler instruction like the "if" of the high level language

Alby.

There is not any single instruction that corresponds to an HLL "if"
instruction.  In assembly language you have to "roll your own."  This
means that you have to do the comparison with the cmp, sub, or test
instuction the use one of the conditional jump instuction to branch to
the appropriate action.

Get one of the tutorials on the Internet.  I recommend Randy Hyde's _The
Art of Assembly Language_" as it should have this well explained.

To find these tutorials, get the FAQ for this newsgroup and read subject
#23 in which I describe all the tutorials with their URLs that I have
found on the internet.

I upload the FAQ to alt.lang.asm, comp.lang.x86.asm, news.answers,
comp.answers, and alt.answers on or about the 21st of every month.

Quote:
>From that posting, the FAQ is archived at rtfm.mit.edu under those two

lang newsgroups.  You can download the FAQ using anonymous ftp.  Also,
I zip the FAQ and upload it to SimTel in the msdos/info directory.
The filename of the latest is asm9801t.zip for the text version and
asm9801h.zip for the html version.  Lastly, the FAQ is available for
viewing and downloading from my web site.  See my .sig below.

Hope that this helps.

Ray
=====================================================================
Ray Moon

http://www2.dgsys.com/~raymoon/moonware.html
Home of MoonWare Shareware and the x86 Assembly Language FAQ
Come steal my pages...   Well, not steal but come and see!



Thu, 22 Jun 2000 03:00:00 GMT  
 Instruction like "if"

Quote:

> Hi all!
> Is there an Assembler instruction like the "if" of the high level language
> (ex. Pascal)?
> Thanx, Alby.


Here you would implement a series of Assembly instructions that would
mimic the "if" statement.  For example:

cmp register1, register2       ;compare these two values
jb  proc1                      ;jump to proc1 heading if register1? is                                                  
below. If not goto next stmt.
ja  proc2                      ;this would be equiv to an else stmt,
                                because if jb doesn't return a 'true'
                                value, then the next stmt (this one)                            gets
executed.

Well there you have it, my amatuer attempt at answering this question.
Feel free to correct me where necessary guys!  Remember, I haven't coded
in Assembly for quite some time.



Fri, 23 Jun 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

2. Availability of "N3" instructions

3. "0xC0000096: Privileged instruction"

4. P4's "PAUSE" instruction

5. "out" instruction

6. "OUT" Instruction

7. Pentium III "katmai" instructions

8. MASM instruction "s" bit question

9. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

10. Parsing ""D""?

11. "Fifth", "Forth", zai nar?

12. Ruby "finalize", "__del__"

 

 
Powered by phpBB® Forum Software