forked from z80playground/cpm-fat
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcore.asm
133 lines (119 loc) · 3.3 KB
/
core.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
; CORE.ASM
; These are Z80-Playground-specific routines that are available for CP/M or other
; programs to use. They include routines for sending chars to the screen, reading
; from the keyboard, and dealing with the USB Drive.
; There is also a small monitor, so if you want to configure the INT
; button to take you to the monitor, you can.
; CORE takes the top 3K of memory, $F400 - $FFFF
; It assembles to 2.53K right now.
include "locations.asm"
org CORE_START
; CORE internal jump table
; For future-proofing, all calls are via this jump table.
; From external code just jump to "CORE_configure_uart" or similar, which then jumps to "configure_uart".
; That way you can change the value of CORE_ORG, re-assemble this file, then in other files
; just include the external jump table.
; That way it doesn't matter if these routines change location or size, you can always access them from the jump table.
CORE_start_monitor:
; Start the debugging monitor
jp unimplemented_start_monitor
CORE_configure_uart:
; Configures the 16550 UART after a reset, setting the baud rate etc.
jp configure_uart
CORE_print_a:
; Prints whatever is in A to the screen, as a character.
jp print_a
CORE_char_in:
; Reads a character from the keyboard into A
jp char_in
CORE_char_available:
; Checks whether a character is available from the keyboard, without actually reading it
jp char_available
CORE_short_pause:
jp short_pause
CORE_medium_pause:
jp medium_pause
CORE_long_pause:
jp long_pause
CORE_disk_toggle:
jp disk_toggle
CORE_disk_on:
jp disk_on
CORE_disk_off:
jp disk_off
CORE_user_toggle:
jp user_toggle
CORE_user_on:
jp user_on
CORE_user_off:
jp user_off
CORE_rom_toggle:
jp rom_toggle
CORE_rom_on:
jp rom_on
CORE_rom_off:
jp rom_off
CORE_newline:
; Prints a CR/NL combo
jp newline
CORE_space:
; prints a space
jp space
CORE_message:
jp message
CORE_show_hl_as_hex:
jp show_hl_as_hex
CORE_show_all:
jp show_all
CORE_dir:
jp dir
CORE_dir_next:
jp dir_next
CORE_load_bin_file:
jp load_bin_file
CORE_dir_info_read:
jp dir_info_read
CORE_dir_info_write:
jp dir_info_write
CORE_write_to_file:
jp write_to_file
CORE_erase_file:
jp erase_file
CORE_check_cpmdisks_structure:
jp check_cpmdisks_structure
CORE_move_to_file_pointer:
jp move_to_file_pointer
CORE_set_random_pointer_in_fcb:
jp set_random_pointer_in_fcb
CORE_copy_filename_to_buffer:
jp copy_filename_to_buffer
CORE_open_file:
jp open_file
CORE_create_directory
jp create_directory
CORE_close_file:
jp close_file
CORE_read_from_file:
jp read_from_file
CORE_connect_to_disk:
jp connect_to_disk
CORE_mount_disk:
jp mount_disk
CORE_create_file:
jp create_file
CORE_show_a_as_hex:
jp show_a_as_hex
CORE_convert_user_number_to_folder_name:
jp convert_user_number_to_folder_name
CORE_set_file_size_in_fcb:
jp set_file_size_in_fcb
include "uart.asm"
include "message.asm"
include "memorystick.asm"
filename_buffer equ 65535-20
DRIVE_NAME equ filename_buffer-2
disk_buffer equ DRIVE_NAME-36
CORE_END equ $
IF CORE_END-CORE_START>3072
.WARNING "The CORE is too big! 3072 bytes max!"
ENDIF