to see what can be done to improve 8085 over 8080. It also provides a way to test
the IDE and modern block layer code with ackcc.
+TODO
+
+Review fast bank copiers to see what a slower but saner one might look like
+so we can keep interrupts on
+
+Perhaps repeats of:
+
+ lhlx
+ mov a,b
+ out a
+ shlx
+ mov a,c
+ out a
+ inx
+ inx
+
+ pop b
+ dex b
+ jnk loop ...
#define MAX_MAPS 7
#define MAP_SIZE 0xC000U
+/* We are using the RIM/SIM masking for interrupt control not hard di/ei pairs */
+#define CONFIG_SOFT_IRQ
+
/* Read processes and big I/O direct into process space */
#define CONFIG_LARGE_IO_DIRECT(x) 1
PROGLOAD = 0x0100
CONFIG_SWAP = 1
+
+#define INT_ENTER mvi a,0x0a ; sim ; ei
+
+#define INT_EXIT mvi a,0x08 ; di ; sim
+
+#define DI mvi a,0x0a ; sim
+
+#define EI mvi a,0x08 ; sim
.define bankfork
bankfork:
- sta patch1+1
- mov a,c
+ di ! This nasty hack requires we really block
+ sta patch1+1 ! interrupts. Might be good to go to a cleaner
+ mov a,c ! approach on a faster 8085 ?
sta patch2+1
lxi h,0
dad sp
copy_done:
lxi h,0
sphl
+ ei
ret
copier:
.sect .text
+!
+! Vectored interrupt support. We block only the timer interrupt
+!
+.define _di
+
+_di:
+ lxi h,_int_disabled
+ mvi a,0x0A ! disable timer not serial
+ sim
+ mov a,m
+ mvi m,1
+ mov e,a
+ ret
+
+.define _ei
+
+_ei:
+ xra a
+ sta _int_disabled
+ mvi a,0x08
+ sim
+ ret
+
+.define _irqrestore
+
+_irqrestore:
+ ldsi 2
+ mov a,m
+ sta _int_disabled
+ ora a
+ rnz
+ mvi a,0x08
+ sim
+ ret
+
.define init_early
init_early:
_program_vectors:
di
- pop d
- pop h
- push h
- push d
+ ldsi 2
+ lhlx
call map_process
call _program_vectors_u
call map_kernel_di
.define _probe_bank
_probe_bank:
- pop d
- pop h
- push h
- push d
- mov a,l
+ ldsi 2
+ ldax d
call map_process_a
lxi d,-1
lxi h,4
.define _acia_poll
!
-! Call with interrupts off
+! Call with interrupts on (we may have some masked)
!
_acia_poll:
lxi h,acia_queue+1
+ di
mov a,m ! read pointer
mov e,a ! save it
dcx h ! queue pointer
mvi d,0
dad d ! plus offset
mov e,m ! return char in DE
+ ei
mvi d,0
ret
empty:
+ ei
lxi d,0xffff ! No luck
ret
.define _devide_writeb
_devide_readb:
- pop h
- pop d
- push d
- push h
- mov a,e
+ ldsi 2
+ ldax d
sta .patch1+1
.patch1:
in 0
ret
_devide_writeb:
- lxi h,2
- dad sp
- mov a,m
+ ldsi 2
+ ldax d
sta .patch2+1
- inx h
- inx h
- mov a,m
+ ldsi 4
+ ldax d
.patch2:
out 0
ret
_devide_read_data:
push b
- lxi h,_blk_op
- mov e,m
+ lxi d,_blk_op
+ lhlx ! Address in HL
+ xchg ! Address in DE, struct back in HL
inx h
- mov d,m ! Address
inx h
mov a,m ! Mapping type
cpi 2
_devide_write_data:
push b
- lxi h,_blk_op
- mov e,m
+ lxi d,_blk_op
+ lhlx
+ xchg
inx h
- mov d,m
inx h
mov a,m
cpi 2