Schrijver
| peek for bload program
|
~mk~ msx novice Berichten: 30 | Geplaatst: 21 Augustus 2003, 17:50   |
Sent again. The other e-mail address bounced.
Quote:
| ~mk~, are you THE mk?
|
I doubt so... I'm not well known in the MSX scene. |
|
serge msx friend Berichten: 13 | Geplaatst: 21 Augustus 2003, 18:25   |
Quote:
| The program TAPDIR from MC(C)M does the same thing. It's published in source, so I guess it's kind of free.
|
To tcm 1998, i can not reach te site from mcm right now, i will try it later and let you know if its works |
|
serge msx friend Berichten: 13 | Geplaatst: 21 Augustus 2003, 18:27   |
to mk: i gonna try it tomorrow and let you know ok
|
|
NYYRIKKI msx master Berichten: 1500 | Geplaatst: 21 Augustus 2003, 21:44   |
Quote:
| >>how to do that in basic?
I forgot... sorry.<<
10 OPEN "program" AS #1 LEN=1: FIELD #1,1 AS A$
20 GET #1,1: IF A$<>CHR$(254) THEN CLOSE #1: PRINT "No binary": STOP
30 GET #1: B$=A$: GET #1: AD=ASC("&h"+A$)*256+ASC("&h"+B$)
40 PRINT "Start: "; RIGHT$("0000"+HEX$(AD),4)
50 GET #1: B$=A$: GET #1: AD=ASC("&h"+A$)*256+ASC("&h"+B$)
60 PRINT "End: "; RIGHT$("0000"+HEX$(AD),4)
70 GET #1: B$=A$: GET #1: AD=ASC("&h"+A$)*256+ASC("&h"+B$)
80 PRINT "Exec: "; RIGHT$("0000"+HEX$(AD),4)
90 CLOSE #1: END
should do the trick.
|
Well yeah, but ain't that a bit hard way to do this?
How about just:
10 OPEN "program" FOR INPUT AS #1
20 IF INPUT$(1,1)<>CHR$(254) THEN PRINT "No BLOAD file":END
30 PRINT "Start: "; RIGHT$("0000"+HEX$(ASC(INPUT$(1,1))+ASC(INPUT$(1,1))*256),4)
40 PRINT "End: "; RIGHT$("0000"+HEX$(ASC(INPUT$(1,1))+ASC(INPUT$(1,1))*256),4)
50 PRINT "Exec: "; RIGHT$("0000"+HEX$(ASC(INPUT$(1,1))+ASC(INPUT$(1,1))*256),4)
This should give the same functionality...
~NYYRIKKI
|
|
NYYRIKKI msx master Berichten: 1500 | Geplaatst: 21 Augustus 2003, 21:47   |
Quote:
| You can read addresses #FCBF & #FCC0 to know execution address. So you can load a file with BLOAD"xxxx" and then execute it with:
defusr=peek(&hfcbf)+peek(&hfcc0)*256:?usr(0)
|
This is correct. You can also find the end address from #F87D and detect if program was started or not using address #FCBE but there is no start address stored in the memory.
~NYYRIKKI |
|
serge msx friend Berichten: 13 | Geplaatst: 21 Augustus 2003, 23:55   |
ok, but still there was a peek that could do that (start, end and execution adress) there where printed on one line i remember. (it was a "one-liner" peek also)
I know it was in a very well know dutch msx magazine.
Maybe if there some people have this magazines could like inside by tricks or something ?
|
|
GuyveR800 msx guru Berichten: 3048 | Geplaatst: 22 Augustus 2003, 03:51   |
As NYYRIKKI already said there is no PEEK for getting the start address, that's a fact. You must've remembered wrong.
You already have Execution and End addresses, you'll have to make due with those.
|
|
ro msx guru Berichten: 2307 | Geplaatst: 22 Augustus 2003, 11:48   |
gheh, just PEEK at the giving examples
LOL |
|
|
|
|