Autor
| Question about Tniasm.How to make bin files:
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 17 2008, 08:49   |
Hello.I have been using tniasm to generate bin files from asm files.One question i have is how to create msx bin files that have header in them so i can bload them in basic.I know the start address from my program.
I found out this
DB 0FEh
DW Start, End, Begin
ORG loadadress ; (this is the address where the program wil be loaded in memory)
How do i find the End address?do i have to see how many bytes my program uses and add this up?
|
|
manuel msx guru Mensajes: 3638 | Publicado: Marzo 17 2008, 08:57   |
Maybe it's better to contact the author?
|
|
ro msx guru Mensajes: 2353 | Publicado: Marzo 17 2008, 09:01   |
Neh, it's ASM 101.
db 0x0FE
dw start, endadr, start
org 0xc000
start: <do some asm here>
.
.
.
endadr: end
The asm parser will use the label "endadr:" as it's END adr and put's it in the first 7 bytes header as you declared in the beginning of your source.
The start adr, in this case, is the same as the "run" adr. |
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 17 2008, 09:01   |
nvm, double post  |
|
ro msx guru Mensajes: 2353 | Publicado: Marzo 17 2008, 09:01   |
gheh, D-fader, same post, same time  |
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 17 2008, 09:03   |
xcept that you can type faster, while I was  ? |
|
ro msx guru Mensajes: 2353 | Publicado: Marzo 17 2008, 09:04   |
haha, lol.
|
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 17 2008, 09:13   |
I figured what was wrong so all ok 
Finally i can make bin files.
Thanks for your help! |
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 17 2008, 10:15   |
I have one question regarding print routine
;subroutine to print text on screen
LD HL,TEXT
PRINT:LD A,(HL)
INC HL
AND A
JP Z,ENDPRINT
CALL CHPUT
JP PRINT
ENDPRINT:RET
TEXT: DB "HELLO this is a testing program,i want to print value of a specific address how can i do that?",0
CHPUT:EQU 0a2h
how can i print the value of an address a byte (from adress &hd000) to be printed with this subroutine?I want to use this so i can print text and then value of adress from ram or rom.
I want to do multiplication or other operations,store the value on a specific address and then print it with that routine.
Can somebody help?
|
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 17 2008, 11:14   |
Well, this is some old stuff, don't think it's really optimized, but it should work I guess:
ld hl,decimal
ld a,243
call Calc8Dec
;subroutine to print text on screen
LD HL,TEXT
PRINT:LD A,(HL)
INC HL
AND A
JP Z,ENDPRINT
CALL CHPUT
JP PRINT
ENDPRINT:RET
TEXT: DB "HELLO this is a testing program,i want to print value of a specific address how can i do that? Like this:
Decimal: DB "xxx... Pretty easy!",0
CHPUT:EQU 0a2h
Calc8Dec:
; routine : Calculate 8 bits decimal
; in : a - number, hl - address to write the result to
; out : decimal: the decimal value (3 bytes)
; cmnt : none
Calc8Dec2:
ld c,48
Calc3DecLoop:
sub 100
jr c,Calc3DecDone
inc c
jr Calc3DecLoop
Calc3DecDone:
add a,100
ld (hl),c
inc hl
ld c,48
Calc2DecLoop:
sub 10
jr c,Calc2DecDone
inc c
jr Calc2DecLoop
Calc2DecDone:
add a,10
ld (hl),c
inc hl
ld c,48
Calc1DecLoop:
sub 1
jr c,Calc1DecDone
inc c
jr Calc1DecLoop
Calc1DecDone:
ld (hl),c
ret
If it sucks, I think there are about a zillion other routines just like this to be found on the internet  |
|
ro msx guru Mensajes: 2353 | Publicado: Marzo 17 2008, 11:58   |
in other words: there's no standaard ASM (or BIOS) that can print integers. You need to convert it to text. It's touch, but that's ASM. It's also FAST   |
|
wolf_
 msx legend Mensajes: 4828 | Publicado: Marzo 17 2008, 12:21   |
Quote:
|
;subroutine to print text on screen
LD HL,TEXT
PRINT:LD A,(HL)
INC HL
AND A
JP Z,ENDPRINT <-
CALL CHPUT
JP PRINT
ENDPRINT:RET
|
o_O
ret z ?  |
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 17 2008, 13:12   |
Quote:
| ret z ? 
|
If we look at it hypothetically, he could do some virtual  after the printing is done, so that can be placed at the position where the 'ret' is now  , so actually I think we can conclude that he's ready for future developments, yay!
|
|
manuel msx guru Mensajes: 3638 | Publicado: Marzo 17 2008, 19:27   |
d-fader!? Wtf? Are you back?  |
|
wolf_
 msx legend Mensajes: 4828 | Publicado: Marzo 17 2008, 21:20   |
amazing, no? 6.5% of all his forum posts have been made today..  |
|
|
|
|