Added new runtime sub bcasta/bcastax/bcasteax opposing to bnega/bnegax/bnegeax.
This commit is contained in:
21
libsrc/runtime/bcast.s
Normal file
21
libsrc/runtime/bcast.s
Normal file
@@ -0,0 +1,21 @@
|
||||
;
|
||||
; acqn, 01.16.2020
|
||||
;
|
||||
; CC65 runtime: boolean cast
|
||||
;
|
||||
|
||||
.export bcasta, bcastax
|
||||
|
||||
bcastax:
|
||||
cpx #0
|
||||
bne L1
|
||||
|
||||
bcasta:
|
||||
tax
|
||||
beq L0 ; Zero already in X
|
||||
|
||||
L1: ldx #0
|
||||
lda #1
|
||||
|
||||
L0: rts
|
||||
|
||||
20
libsrc/runtime/lbcast.s
Normal file
20
libsrc/runtime/lbcast.s
Normal file
@@ -0,0 +1,20 @@
|
||||
;
|
||||
; acqn, 01.16.2020
|
||||
;
|
||||
; CC65 runtime: boolean cast for longs
|
||||
;
|
||||
|
||||
.export bcasteax
|
||||
.importzp sreg, tmp1
|
||||
|
||||
bcasteax:
|
||||
stx tmp1
|
||||
ldx #0 ; High byte of result
|
||||
ora tmp1
|
||||
ora sreg
|
||||
ora sreg+1
|
||||
beq L0
|
||||
|
||||
lda #1
|
||||
L0: rts
|
||||
|
||||
Reference in New Issue
Block a user