view release on metacpan or search on metacpan
t/data/zx48.asm view on Meta::CPAN
RST 28H ;; FP-CALC add step and re-store
DEFB $E0 ;;get-mem-0 v.
DEFB $E2 ;;get-mem-2 v,s.
DEFB $0F ;;addition v+s.
DEFB $C0 ;;st-mem-0 v+s.
DEFB $02 ;;delete .
DEFB $38 ;;end-calc
CALL L1DDA ; routine NEXT-LOOP tests against limit.
RET C ; return if no more iterations possible.
LD HL,($5C68) ; find start of variable contents from MEM.
LD DE,$000F ; add 3*5 to
ADD HL,DE ; address the looping line number
LD E,(HL) ; low byte to E
INC HL ;
LD D,(HL) ; high byte to D
INC HL ; address looping statement
LD H,(HL) ; and store in H
EX DE,HL ; swap registers
t/data/zx48.asm view on Meta::CPAN
;; REPORT-1
L1DD8: RST 08H ; ERROR-1
DEFB $00 ; Error Report: NEXT without FOR
; -----------------
; Perform NEXT loop
; -----------------
; This routine is called from the FOR command to test for an initial
; iteration and from the NEXT command to test for all subsequent iterations.
; the system variable MEM addresses the variable's contents which, in the
; latter case, have had the step, possibly negative, added to the value.
;; NEXT-LOOP
L1DDA: RST 28H ;; FP-CALC
DEFB $E1 ;;get-mem-1 l.
DEFB $E0 ;;get-mem-0 l,v.
DEFB $E2 ;;get-mem-2 l,v,s.
DEFB $36 ;;less-0 l,v,(1/0) negative step ?
DEFB $00 ;;jump-true l,v.(1/0)
DEFB $02 ;;to L1DE2, NEXT-1 if step negative
DEFB $01 ;;exchange v,l.
;; NEXT-1
L1DE2: DEFB $03 ;;subtract l-v OR v-l.
DEFB $37 ;;greater-0 (1/0)
DEFB $00 ;;jump-true .
DEFB $04 ;;to L1DE9, NEXT-2 if no more iterations.
DEFB $38 ;;end-calc .
AND A ; clear carry flag signalling another loop.
RET ; return
; ---
;; NEXT-2
L1DE9: DEFB $38 ;;end-calc .
t/data/zx48.asm view on Meta::CPAN
; THE 'SERIES GENERATOR' ROUTINE
; ------------------------------
; (offset: $86 'series-06')
; (offset: $88 'series-08')
; (offset: $8C 'series-0C')
; The Spectrum uses Chebyshev polynomials to generate approximations for
; SIN, ATN, LN and EXP. These are named after the Russian mathematician
; Pafnuty Chebyshev, born in 1821, who did much pioneering work on numerical
; series. As far as calculators are concerned, Chebyshev polynomials have an
; advantage over other series, for example the Taylor series, as they can
; reach an approximation in just six iterations for SIN, eight for EXP and
; twelve for LN and ATN. The mechanics of the routine are interesting but
; for full treatment of how these are generated with demonstrations in
; Sinclair BASIC see "The Complete Spectrum ROM Disassembly" by Dr Ian Logan
; and Dr Frank O'Hara, published 1983 by Melbourne House.
;; series-xx
L3449: LD B,A ; parameter $00 - $1F to B counter
CALL L335E ; routine GEN-ENT-1 is called.
; A recursive call to a special entry point
; in the calculator that puts the B register
t/data/zx48_base.asm view on Meta::CPAN
rst 0x28 ; ; FP-CALC add step and re-store
defb 0xE0 ; ;get-mem-0 v.
defb 0xE2 ; ;get-mem-2 v,s.
defb 0x0F ; ;addition v+s.
defb 0xC0 ; ;st-mem-0 v+s.
defb 0x02 ; ;delete .
defb 0x38 ; ;end-calc
call NEXT_LOOP ; routine NEXT-LOOP tests against limit.
ret c ; return if no more iterations possible.
ld hl,(0x5C68) ; find start of variable contents from MEM.
ld de,0x000F ; add 3*5 to
add hl,de ; address the looping line number
ld e,(hl) ; low byte to E
inc hl
ld d,(hl) ; high byte to D
inc hl ; address looping statement
ld h,(hl) ; and store in H
ex de,hl ; swap registers
t/data/zx48_base.asm view on Meta::CPAN
;; REPORT-1
REPORT_1:
rst 0x08 ; ERROR-1
defb 0x00 ; Error Report: NEXT without FOR
; -----------------
; Perform NEXT loop
; -----------------
; This routine is called from the FOR command to test for an initial
; iteration and from the NEXT command to test for all subsequent iterations.
; the system variable MEM addresses the variable's contents which, in the
; latter case, have had the step, possibly negative, added to the value.
;; NEXT-LOOP
NEXT_LOOP:
rst 0x28 ; ; FP-CALC
defb 0xE1 ; ;get-mem-1 l.
defb 0xE0 ; ;get-mem-0 l,v.
defb 0xE2 ; ;get-mem-2 l,v,s.
defb 0x36 ; ;less-0 l,v,(1/0) negative step ?
t/data/zx48_base.asm view on Meta::CPAN
defb 0x02 ; ;to L1DE2, NEXT-1 if step negative
defb 0x01 ; ;exchange v,l.
;; NEXT-1
NEXT_1:
defb 0x03 ; ;subtract l-v OR v-l.
defb 0x37 ; ;greater-0 (1/0)
defb 0x00 ; ;jump-true .
defb 0x04 ; ;to L1DE9, NEXT-2 if no more iterations.
defb 0x38 ; ;end-calc .
and a ; clear carry flag signalling another loop.
ret ; return
; ---
;; NEXT-2
NEXT_2:
t/data/zx48_base.asm view on Meta::CPAN
; THE 'SERIES GENERATOR' ROUTINE
; ------------------------------
; (offset: $86 'series-06')
; (offset: $88 'series-08')
; (offset: $8C 'series-0C')
; The Spectrum uses Chebyshev polynomials to generate approximations for
; SIN, ATN, LN and EXP. These are named after the Russian mathematician
; Pafnuty Chebyshev, born in 1821, who did much pioneering work on numerical
; series. As far as calculators are concerned, Chebyshev polynomials have an
; advantage over other series, for example the Taylor series, as they can
; reach an approximation in just six iterations for SIN, eight for EXP and
; twelve for LN and ATN. The mechanics of the routine are interesting but
; for full treatment of how these are generated with demonstrations in
; Sinclair BASIC see "The Complete Spectrum ROM Disassembly" by Dr Ian Logan
; and Dr Frank O'Hara, published 1983 by Melbourne House.
;; series-xx
series_xx:
ld b,a ; parameter $00 - $1F to B counter
call GEN_ENT_1 ; routine GEN-ENT-1 is called.
; A recursive call to a special entry point
t/data/zx48_benchmark.asm view on Meta::CPAN
rst $28 ; ; FP-CALC add step and re-store
defb $E0 ; ;get-mem-0 v.
defb $E2 ; ;get-mem-2 v,s.
defb $0F ; ;addition v+s.
defb $C0 ; ;st-mem-0 v+s.
defb $02 ; ;delete .
defb $38 ; ;end-calc
call NEXT_LOOP ; routine NEXT-LOOP tests against limit.
ret c ; return if no more iterations possible.
ld hl, (MEM) ; find start of variable contents from MEM.
ld de, $000F ; add 3*5 to
add hl, de ; address the looping line number
ldi de, (hl) ; low byte to E
; high byte to D
; address looping statement
ld h, (hl) ; and store in H
ex de, hl ; swap registers
jp GO_TO_2 ; exit via GO-TO-2 to execute another loop.
t/data/zx48_benchmark.asm view on Meta::CPAN
REPORT_1:
rst $08 ; ERROR-1
defb $00 ; Error Report: NEXT without FOR
; -----------------
; Perform NEXT loop
; -----------------
; This routine is called from the FOR command to test for an initial
; iteration and from the NEXT command to test for all subsequent iterations.
; the system variable MEM addresses the variable's contents which, in the
; latter case, have had the step, possibly negative, added to the value.
;; NEXT-LOOP
NEXT_LOOP:
rst $28 ; ; FP-CALC
defb $E1 ; ;get-mem-1 l.
defb $E0 ; ;get-mem-0 l,v.
defb $E2 ; ;get-mem-2 l,v,s.
t/data/zx48_benchmark.asm view on Meta::CPAN
defb $01 ; ;exchange v,l.
;; NEXT-1
NEXT_1:
defb $03 ; ;subtract l-v OR v-l.
defb $37 ; ;greater-0 (1/0)
defb $00 ; ;jump-true .
defb $04 ; ;to L1DE9, NEXT-2 if no more iterations.
defb $38 ; ;end-calc .
and a ; clear carry flag signalling another loop.
ret ; return
; ---
;; NEXT-2
t/data/zx48_benchmark.asm view on Meta::CPAN
; THE 'SERIES GENERATOR' ROUTINE
; ------------------------------
; (offset: $86 'series-06')
; (offset: $88 'series-08')
; (offset: $8C 'series-0C')
; The Spectrum uses Chebyshev polynomials to generate approximations for
; SIN, ATN, LN and EXP. These are named after the Russian mathematician
; Pafnuty Chebyshev, born in 1821, who did much pioneering work on numerical
; series. As far as calculators are concerned, Chebyshev polynomials have an
; advantage over other series, for example the Taylor series, as they can
; reach an approximation in just six iterations for SIN, eight for EXP and
; twelve for LN and ATN. The mechanics of the routine are interesting but
; for full treatment of how these are generated with demonstrations in
; Sinclair BASIC see "The Complete Spectrum ROM Disassembly" by Dr Ian Logan
; and Dr Frank O'Hara, published 1983 by Melbourne House.
;; series-xx
series_xx:
ld b, a ; parameter $00 - $1F to B counter
call GEN_ENT_1 ; routine GEN-ENT-1 is called.
t/data/zx81.asm view on Meta::CPAN
; THE 'SERIES GENERATOR' SUBROUTINE
; ---------------------------------
; offset $86: 'series-06'
; offset $88: 'series-08'
; offset $8C: 'series-0C'
; The ZX81 uses Chebyshev polynomials to generate approximations for
; SIN, ATN, LN and EXP. These are named after the Russian mathematician
; Pafnuty Chebyshev, born in 1821, who did much pioneering work on numerical
; series. As far as calculators are concerned, Chebyshev polynomials have an
; advantage over other series, for example the Taylor series, as they can
; reach an approximation in just six iterations for SIN, eight for EXP and
; twelve for LN and ATN. The mechanics of the routine are interesting but
; for full treatment of how these are generated with demonstrations in
; Sinclair BASIC see "The Complete Spectrum ROM Disassembly" by Dr Ian Logan
; and Dr Frank O'Hara, published 1983 by Melbourne House.
;; series-xx
series_xx:
ld b, a ; parameter $00 - $1F to B counter
call GEN_ENT_1 ; routine GEN-ENT-1 is called.
t/data/zx81.ctl view on Meta::CPAN
:#; THE 'SERIES GENERATOR' SUBROUTINE
:#; ---------------------------------
:#; offset $86: 'series-06'
:#; offset $88: 'series-08'
:#; offset $8C: 'series-0C'
:#; The ZX81 uses Chebyshev polynomials to generate approximations for
:#; SIN, ATN, LN and EXP. These are named after the Russian mathematician
:#; Pafnuty Chebyshev, born in 1821, who did much pioneering work on numerical
:#; series. As far as calculators are concerned, Chebyshev polynomials have an
:#; advantage over other series, for example the Taylor series, as they can
:#; reach an approximation in just six iterations for SIN, eight for EXP and
:#; twelve for LN and ATN. The mechanics of the routine are interesting but
:#; for full treatment of how these are generated with demonstrations in
:#; Sinclair BASIC see "The Complete Spectrum ROM Disassembly" by Dr Ian Logan
:#; and Dr Frank O'Hara, published 1983 by Melbourne House.
:#
:#;; series-xx
1A7F 47 ld b, a :C series_xx
:; parameter $00 - $1F to B counter
1A80:C
t/data/zx81_version_2_rom_source.asm view on Meta::CPAN
; THE 'SERIES GENERATOR' SUBROUTINE
; ---------------------------------
; offset $86: 'series-06'
; offset $88: 'series-08'
; offset $8C: 'series-0C'
; The ZX81 uses Chebyshev polynomials to generate approximations for
; SIN, ATN, LN and EXP. These are named after the Russian mathematician
; Pafnuty Chebyshev, born in 1821, who did much pioneering work on numerical
; series. As far as calculators are concerned, Chebyshev polynomials have an
; advantage over other series, for example the Taylor series, as they can
; reach an approximation in just six iterations for SIN, eight for EXP and
; twelve for LN and ATN. The mechanics of the routine are interesting but
; for full treatment of how these are generated with demonstrations in
; Sinclair BASIC see "The Complete Spectrum ROM Disassembly" by Dr Ian Logan
; and Dr Frank O'Hara, published 1983 by Melbourne House.
;; series-xx
L1A7F: LD B,A ; parameter $00 - $1F to B counter
CALL L19A0 ; routine GEN-ENT-1 is called.
; A recursive call to a special entry point
; in the calculator that puts the B register