text with msx2 an assembler

Page 1/2
| 2

By super_castle

Rookie (32)

super_castle's picture

25-03-2007, 21:14

this text "text1.com" not go in msx2 with dos :

assembler :

org &100
nolist
write"text1.com"

LD HL,PRTTXT
.PRNTLP LD A,(HL)
INC HL
OR A
RET
CALL &00A2
JR PRNTLP

.PRTTXT
defb "hallo, pebisoft !",&00

this text "text.com" go wonderfull under msx2 with dos :

assembler :

org &100
nolist
write"text.com"

LD DE,message
LD C,9
JP 5

.message
defb "hallo, pebisoft !$"

why is this ?

mfg peter

Login or register to post comments

By msd

Paragon (1488)

msd's picture

25-03-2007, 21:20

It's because in dos there is only ram mapped in the pages and no rom like in basic. Address &hA2 is routine in the rom which is mapped to page 0 in basic.

By Prodatron

Paragon (1812)

Prodatron's picture

25-03-2007, 21:20

Probably because of "RET" (after OR A). It will always return and never print anything. Try "RET Z".

By Prodatron

Paragon (1812)

Prodatron's picture

25-03-2007, 21:22

Ah, another issue.
@Super_castle: You should better post such questions into the "Development" forum, not in "General Discussion".

By super_castle

Rookie (32)

super_castle's picture

25-03-2007, 22:41

this program assemble :

org &c000
nolist
write"text.bin"

LD DE,message
LD C,9
JP 5

.message
defb "hallo pebisoft, es geht !$"

i'm load in basic : bload"text.bin"

error : bad file mode

why ist this?

org &c000
nolist
write"text1.bin"

LD HL,PRTTXT
.PRNTLP LD A,(HL)
INC HL
OR A
RET
CALL &00A2
JR PRNTLP

.PRTTXT
defb "hallo, pebisoft !",&00

i'm load in basic : bload"text1.bin"

error : bad file mode

mfg

By flyguille

Prophet (3028)

flyguille's picture

26-03-2007, 00:07

The correct format of a BINARY file to be loaded with the BLOAD command is:

defb &hFE
defw start_addr
defw end_addr (the addr of the last byte used)
defw exec_addr
next is your code....

Is a header of 7 bytes in total.

so

in DUMP terms can be....

&HFE &H00 &HC0 &HFF &HC0 &H00 &HC0 <your code here>

the header is because the BLOAD command needs to knows where to load the BINARY file, and where starts to executing it....

PD: The header will be NOT be copy to RAM.

You can add the header to a COM file, editing it at DISK sector, or just use an utility for that....

By cax

Prophet (3738)

cax's picture

26-03-2007, 08:11


You can add the header to a COM file, editing it at DISK sector, or just use an utility for that....

I think assembler itself can be teached to calculate end address and create the BIN header, isn't it so ?

By super_castle

Rookie (32)

super_castle's picture

26-03-2007, 08:12

hello thanks !!!

mfg peter

By msd

Paragon (1488)

msd's picture

26-03-2007, 17:58

I recommend writing com files only

By ro

Scribe (4763)

ro's picture

27-03-2007, 08:33

I reccomend you stuff it, msd.

By pitpan

Prophet (3152)

pitpan's picture

27-03-2007, 21:28

Better go for ROM files ;D

They are far more reliable than COM files nowadays! Tongue

Page 1/2
| 2