File tree Expand file tree Collapse file tree 9 files changed +39
-19
lines changed
Expand file tree Collapse file tree 9 files changed +39
-19
lines changed Original file line number Diff line number Diff line change @@ -110,3 +110,7 @@ src/_internal/shared/start.exe
110110src /_internal /shared /start.bin
111111src /_internal /shared /ne.exe
112112src /_internal /shared /dos.exe
113+ src /_internal /shared /start.bin
114+ src /_internal /shared /start.exe
115+ src /_internal /shared /KERNEL.BIN
116+ src /_internal /shared /dos.exe
Original file line number Diff line number Diff line change 1313 push dx
1414 mov dl , al
1515 mov ah , 02h
16- int 21h
16+ SysCall
1717 pop dx
1818 ret
1919
@@ -27,7 +27,7 @@ DOSrncrlf:
2727
2828DOSPutStrColor:
2929 mov ah , 09h
30- int 0x21
30+ SysCall
3131 ret
3232
3333print_z:
@@ -59,9 +59,7 @@ DOS_ConsoleWrite:
5959 lodsb
6060 cmp al , '$'
6161 je .pe_done
62- mov dl , al
63- mov ah , 0x02
64- int 21h
62+ call putc
6563 inc si
6664 jmp .print_z_loop
6765 .pe_done:
@@ -84,32 +82,33 @@ PutStrColor:
8482 ; -------------------
8583 .print_loop:
8684 lodsb ; AL := [SI], SI++
87- cmp al , 0x00 ; reach end ?
88- je .printed
89- cmp al , 0x0d
90- je .printed
91- cmp al , 0x0a
92- je .printed
93- cmp al , 0x00
94- je .printed
85+
86+ COMPARE al , 0x00 , .printed ; reach end ?
87+ COMPARE al , 0x0d , .printed
88+ COMPARE al , 0x0a , .printed
89+
9590 test al , al
9691 jz .printed
9792 mov ah , 09h ; Teletype-Ausgabe
9893 mov cx , 1 ; mim
99- int 10h
94+ VideoCall
10095
10196 mov ah , 02h
10297 xor bh , bh
10398 inc dl
104- int 10h
99+ VideoCall
105100
106101 jmp .print_loop
107102
108103 .printed:
109- ; --- Cursorposition lesen (AH=03h) ---
104+ call DOS_getCursor
105+ ret
106+
107+ ; --- Cursorposition lesen (AH=03h) ---
108+ DOS_getCursor:
110109 mov ah , 03h ; Read Cursor Position
111110 mov bh , 0 ; Videoseite 0
112- int 10h ; Rückgabe: DH=Zeile, DL=Spalte (0-basiert)
111+ VideoCall ; Rückgabe: DH=Zeile, DL=Spalte (0-basiert)
113112 mov [ PTR16(dos_ypos) ], dh
114113 mov [ PTR16(dos_xpos) ], dl
115114
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ code16_start:
132132
133133 pop dx
134134
135- SET_CURSOR 40 , 5
135+ SET_CURSOR 40 , 3
136136 PUTS_COLOR command_args , 0x0E | 0x10
137137 DOS_Exit cx
138138
Original file line number Diff line number Diff line change 2222 int 0x21 ; DOS interrupt 0x21
2323%endif
2424%endmacro
25+ %macro VideoCall 0
26+ %if DOS_SHELL == 1
27+ int 0x10
28+ %else
29+ %error 'only DOS supports interrupts.'
30+ %endif
31+ %endmacro
2532
2633; -----------------------------------------------------------------------------
2734; add win64 abi shadow ...
Original file line number Diff line number Diff line change 503503%macro SET_COLOR_TO 2
504504%if %0 == 2
505505 STRCPY_ANSI buffer_B , consoleColor_1 , empty
506- STRCAT_ANSI buffer_B , \
506+ STRCAT_ANSI buffer_B , \
507507 console_color_% 1 , buffer_semi , \
508508 console_color_% 2 , consoleColor_2
509509 WRITE_CON_A buffer_B
648648 SysCall
649649%endif
650650%endmacro
651+
652+ ; -----------------------------------------
653+ ; COMPARE <reg>, <imm>, <label>
654+ ; Beispiel: COMPARE al, 0x0a, printed
655+ ; Macht: cmp <reg>, <imm> / je <label>
656+ ; -----------------------------------------
657+ %macro COMPARE 3
658+ cmp % 1 , % 2
659+ je % 3
660+ %endmacro
You can’t perform that action at this time.
0 commit comments