Compile-time calculation: Difference between revisions
→{{header|6502 Assembly}}: let cl65 provide the header
(→{{header|6502 Assembly}}: Add implementation.) |
(→{{header|6502 Assembly}}: let cl65 provide the header) |
||
Line 66:
fac = $61 ; location of the floating point accumulator used by ROM routines
facsgn = fac+5 ; specific location of the sign byte
; ROM routines used
Line 78 ⟶ 74:
movfm = $bbd4 ; copy FAC to memory
.code
; 65536 as a float for multiplying the top half▼
fp65536: .byte 145,0,0,0,0,0▼
; the actual value to print▼
tenfactorial: .dword 10*9*8*7*6*5*4*3*2*1▼
; a place to stash partial results whlie using the FAC for other operations▼
fac_copy: .res 6▼
; convert the upper half
ldy tenfactorial+2
Line 141 ⟶ 114:
; and print out the result
jsr putfac
rts
.data
▲fp65536: .byte 145,0,0,0,0,0
▲; the actual value to print
▲tenfactorial: .dword 10*9*8*7*6*5*4*3*2*1
.bss
▲; a place to stash partial results whlie using the FAC for other operations
▲fac_copy: .res 6</lang>
{{Out}}
|