2023-12-09 20:48:22 +00:00
|
|
|
%import textio
|
2023-12-12 23:53:01 +00:00
|
|
|
%import string
|
2023-12-09 20:48:22 +00:00
|
|
|
%zeropage basicsafe
|
|
|
|
|
2023-10-15 20:44:34 +00:00
|
|
|
main {
|
2023-11-12 19:40:17 +00:00
|
|
|
sub start() {
|
2023-12-13 01:26:56 +00:00
|
|
|
if test_c_set()
|
2023-12-13 20:54:19 +00:00
|
|
|
txt.print("yes1\n")
|
2023-12-13 01:26:56 +00:00
|
|
|
else
|
2023-12-13 20:54:19 +00:00
|
|
|
goto skip1
|
2023-12-13 01:26:56 +00:00
|
|
|
|
2023-12-13 20:54:19 +00:00
|
|
|
txt.print("no1\n")
|
2023-12-13 01:26:56 +00:00
|
|
|
|
2023-12-13 20:54:19 +00:00
|
|
|
skip1:
|
2023-12-13 01:26:56 +00:00
|
|
|
if test_c_clear()
|
2023-12-13 20:54:19 +00:00
|
|
|
txt.print("yes2\n")
|
2023-12-13 01:26:56 +00:00
|
|
|
else
|
2023-12-13 20:54:19 +00:00
|
|
|
goto skip2
|
2023-12-13 01:26:56 +00:00
|
|
|
|
2023-12-13 20:54:19 +00:00
|
|
|
txt.print("no1\n")
|
2023-12-12 23:53:01 +00:00
|
|
|
|
2023-12-13 20:54:19 +00:00
|
|
|
skip2:
|
|
|
|
txt.print("done\n")
|
2023-12-13 01:26:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
asmsub test_c_clear() -> bool @Pc {
|
|
|
|
%asm {{
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub test_z_clear() -> bool @Pz {
|
|
|
|
%asm {{
|
|
|
|
lda #1
|
|
|
|
rts
|
|
|
|
}}
|
2023-12-12 23:53:01 +00:00
|
|
|
}
|
|
|
|
|
2023-12-13 01:26:56 +00:00
|
|
|
asmsub test_n_clear() -> bool @Pn {
|
|
|
|
%asm {{
|
|
|
|
lda #1
|
|
|
|
rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub test_v_clear() -> bool @Pv {
|
|
|
|
%asm {{
|
|
|
|
clv
|
|
|
|
rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub test_c_set() -> bool @Pc {
|
|
|
|
%asm {{
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub test_z_set() -> bool @Pz {
|
2023-12-12 23:53:01 +00:00
|
|
|
%asm {{
|
|
|
|
lda #0
|
|
|
|
rts
|
|
|
|
}}
|
2023-11-14 17:23:37 +00:00
|
|
|
}
|
2023-12-13 01:26:56 +00:00
|
|
|
|
|
|
|
asmsub test_n_set() -> bool @Pn {
|
|
|
|
%asm {{
|
|
|
|
lda #-1
|
|
|
|
rts
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
asmsub test_v_set() -> bool @Pv {
|
|
|
|
%asm {{
|
|
|
|
bit +
|
|
|
|
+ rts
|
|
|
|
}}
|
|
|
|
}
|
2023-10-03 20:54:28 +00:00
|
|
|
}
|