If/Else Statements in ASM

jakenastysnake

New member
Good afternoon,

Could anybody shed some light on how to write IF and IF/ELSE statements in assembly code? Hope this makes sense.

For example, if I was using Text Entry0 and Entry1 and wanted to immediately display Entry1 after Entry0 has displayed:

if ( Text Entry1 IS NOT Blank )
{

Then display Text Entry1

} else
{

Close Text Entry0

}
 

dale_coop

Moderator
Staff member
If you want to display a Text 1, then a Text 2...
you could just use ">" at the end of your first text, to have a new page of dialog...:
<Entry 1>
This my text that
is displayed on the
first page>
This is my text that
is displayed on the
second page>
This is the text
on my last page

Now you will have 3 pages of text, displayed one after the other.
 

Bucket Mouse

Active member
To answer the original question, first you load up a value or a variable with LDA, then you use CMP (compare) to compare it to the condition you want. If you want something to happen if the condition is equal, you use BEQ (Branch If Equal) to lead to the code for that condition. if you want something to happen when the condition is NOT equal you use BNE (Branch If Not Equal).
 

jakenastysnake

New member
Bucket Mouse said:
To answer the original question, first you load up a value or a variable with LDA, then you use CMP (compare) to compare it to the condition you want. If you want something to happen if the condition is equal, you use BEQ (Branch If Equal) to lead to the code for that condition. if you want something to happen when the condition is NOT equal you use BNE (Branch If Not Equal).

Thanks @Bucket Mouse. I'm going to play around with some of the scripts and see what I can come up with.

Both replies are greatly appreciated!
 
Top Bottom