Test with easier to implement EQU syntax
This commit is contained in:
parent
7dec8b6c81
commit
4abfab2812
@ -1,25 +1,25 @@
|
|||||||
; diskbuf needs to be defined
|
; diskbuf needs to be defined
|
||||||
|
|
||||||
; User-accessible part of FCB (12 bytes)
|
; User-accessible part of FCB (12 bytes)
|
||||||
%define fcb_drv 0 ; 1 byte, 1=A: 2=B: 3=C:
|
fcb_drv: equ 0 ; 1 byte, 1=A: 2=B: 3=C:
|
||||||
%define fcb_fn 1 ; 8 bytes
|
fcb_fn: equ 1 ; 8 bytes
|
||||||
%define fcb_ext 9 ; 3 bytes
|
fcb_ext: equ 9 ; 3 bytes
|
||||||
|
|
||||||
; Drive & FS data (6 bytes)
|
; Drive & FS data (6 bytes)
|
||||||
%define fcb_spt 12 ; byte sectors per track
|
fcb_spt: equ 12 ; byte sectors per track
|
||||||
%define fcb_nos 13 ; byte number of sides/heads
|
fcb_nos: equ 13 ; byte number of sides/heads
|
||||||
%define fcb_ss 14 ; byte sector size: 0=128, 1=256, 2=512, ...
|
fcb_ss: equ 14 ; byte sector size: 0=128, 1=256, 2=512, ...
|
||||||
%define fcb_cs 15 ; byte cluster size: 0=128, 1=256, 2=512, ...
|
fcb_cs: equ 15 ; byte cluster size: 0=128, 1=256, 2=512, ...
|
||||||
%define fcb_co 16 ; word start sector for theoretical cluster 0
|
fcb_co: equ 16 ; word start sector for theoretical cluster 0
|
||||||
|
|
||||||
; Read/Write pointer (6 bytes)
|
; Read/Write pointer (6 bytes)
|
||||||
%define fcb_left 18 ; word number of bytes left to read from diskbuf
|
fcb_left: equ 18 ; word number of bytes left to read from diskbuf
|
||||||
%define fcb_off 20 ; dword offset in disk (not in file)
|
fcb_off: equ 20 ; dword offset in disk (not in file)
|
||||||
|
|
||||||
; Link to directory item (4 bytes)
|
; Link to directory item (4 bytes)
|
||||||
%define fcb_ds 24 ; dword offset of directory item
|
fcb_ds: equ 24 ; dword offset of directory item
|
||||||
|
|
||||||
%define fcb_end 32
|
fcb_end: equ 32
|
||||||
|
|
||||||
fcb_open_rootdir:
|
fcb_open_rootdir:
|
||||||
mov dl, 0x01
|
mov dl, 0x01
|
||||||
@ -40,8 +40,11 @@ fcb_open_rootdir:
|
|||||||
|
|
||||||
; copy sector size
|
; copy sector size
|
||||||
mov ax, [diskbuf + 0x0B]
|
mov ax, [diskbuf + 0x0B]
|
||||||
|
; ... save as number of valid bytes in diskbuf
|
||||||
|
mov WORD [bx+fcb_left], ax
|
||||||
call log2
|
call log2
|
||||||
sub ax, 7
|
sub ax, 7
|
||||||
|
; ... save as sector size
|
||||||
mov byte [bx+fcb_ss], al
|
mov byte [bx+fcb_ss], al
|
||||||
|
|
||||||
; copy cluster size
|
; copy cluster size
|
||||||
@ -51,17 +54,14 @@ fcb_open_rootdir:
|
|||||||
add al, [bx+fcb_ss]
|
add al, [bx+fcb_ss]
|
||||||
mov byte [bx+fcb_cs], al
|
mov byte [bx+fcb_cs], al
|
||||||
|
|
||||||
; transfer sectors per track
|
; copy sectors per track
|
||||||
mov al, [diskbuf + 0x18]
|
mov al, [diskbuf + 0x18]
|
||||||
mov byte [bx+fcb_spt], al
|
mov byte [bx+fcb_spt], al
|
||||||
|
|
||||||
; transfer number of heads/sides
|
; copy number of heads/sides
|
||||||
mov al, [diskbuf + 0x1A]
|
mov al, [diskbuf + 0x1A]
|
||||||
mov byte [bx+fcb_nos], al
|
mov byte [bx+fcb_nos], al
|
||||||
|
|
||||||
; first 128 bytes are always valid
|
|
||||||
mov WORD [bx+fcb_left], 0x80
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
fcb_get_sector_mask:
|
fcb_get_sector_mask:
|
||||||
|
@ -1,24 +1,23 @@
|
|||||||
cpu 8086
|
cpu 8086
|
||||||
|
|
||||||
; Memory layout (starting from top)
|
self: equ 0xF000
|
||||||
%define self 0xF000
|
diskbuf: equ (self-0x200) ; deblocking
|
||||||
|
stack: equ (diskbuf) ; grows down
|
||||||
; A single sector for deblocking
|
defdrv: equ 4
|
||||||
%define diskbuf (self-0x200)
|
|
||||||
|
|
||||||
%define stack (diskbuf)
|
|
||||||
|
|
||||||
%define default_drive BYTE [0x4]
|
|
||||||
|
|
||||||
org self
|
org self
|
||||||
jmp init
|
jmp init
|
||||||
|
pad 3
|
||||||
|
|
||||||
|
self_offset:
|
||||||
|
db (self >> 8)
|
||||||
|
|
||||||
banner:
|
banner:
|
||||||
db "RDOS 2019-09", 0x0A, 0x0D, '$', 0
|
db "RDOS 2019-09", 0x0A, 0x0D, '$', 0
|
||||||
|
|
||||||
init:
|
init:
|
||||||
mov sp, stack
|
mov sp, stack
|
||||||
mov default_drive, 0x01
|
mov byte [defdrv], 0x01
|
||||||
|
|
||||||
mov dx, banner
|
mov dx, banner
|
||||||
call print_string
|
call print_string
|
||||||
|
Loading…
Reference in New Issue
Block a user