2024-01-04 15:02:21 +01:00
|
|
|
%import textio
|
2023-12-31 01:02:33 +01:00
|
|
|
%zeropage basicsafe
|
2024-01-04 00:30:20 +01:00
|
|
|
%option no_sysinit
|
2023-12-31 01:02:33 +01:00
|
|
|
|
2023-10-15 22:44:34 +02:00
|
|
|
main {
|
2023-12-30 04:34:07 +01:00
|
|
|
sub start() {
|
2024-01-04 23:45:46 +01:00
|
|
|
; is optimizing this useful? : not a1 or not a2 -> not(a1 and a2) likewise for and.
|
|
|
|
bool @shared a1 = true
|
|
|
|
bool @shared a2
|
2024-01-05 00:26:56 +01:00
|
|
|
bool @shared a
|
|
|
|
bool @shared b
|
2024-01-04 20:44:46 +01:00
|
|
|
|
2024-01-05 00:26:56 +01:00
|
|
|
; absorbption opt:
|
|
|
|
; if a or (a and b)
|
|
|
|
; cx16.r0 ++
|
|
|
|
; if a or (b and a)
|
|
|
|
; cx16.r0 ++
|
|
|
|
; if a and (a or b)
|
|
|
|
; cx16.r0 ++
|
|
|
|
; if a and (b or a)
|
|
|
|
; cx16.r0 ++
|
|
|
|
;
|
|
|
|
; ; no opt:
|
|
|
|
; if a and (b and a)
|
|
|
|
; cx16.r0 ++
|
|
|
|
; if a or (b or a)
|
|
|
|
; cx16.r0 ++
|
2024-01-04 23:45:46 +01:00
|
|
|
|
2024-01-05 00:26:56 +01:00
|
|
|
bool @shared iteration_in_progress = false
|
|
|
|
ubyte @shared num_bytes = 99
|
2024-01-04 23:45:46 +01:00
|
|
|
|
2024-01-05 00:26:56 +01:00
|
|
|
if not iteration_in_progress or not num_bytes
|
|
|
|
txt.print("yep1")
|
|
|
|
else
|
|
|
|
txt.print("nope1")
|
2024-01-04 23:45:46 +01:00
|
|
|
|
2024-01-05 00:26:56 +01:00
|
|
|
iteration_in_progress = true
|
|
|
|
if not iteration_in_progress or not num_bytes
|
|
|
|
txt.print("yep2")
|
|
|
|
else
|
|
|
|
txt.print("nope2")
|
|
|
|
|
|
|
|
;
|
|
|
|
; if a1==0 and a2==0
|
|
|
|
; cx16.r0++
|
|
|
|
;
|
|
|
|
; if (a1!=0 or a2!=0)==0
|
|
|
|
; cx16.r0++
|
|
|
|
;
|
|
|
|
; if a1==0 or a2==0
|
|
|
|
; cx16.r0++
|
|
|
|
;
|
|
|
|
; if (a1!=0 and a2!=0)==0
|
|
|
|
; cx16.r0++
|
2024-01-04 23:45:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
; if not a1 or not a2
|
|
|
|
; cx16.r0++
|
|
|
|
; if not (a1 and a2)
|
|
|
|
; cx16.r0++
|
|
|
|
; if not a1 and not a2
|
|
|
|
; cx16.r0++
|
|
|
|
; if not (a1 or a2)
|
|
|
|
; cx16.r0++
|
2023-12-26 22:01:49 +01:00
|
|
|
}
|
2023-12-19 22:59:01 +01:00
|
|
|
}
|