How to redirect Print output into a file

5 posts / 0 new
Last post
tokabln's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: Dec 30 2015 - 10:48
Posts: 257
How to redirect Print output into a file

Folks,

 

just doing some research of my Apple IIe for example trying to readout PROM content of different cards. So far the following is working as expected

REM APPLE II - Reading PROM content out of 2 x (256x4 bipolar PROM) e.g. Slot 4 -> Address $C400 => 50176dec.1 REM $C000..C07F On Board Resources2 REM $C080..C08F Slot 0 /DEVSEL area (16 byte register file)3 REM $C090..C09F Slot 1 /DEVSEL area4 REM ... repeated for Slot 2..65 REM $C0F0..C0FF Slot 7 /DEVSEL6 REM $C100..C1FF Slot 1 /IOSEL area (256 bytes 'PROM')7 REM ... repeated for Slot 2..68 REM $C700..C7FF Slot 7 /IOSEL area9 REM $C800..CFFF Common area for all Slots (2 KiB 'ROM')10 INPUT "Enter PROMSTART Addr. (decimal)";PROMSTART20 FOR I = 0 to 25530 A = PEEK(PROMSTART+I)40 B = INT(A/16)50 A$ = MID$("0123456789ABCDEF",A-16*B+1,1) + A$60 A = B70 IF A > 0 THEN 4080 IF(LEN(A$)/2) > INT(LEN(A$)/2)THEN A$ = "0" + A$90 PRINT A$100 A$ = ""110 NEXT I

but I’m failing to redirect the printout into a file instead of printing it to the screen.

Can someone please point me into the right direction? My programming skills a for more then 40 years gone ;-)

 

:UPDATE wrong PROM Start Address

Dog Cow's picture
Offline
Last seen: 5 years 4 months ago
Joined: Dec 11 2008 - 16:26
Posts: 554
You need to OPEN a file, then

You need to OPEN a file, then issue a WRITE command.

tokabln's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: Dec 30 2015 - 10:48
Posts: 257
Many thanks... it’s probably

Many thanks... it’s probably not the best program code but it works ;-)

0 REM APPLE II - Reading PROM content out of 2 x (256x4 bipolar PROM) e.g. Slot 4 -> Address $C400 => 50176dec.1 REM $C000..C07F On Board Resources2 REM $C080..C08F Slot 0 /DEVSEL area (16 byte register file)3 REM $C090..C09F Slot 1 /DEVSEL area4 REM ... repeated for Slot 2..65 REM $C0F0..C0FF Slot 7 /DEVSEL6 REM $C100..C1FF Slot 1 /IOSEL area (256 bytes 'PROM')7 REM ... repeated for Slot 2..68 REM $C700..C7FF Slot 7 /IOSEL area9 REM $C800..CFFF Common area for all Slots (2 KiB 'ROM')10 REM LET PROMSTART = 50176        : REM Slot #4 $C40020 INPUT "Enter IOSEL (PROM) Startaddr. (dec)";PROMSTART30 DSK$ =  CHR$ (4)                    : REM  ^D   

40 A$ = ""                             : REM added because of below comment from jeffmazur50 PRINT DSK$;"OPEN PROM.BIN"60 PRINT DSK$;"WRITE PROM.BIN";A$70 FOR I = 0 TO 25580 A =  PEEK (PROMSTART + I)90 B =  INT (A / 16)100 A$ =  MID$ ("0123456789ABCDEF",A - 16 * B + 1,1) + A$110 A = B120 IF A > 0 THEN 90130 IF ( LEN (A$) / 2) >  INT ( LEN (A$) / 2) THEN A$ = "0" + A$140 PRINT A$150 A$ = ""160 NEXT I170 PRINT DSK$;"CLOSE PROM.BIN"

 

: UPDATE wrong PROM Start Address - thanks RALFK

Online
Last seen: 1 hour 50 min ago
Joined: Jun 18 2010 - 13:54
Posts: 787
Well if we're going to get

Well if we're going to get picky -  In line 50 you use variable A$ which hasn't been initialized yet...

tokabln's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: Dec 30 2015 - 10:48
Posts: 257
Thanks for your feedback... I

Thanks for your feedback... I made the necessary update above ;-)

Log in or register to post comments