home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1990
/
10
/
einsteig
/
dump.bas
next >
Wrap
BASIC Source File
|
1990-07-20
|
1KB
|
56 lines
'* ------------------------------------------------------ *
'* DUMP.BAS *
'* Standard-Eingabe -> Hexdump *
'* (c) 1990 W.Rinke & TOOLBOX *
'* ------------------------------------------------------ *
'$INCLUDE: 'REGISTER.INC'
CONST Sprung = 15
DIM Done AS INTEGER
DIM Zeile AS INTEGER
DIM Spalte AS INTEGER
DIM z AS INTEGER
Zeile = 0
Spalte = 0
PRINT HexOut(Zeile, 5); ": ";
DO
Done = GetAsc(z)
Spalte = Spalte + 1
PRINT HexOut(z, 2); " ";
IF Spalte = Sprung THEN
PRINT
Zeile = Zeile + Sprung + 1
PRINT HexOut(Zeile, 5); ": ";
Spalte = 0
END IF
LOOP UNTIL Done
FUNCTION GetAsc% (n%)
Regs.ax = &HB00
CALL INTERRUPT(&H21, Regs, Regs)
Status = Regs.ax AND &HFF
IF Status = &HFF THEN
Regs.ax = &H700
CALL INTERRUPT(&H21, Regs, Regs)
n% = (Regs.ax AND &HFF)
END IF
GetAsc% = (Status = 0)
END FUNCTION
FUNCTION HexOut$ (Dez%, Anz%)
z$ = HEX$(Dez%)
HexOut$ = "$" + STRING$(Anz% - LEN(z$), "0") + z$
END FUNCTION
'* ------------------------------------------------------- *
'* Ende von DUMP.PAS *