Improved DOS char print code
This commit is contained in:
parent
82baacfd5b
commit
2f9a8fa236
@ -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/\$$/'/" "$^" > $@
|
||||||
|
@ -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:
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
|
||||||
|
@ -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
16
boot_code/dos_layer.asm
Normal 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
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user