From 48436ef9bd4d65ec9041ae5ce09f05b5dd521357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 28 Mar 2022 16:15:46 +0300 Subject: [PATCH] Put debug output behind debug define in io.asm --- io.asm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/io.asm b/io.asm index aba830c..8155a04 100644 --- a/io.asm +++ b/io.asm @@ -1,6 +1,8 @@ ; SPDX-License-Identifier: MIT ; Copyright (c) 2021 Juhani 'nortti' Krekelä. +debug equ 1 + iosegment equ 60h dossegment equ iosegment + 1*1024/16 ; DOS starts 1KiB after IO system @@ -64,8 +66,10 @@ init: shl ax, cl ; Memory size is passed in dx mov dx, ax +if debug call hexprint16 call newline +endif ; Disk table is passed in si mov si, offset iogroup:disks_table @@ -94,9 +98,11 @@ init: test al, al jnz open_error +if debug mov al, '+' mov ah, 0eh int 10h +endif ; Set random record field 0 mov word ptr iogroup:command_fcb+33, 0 @@ -114,12 +120,14 @@ init: cmp al, 1 jne read_error +if debug mov ax, cx call hexprint16 mov al, '.' mov ah, 0eh int 10h +endif ; Set up segments for command.com mov ds, bx @@ -205,6 +213,7 @@ putch endp ; OUT: ; TODO: Document diskread proc far +if debug push ax mov ax, 0e00h + 'r' int 10h @@ -226,6 +235,7 @@ diskread proc far call hexprint16 call newline pop ax +endif ; TODO: Everything except sregs can be trashed push es @@ -272,7 +282,9 @@ diskread proc far sector_read_fail: mov al, ah +if debug call hexprint8;debg +endif mov al, '?' mov ah, 0eh int 10h @@ -532,7 +544,9 @@ error: mov ah, 0eh mov al, '!' int 10h +if debug call far_caller +endif hang: hlt @@ -583,6 +597,8 @@ days_since_epoch: dw 0 data ends code segment +if debug + hexprint16 proc xchg al, ah call hexprint8 @@ -672,6 +688,7 @@ logaddr proc ret logaddr endp +endif code ends end