Autor
| Question about Tniasm.How to make bin files:
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 17 2008, 22:25   |
heh, actually I never really left, somehow I was switched to read-only mode  |
|
manuel msx guru Mensajes: 3638 | Publicado: Marzo 17 2008, 23:13   |
heheh! I hope you didn't read what alexmauer wrote about SCC Blaffer NT, though...  |
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 18 2008, 08:02   |
Quote:
| heheh! I hope you didn't read what alexmauer wrote about SCC Blaffer NT, though... 
|
This is getting quite off-topic, but do you perhaps mean the post in which he argued that blaffer was not 'really complete' and he would rather have a cross-platform tracker?  |
|
ro msx guru Mensajes: 2353 | Publicado: Marzo 18 2008, 08:24   |
No, the part that mentioned your name and circusfreaks in just one sentence..
|
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 18 2008, 13:04   |
On topic i was just looking for the equivelant of a print peek(address) command in asm.I wanted to print text and strings dumped from memory addresses.
Bad thing in asm is that it can be tough for a begginer.Good stuff is that all can be done fast and with a very small program size (unlike windows vista!Ok it's a joke).
Is there an online tutorial that explains how to use bios routines in asm programs?Is there a good place for sources for those who just start to use asm?I dont want to go back to basic.I want to go to stuff such as sprite designing and vdp stuff with asm only.
My prefered assembler is tni.I purchased chaos assembler from mrc,though it is very powerfull i havent had much time to see it in action.
I changed the sources of my files to get msx binaries and i think i understood how to make binary files for almost any computer that has z80 if i change the header definitions.
|
|
d-fader msx lover Mensajes: 71 | Publicado: Marzo 18 2008, 13:17   |
Quote:
| On topic i was just looking for the equivelant of a print peek(address) command in asm.I wanted to print text and strings dumped from memory addresses.
|
Guess you're able to do that with the provided code
Quote:
| Bad thing in asm is that it can be tough for a begginer.Good stuff is that all can be done fast and with a very small program size (unlike windows vista!Ok it's a joke).
|
Well, if even I can manage do get something done in ASM, it can't be that hard
Quote:
| Is there an online tutorial that explains how to use bios routines in asm programs?Is there a good place for sources for those who just start to use asm?I dont want to go back to basic.I want to go to stuff such as sprite designing and vdp stuff with asm only.
|
I guess this site will help you on your way!
My prefered assembler is tni.
Quote:
| Never worked with it, but solely judging the possibilities, it's great.[/quotes]
[quote]I purchased chaos assembler from mrc,though it is very powerfull i havent had much time to see it in action.
|
Though it's old and TASM is not nearly as good as tniASM, the "IDE" is great! [cough, cough]
Quote:
| I changed the sources of my files to get msx binaries and i think i understood how to make binary files for almost any computer that has z80 if i change the header definitions.
|
True. |
|
manuel msx guru Mensajes: 3638 | Publicado: Marzo 18 2008, 18:35   |
It would be cool to combine such an asssembler IDE with an MSX emulator... I mean, the IDE making use of the emulator to quickly test stuff, e.g. or assemble to RAM.
PS: d-fader, I meant this... http://headlessbarbie.com/blog/?p=13 Maybe you should contact him to ask him what's the problem... |
|
NYYRIKKI msx master Mensajes: 1535 | Publicado: Marzo 18 2008, 22:34   |
Quote:
| i was just looking for the equivelant of a print peek(address) command in asm.I wanted to print text and strings dumped from memory addresses.
|
... and that was exactly what was you got reply to. Now you may understand better, why asm programmers like HEX-numbers better. They are more easy to print.
Quote:
| Is there an online tutorial that explains how to use bios routines in asm programs?
|
CALL <BIOS routine address>
Quote:
| Is there a good place for sources for those who just start to use asm?
|
I think http://map.tni.nl is the best place... It is not extremely good, but it is still the best... (You can also find descriptions of existing BIOS routines there) I suggest you to also download other peoples sources and learn from them.
|
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 18 2008, 23:12   |
i did this...this however does not seem to work as i wanted.The second line of text is never printed along with the number i placed on a...why?am i doing something wrong?I used tniasm to compile it.
;header initialize
fname "asm6.bin"
db 0feh
dw 0c800h,endadr,0c800h
ORG 0C800h
main:
ld HL,TEXT
call PRINT
ld HL,DECIMAL
ld a,243
call Calc8Dec
call PRINT
end:ret
;subroutine to print text on screen
PRINT: ld A,(HL)
inc HL
and A
jp Z,ENDPRINT
call CHPUT
jp PRINT
ENDPRINT: ret
TEXT: DB "HELLO this is like a print peek in asm",0
DECIMAL: DB "xxx...pretty easy!",0
CHPUT: EQU 0a2h
endadr: ret
Calc8Dec:
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
|
|
wolf_
 msx legend Mensajes: 4828 | Publicado: Marzo 18 2008, 23:23   |
Haven't tested or anything (and who am I anyway?  ). but that Calc8Dec routine seems to destroy HL, hence you need to load the DECIMAL address into HL just before the 2nd PRINT call. (or otherwise work with push-ups and pops  ) |
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 18 2008, 23:24   |
double post sorry!
|
|
nikodr msx addict Mensajes: 491 | Publicado: Marzo 18 2008, 23:32   |
now this seems to work in the sense that i doesnt crash yet it prints the second line 2 times and does not print any number
;header initialize
fname "asm6.bin"
db 0feh
dw 0c800h,endadr,0c800h
ORG 0C800h
main:
ld HL,TEXT
call PRINT
ld HL,DECIMAL
push hl ;i save hl
ld a,243 ;----------------> i suspect i have to actually save this?as the print routine uses accumulator also
call Calc8Dec
pop hl;i restore hl
call PRINT
end:ret
;subroutine to print text on screen
PRINT: ld A,(HL)
inc HL
and A
jp Z,ENDPRINT
call CHPUT
jp PRINT
ENDPRINT: ret
TEXT: DB "HELLO this is like a print peek in asm",0
DECIMAL: DB "xxx...pretty easy!",0
CHPUT: EQU 0a2h
endadr: ret
Calc8Dec:
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
|
|
MOA msx freak Mensajes: 152 | Publicado: Marzo 19 2008, 00:07   |
Your 'endadr' (used in the BLOAD header) is not at the end of the source. The rest looks okay at first sight.
p/s: you don't have to save the accumulator. You don't need the value after converting it to decimal, do you?
|
|
NYYRIKKI msx master Mensajes: 1535 | Publicado: Marzo 19 2008, 00:13   |
No, no... Like this:
main:
ld HL,DECIMAL
ld a,243
call Calc8Dec
ld HL,TEXT
jp PRINT
- Remove the ",0" from end of TEXT: line
- move that endadr: to end of file |
|
wolf_
 msx legend Mensajes: 4828 | Publicado: Marzo 19 2008, 00:15   |
mm skip the push/pop hl'ing.
Pushing and popping hl totals 21 cycles or something, ld hl,address only costs 10 cycles, hence, twice as fast. (But 1 byte more mem)
|
|
|
|
|