added cx16.cpu_is_65816()

This commit is contained in:
Irmen de Jong 2024-01-18 19:30:18 +01:00
parent fdbbd181ea
commit 03831a7394

View File

@ -1156,6 +1156,20 @@ sub search_x16edit() -> ubyte {
return 255
}
asmsub cpu_is_65816() -> bool @A {
; Returns true if you have a 65816 cpu, false if it's a 6502.
; for Prog8 with the 64tass assembler, call in 8 bit mode only
%asm {{
.cpu '65816' ; let 64tass use the xba opcode
lda #1 ; set up for a <> b exchange
xba ; exchange will be a nop on a 65C02
lda #0 ; set up for second exchange
xba ; exchange will be a nop on the 65C02
rts
.cpu 'w65c02'
}}
}
}
sys {