z80 ASM issues

Started by
3 comments, last by Promit 19 years, 6 months ago
OK, I have started to learn z80 ASM today and I have run into a couple of problems. I am trying to use a very simple IDE (Assembly Studio 8x). I have two beginner tutorials that I found on ticalc.org, and I think I understand the concepts, I just can't get the program to compile. Here is the extremely simple program:

#include "ti83plus.inc"
#define ProgStart   $9D95

.org    ProgStart - 2
    .db t2ByteTok, tAsmCmp
    B_CALL(_ClrLCDFull)
    ld  hl,0
    ld  (PenCol),hl
    ld  hl,msg
    B_CALL(_PutS)           ; Display the text
    B_CALL(_NewLine)
    ret

msg:
    .db "Hello world!",0
.end



It is right from a tutorial. Anyway, I am getting errors at the lines where I am making the ROM calls (B_CALL). It is saying that I have th wrong number of arguments for B_CALL. I looked through the "ti83plus.inc" file, but I do not know enough ASM to know what I am doing wrong. Any help is greatly appreciated! Edit: here are the relavent parts of the ti83plus.inc file:

;
; macro to call base code from an app,
;

rBR_CALL	equ	28h		; NEEDED FOR APPS
BRT_JUMP0	equ	50h

.addinstr BCALL * EF 3 NOP 1
.addinstr BJUMP * 0050CD 5 NOP 1
#define B_CALL  BCALL
#define B_JUMP  BJUMP
;#define B_JUMP(label) call BRT_JUMP0 \ .dw label

;
;B_CALL macro   label
;	     rst     rBR_CALL
;	     dw      _&label
;       .endm
;B_JUMP macro   label
;	     call    BRT_JUMP0	     ; fixed location on page 0
;	     dw      _&label
;       .endm

;
;       entry points
;

...

_ClrLCD	equ 4543h
_ClrLCDFull	equ 4540h

...
_NewLine	equ 452Eh

...

_PutS	equ 450Ah

...

.end


The B_CALL parts are near the top... [Edited by - Sr_Guapo on October 3, 2004 9:04:02 PM]
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Advertisement
Does nobody know any calculator assembly?
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Try B_CALL FuncName without parens.'

Oh, and I'm going to suggest ZiLog's Developer Studio as your assembler/IDE.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Thanks alot Promit! I had some other problems, so I had to reinstall TASM and the IDE, but your suggestion worked.

Also, I checked out the ZiLog site, but I found it hard to navigate. Is there a free IDE that I could use? All I saw were pay ones only designated by a number. How am I supposed to know which version I need? It isn't too big a deal, my current IDE is decent. It will shade keywords, compile to hex code and even make a .8xp file for me.
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
It is free, but you need to register...free, but annoying.

The only detail is that the ZiLog compiler doesn't produce Ti-83 programs by default, only apps. You need to run it through a squisher, and not the one which most tutorials mention. Lucky for you, I still happen to have the link.

I generally found that ZiLog was smoother than the old school Tasm/notepad combo.


But I didn't have an IDE like the one you mention, so that might be a better choice for you. ZiLog is intended to be a professional developer studio...but it's certainly not Visual Studio. It's actually pretty simple. Its main advantages are that you can make apps and programs, plus you can use the original headers and stuff that Ti providse. Also, I found that the assembler seemed to integrate more smoothly than TASM. Best thing is probably just to try it and make your own decision...or just stick with what works.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement