Zitat:
$Regfile = "M8def.dat"
$Crystal = 8000000
$HWStack = 32
$SWStack = 32
$FrameSize = 64
$Baud = 19200
Declare Sub Sramdump(byval pwsrampointer As Word , Byval Pwlength As Word)
$Include "Config_MMC.bas"
If gbDriveError <> 0 then
Print "MMC/SD Initialisierung fehlgeschlagen"
end
Endif
Dim bError as Byte
dim a as Byte
Dim aBuffer(512) as Byte ' SRAM-Bereich für den Transfer
Dim wSRAMPointer as Word ' Adress-Pointer für den Drive... Routine
Dim lSectorNumber as Long ' Variable für Sektor-Nummer
' Adresse des Buffers in die Variable
wSRAMPointer =VarPtr(aBuffer(1))
for a=1 to 255
aBuffer(a) =a
next a
lSectorNumber=0
bError = DrivewriteSector( wSRAMPointer , lSectorNumber)
lSectorNumber=1
bError = DrivewriteSector( wSRAMPointer , lSectorNumber)
For lSectorNumber = 0 to 1
bError = DriveReadSector( wSRAMPointer , lSectorNumber)
' Konnte der Sektor eingelesen werden?
if bError > 0 then
Print "Drive Fehler: " ; bError ; " bei Sektor " ; lSectorNumber
exit for
endif
Print "Sektor " ; lSectorNumber
' Sektor ausgeben
SRAMDump wSRAMPointer, 512
waitms 400
next
end
Sub Sramdump(byval pwsrampointer As Word , Byval Pwlength As Word)
' Dump a Part of SRAM to Print-Output #1
' pwSRAMPointer: (Word) Variable which holds the address of SRAM to dump
' pwLength: (Word) Count of Bytes to be dumped (1-based)
Local Lsdump As String * 16
Local Lbyte1 As Byte , Lbyte2 As Byte
Local Lword1 As Word , Lword2 As Word
Local Llong1 As Long
If Pwlength > 0 Then
Decr Pwlength
For Lword1 = 0 To Pwlength
Lword2 = Lword1 Mod 8
If Lword2 = 0 Then
If Lword1 > 0 Then
Print " " ;
End If
End If
Lword2 = Lword1 Mod 16
If Lword2 = 0 Then
If Lword1 > 0 Then
Print " " ; Lsdump
End If
Llong1 = Lword1
Print Hex(llong1) ; " " ;
Lsdump = " "
Lbyte2 = 1
End If
Lbyte1 = Inp(pwsrampointer)
Incr Pwsrampointer
Print Hex(lbyte1) ; " " ;
If Lbyte1 > 31 Then
Mid(lsdump , Lbyte2 , 1) = Lbyte1
Else
Mid(lsdump , Lbyte2 , 1) = "."
End If
Incr Lbyte2
Next
Print " " ; Lsdump
End If
Incr Pwlength
End Sub