
Thanks for that great rom
Siggi
Code: Select all
;
; The initialization phase.
;
.db $3A ;;mul-by-2 2*x
DEFB $C0 ;;st-mem-0 2*x
DEFB $02 ;;delete .
DEFB $A0 ;;stk-zero 0
;;- DEFB $C2 ;;st-mem-2 0
.db $C1 ;;st-mem-1 0
.db $2D ;;duplicate 0,0.
.db $2F ;;jump
.db G_LOOP1-$ ;;to G-LOOP1 - skip the 1st round
;
; a loop is now entered to perform the algebraic calculation for each of
; the numbers in the series
;
G_LOOP
DEFB $2D ;;duplicate v,v. (old round 1: 0,0)
DEFB $E0 ;;get-mem-0 v,v,2*x (old round 1: 0,0,2x)
DEFB $04 ;;multiply v,v*2*x (old round 1: 0,0)
DEFB $E2 ;;get-mem-2 v,v*2*x,v (old round 1: 0,0,0)
DEFB $C1 ;;st-mem-1 v,v*2*x,v (old round 1: 0,0,0)
DEFB $03 ;;subtract v,v*2*x-v (old round 1: 0,0)
G_LOOP1
DEFB $34 ;;end-calc
;
; the previous pointer is fetched from the machine stack to H'L' where it
; addresses one of the numbers of the series following the series literal.
;
CALL stk_data ; routine STK-DATA is called directly to
; push a value and advance H'L'.
CALL GEN_ENT2 ; routine GEN-ENT-2 recursively re-enters
; the calculator without disturbing
; system variable BREG
; H'L' value goes on the machine stack and is
; then loaded as usual with the next address.
DEFB $0F ;;addition
DEFB $01 ;;exchange
DEFB $C2 ;;st-mem-2
DEFB $02 ;;delete
DEFB $31 ;;dec-jr-nz
DEFB G_LOOP-$ ;;back to G-LOOP
;
I could maybe see why the Next may have a 16K byte ROM image (that’s the size of the ROM in the memory map), but not a 32K byte ROM image. Unless the ROM file is ZX Spectrum 128K / +2 sized. These machines use bank switching to swap between the top ‘half’ and the ‘bottom’ half of a physical 32K byte ROM chip.
The "Emulator ROM" might contain emulator code in there, that's my thinking.1024MAK wrote: ↑Sat Feb 15, 2020 3:51 pm I could maybe see why the Next may have a 16K byte ROM image (that’s the size of the ROM in the memory map), but not a 32K byte ROM image. Unless the ROM file is ZX Spectrum 128K / +2 sized. These machines use bank switching to swap between the top ‘half’ and the ‘bottom’ half of a physical 32K byte ROM chip.
Mark