Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
LDA myBoolean
BNE isTrue
;code that would execute if myBoolean is false, goes here.
RTS
isTrue:
;code that would execute if myBoolean is true, goes here.
RTS

View file

@ -0,0 +1,3 @@
if(myValue == 3 && myOtherValue == 5){
myResult = true;
}

View file

@ -0,0 +1,15 @@
LDA myValue
CMP #3
BNE .skip
;if we got to here, "myValue == 3" evaluated to true.
LDA myOtherValue
CMP #5
BNE .skip
;if we got to here, both "myValue == 3" and "myOtherValue" == 5 evaluated to true.
STA myResult ;any nonzero value is considered TRUE, so we've stored 5 into myResult.
.skip:

View file

@ -0,0 +1,3 @@
if(myValue == 3 || myOtherValue == 5){
myResult = true;
}

View file

@ -0,0 +1,16 @@
LDA myValue
CMP #3
BEQ .doTheThing
;if not equal, check myOtherValue
LDA myOtherValue
CMP #5
BNE .skip
;if we got to here, either "myValue == 3" or "myOtherValue" == 5 evaluated to true.
.doTheThing:
STA myResult ;any nonzero value is considered TRUE, so we've stored 5 into myResult.
.skip:

View file

@ -0,0 +1,9 @@
LDA flags
LSR ;test the rightmost bit.
BCC .skip
LSR ;test the bit just to the left of the one we tested prior.
BCC .skip
;your code for what happens when both of the bottom 2 bits are 1, goes here.
.skip:

View file

@ -0,0 +1,3 @@
BIT myBitFlags
BMI .Bit7Set
BVS .Bit6Set