FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MS-DOS-kernel/boot/magic.mac at master · Programuserbash/MS-DOS-kernel · GitHub
Programuserbash
/
MS-DOS-kernel
Public
forked from
FDOS/kernel
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MS-DOS-kernel
/
boot
/
magic.mac
Copy path
More file actions
More file actions
Latest commit
History
History
History
76 lines (72 loc) · 1.97 KB
Breadcrumbs
MS-DOS-kernel
/
boot
/
magic.mac
Copy path
File metadata and controls
76 lines (72 loc) · 1.97 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
; Public Domain 2024 by E. C. Masloch
%macro _appenddigitstrdef 2.nolist
%substr %%ii "0123456789ABCDEF" (%2) + 1
%strcat _%1 _%1,%%ii
%endmacro
; %1 = name of single-line macro to set. will be prefixed by underscore
; %2 = number to write
; %3 = minimal number of hexits, 0..8. defaults to 1
; (setting it to 0 with a number of 0 defines macro to "")
%macro _autohexitsstrdef 2-3.nolist 1
%if %3 > 8
%error Minimal number of hexits 9 or more: %3
%endif
%define _%1 ""
%if (%2) >= 1_0000_0000h
%error Number has to use 9 or more hexits: %2
%endif
%if (%2) >= 1000_0000h || %3 >= 8
_appenddigitstrdef %1, (%2 >> (7 * 4)) & 0Fh
%endif
%if (%2) >= 100_0000h || %3 >= 7
_appenddigitstrdef %1, (%2 >> (6 * 4)) & 0Fh
%endif
%if (%2) >= 10_0000h || %3 >= 6
_appenddigitstrdef %1, (%2 >> (5 * 4)) & 0Fh
%endif
%if (%2) >= 1_0000h || %3 >= 5
_appenddigitstrdef %1, (%2 >> (4 * 4)) & 0Fh
%endif
%if (%2) >= 1000h || %3 >= 4
_appenddigitstrdef %1, (%2 >> (3 * 4)) & 0Fh
%endif
%if (%2) >= 100h || %3 >= 3
_appenddigitstrdef %1, (%2 >> (2 * 4)) & 0Fh
%endif
%if (%2) >= 10h || %3 >= 2
_appenddigitstrdef %1, (%2 >> (1 * 4)) & 0Fh
%endif
%if (%2) >= 1h || %3 >= 1
_appenddigitstrdef %1, (%2 >> (0 * 4)) & 0Fh
%endif
%endmacro
%macro magicoffset 2-4.nolist ,0
%if ISFAT1216DUAL
%ifdef ISFAT12
%define SYSOFFSET %2
%elifdef ISFAT16
%define SYSOFFSET %3
%else
%define SYSOFFSET 0
; Just a placeholder, so the proper error message
; will be shown when assembling without either
; of the ISFATx defines.
%endif
%else
%define SYSOFFSET %2
%ifnempty %3
%error Not in dual mode
%endif
%endif
%assign NEWOFFSET $ + %4 - Entry
%if NEWOFFSET != SYSOFFSET
_autohexitsstrdef NEWOFFSETHEX, NEWOFFSET
%strcat _NEWOFFSETHEX _NEWOFFSETHEX,'h'
%deftok NEWOFFSET _NEWOFFSETHEX
%if ISFAT1216DUAL
%error Magic offset %1 changed for FATFS, old=SYSOFFSET, new=NEWOFFSET
%else
%error Magic offset %1 changed, old=SYSOFFSET, new=NEWOFFSET
%endif
%endif
%endmacro
Back
|
FazBrowse Home
|
New Git URL