Improved DOS char print code

This commit is contained in:
(Tim) Efthimis Kritikos 2023-03-14 07:20:30 +00:00
parent 82baacfd5b
commit 2f9a8fa236
7 changed files with 27 additions and 33 deletions

View File

@ -7,9 +7,9 @@ BUILD_FILES+=$(subst .asm,.bin,${SOURCE})
all: ${BINARIES} all: ${BINARIES}
brainfuck_interpreted.bin: brainfuck_interpreter_v0.asm hello_9086.bf.asm brainfuck_interpreted.bin: brainfuck_interpreter_v0.asm hello_9086.bf.asm dos_layer.asm
brainfuck_compiled.bin: brainfuck_compiler_v1.asm hello_9086.bf.asm brainfuck_compiled.bin: brainfuck_compiler_v1.asm hello_9086.bf.asm dos_layer.asm
brainfuck_mandelbrot.bin: brainfuck_compiler_v1.asm mandelbrot.bf.asm brainfuck_mandelbrot.bin: brainfuck_compiler_v1.asm mandelbrot.bf.asm dos_layer.asm
%.bf.asm:%.bf %.bf.asm:%.bf
${Q}sed "s/[a-zA-Z\* ]//g;/^$$/d;s/^/.ASCII '/;s/\$$/'/" "$^" > $@ ${Q}sed "s/[a-zA-Z\* ]//g;/^$$/d;s/^/.ASCII '/;s/\$$/'/" "$^" > $@

View File

@ -1,6 +1,5 @@
.ORG 0x84 ; INT 21 ; Interrupt table and routines
DW 0xFFFF ; Code Segment INCLUDE dos_layer.asm
DW PRINT_INT_HANDLE ; Program Counter
org 0x100 org 0x100
INCLUDE brainfuck_compiler_v1.asm INCLUDE brainfuck_compiler_v1.asm
@ -8,12 +7,6 @@ INCLUDE brainfuck_compiler_v1.asm
prog: prog:
INCLUDE hello_9086.bf.asm INCLUDE hello_9086.bf.asm
PRINT_INT_HANDLE:
push AX
MOV AL,DL
out byte #0xA5
POP AX
iret
output_program: output_program:

View File

@ -1,18 +1,10 @@
.ORG 0x84 ; INT 21 ; Interrupt table and routines
DW 0xFFFF ; Code Segment INCLUDE dos_layer.asm
DW PRINT_INT_HANDLE ; Program Counter
ORG 0x100 ORG 0x100
mov sp,#STACK mov sp,#STACK
INCLUDE brainfuck_interpreter_v0.asm INCLUDE brainfuck_interpreter_v0.asm
PRINT_INT_HANDLE:
push AX
MOV AL,DL
out byte #0xA5
POP AX
iret
.BLKB 200 .BLKB 200
STACK: STACK:

View File

@ -1,17 +1,9 @@
.ORG 0x84 ; INT 21 ; Interrupt table and routines
DW 0xFFFF ; Code Segment INCLUDE dos_layer.asm
DW PRINT_INT_HANDLE ; Program Counter
ORG 0x100 .ORG 0x100
INCLUDE brainfuck_compiler_v1.asm INCLUDE brainfuck_compiler_v1.asm
PRINT_INT_HANDLE:
push AX
MOV AL,DL
out byte #0xA5
POP AX
iret
prog: prog:
INCLUDE mandelbrot.bf.asm INCLUDE mandelbrot.bf.asm

16
boot_code/dos_layer.asm Normal file
View File

@ -0,0 +1,16 @@
.ORG 0x84 ; INT 21
DW 0xFFFF ; Code Segment
DW PRINT_INT_HANDLE ; Program Counter
PRINT_INT_HANDLE:
push AX
CMP AH,#0x02
jz PRINT_CHAR
pop AX
iret
PRINT_CHAR:
MOV AL,DL
out byte #0xA5
POP AX
iret

BIN
out Normal file

Binary file not shown.

View File

@ -40,6 +40,7 @@ TEST_:
ADD AX,#0xDEAD ADD AX,#0xDEAD
RET RET
;quick&dirty
PRINT_INT_HANDLE: PRINT_INT_HANDLE:
push AX push AX
MOV AL,DL MOV AL,DL