reorganize everything
This commit is contained in:
1
OperatingSystem/Applications/basic/.zout/.gitignore
vendored
Normal file
1
OperatingSystem/Applications/basic/.zout/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
main*
|
||||
1225
OperatingSystem/Applications/basic/.zout/symbols.s
Normal file
1225
OperatingSystem/Applications/basic/.zout/symbols.s
Normal file
File diff suppressed because it is too large
Load Diff
4564
OperatingSystem/Applications/basic/include/basic.s
Normal file
4564
OperatingSystem/Applications/basic/include/basic.s
Normal file
File diff suppressed because it is too large
Load Diff
1
OperatingSystem/Applications/basic/include/extern_symbols.s
Symbolic link
1
OperatingSystem/Applications/basic/include/extern_symbols.s
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../monitor_v2/zout/symbols.s
|
||||
93
OperatingSystem/Applications/basic/main.asm
Normal file
93
OperatingSystem/Applications/basic/main.asm
Normal file
@@ -0,0 +1,93 @@
|
||||
.include "extern_symbols.s" ;include monitor symbols.
|
||||
START_ADDR .EQU 0x8000
|
||||
|
||||
|
||||
org START_ADDR
|
||||
com_header:
|
||||
jp com_prg
|
||||
db 0x00
|
||||
dw 0x00, 0x00, 0x00 ;always 0
|
||||
dw [START_ADDR] ;start addr
|
||||
dw [_eof] ;end of file
|
||||
dw [_eof - START_ADDR] ;length
|
||||
dc 48,0x00
|
||||
|
||||
com_prg:
|
||||
;shadow rom
|
||||
call B_PRINTINLINE
|
||||
db 10,13,"Shadowing ROM @ 0x0000-0x3FFF ...",10,13,0
|
||||
ld a,0x01 ;set bit1 to switch to ram
|
||||
out (0x00),a ;store to bank select register
|
||||
ld hl,[prg_start]
|
||||
ld de,0
|
||||
ld bc,[prg_end-prg_start]
|
||||
ldir
|
||||
jp 0x0000
|
||||
|
||||
|
||||
prg_start:
|
||||
phase 0x0000
|
||||
|
||||
BASRST_00: ;Hardware Restart
|
||||
jp CSTART
|
||||
defs 5
|
||||
;org 0x0008
|
||||
BASRST_08 ;Print Char
|
||||
jp _BASRST_08
|
||||
defs 5
|
||||
;org 0x0010
|
||||
BASRST_10 ;receive char
|
||||
jp _BASRST_10
|
||||
defs 5
|
||||
;org 0x0018
|
||||
BASRST_18 ;Buffer length
|
||||
jp _BASRST_18
|
||||
defs 5
|
||||
;org 0x0044
|
||||
|
||||
_BASRST_08:
|
||||
out (CS_SIO_A_D),a
|
||||
_wait:
|
||||
ld a,1
|
||||
out (CS_SIO_A_C),A
|
||||
in A,(CS_SIO_A_C) ;read RRx
|
||||
bit 0,A
|
||||
jr z,_wait
|
||||
ret
|
||||
|
||||
_BASRST_10:
|
||||
;RTS ON
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (CS_SIO_A_C),A
|
||||
ld a,0EAh ;DTR active, TX 8bit, BREAK off, TX on, RTS active
|
||||
out (CS_SIO_A_C),A
|
||||
nop
|
||||
;read if avail
|
||||
xor a ; a = 0
|
||||
out (CS_SIO_A_C), a ; select reg 0
|
||||
in a, (CS_SIO_A_C) ; read reg 0
|
||||
and 1 ; mask D0 (recieve char available)
|
||||
;RTS OFF
|
||||
push af
|
||||
ld a,005h ;write into WR0: select WR5
|
||||
out (CS_SIO_A_C),A
|
||||
ld a,068h ;DTR inactive, TX 8bit, BREAK off, TX on, RTS inactive
|
||||
out (CS_SIO_A_C),A
|
||||
pop af
|
||||
ret Z ; return 0 if no char
|
||||
;read data
|
||||
in a, (CS_SIO_A_D) ; read char if avail
|
||||
ret ; return
|
||||
|
||||
_BASRST_18:
|
||||
ld a,0
|
||||
ret
|
||||
|
||||
BASSTART:
|
||||
.include "basic.s"
|
||||
_WORKSPACE:
|
||||
|
||||
dephase
|
||||
prg_end:
|
||||
|
||||
_eof:
|
||||
Reference in New Issue
Block a user