Public Group

# z80 assembly: Errors when trying to assemble a simple program with TASM

This topic is 3497 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey I am beginning to learn z80 assembly and I am having some problems getting started. I am trying to compile this code:
.nolist
#include "ti83plus.inc"
#define    ProgStart    \$9D95
.list
.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
.end


I am getting these errors: ti83plus.inc line 4054: Duplicate Label: (noname._LdHLInd) ... about 8 that are similar to this ... and some that say this: D:\TI-84_Dev\Source\hello.z80 line 0007: unrecognized instruction (B_CALL(_PUTS)) and two more on lines 11 and 12. I have no clue how to solve these because I am just learning assembly language. Could someone tell me what these errors are caused by??

##### Share on other sites
I assume b_call is meant to be a macro, right? Because the assembler doesn't seem to recognize it. Are you sure that it's defined in ti83plus.inc? (just use the search tool of the editor in that file and look for "b_call")

##### Share on other sites
That's what I thought too. But the macros are defined in the file:

#define bcall(xxxx) rst 28h \ .dw xxxx
#define B_CALL(xxxx) rst 28h \ .dw xxxx
#define B_CALL xxxx rst 28h \ .dw xxxx

##### Share on other sites
does it have something to do with file encoding? I'm saving all my files with ANSI encoding.

##### Share on other sites
I looked through the ti83plus.inc file and found the "duplicate labels" that the compiler is complaining about:

_LdHLInd		equ 4009h_NewLine		equ 452Eh_Mon			equ 401Eh_PutAway		equ 403Ch_AppInit		equ 404Bh_IsA2ByteTok	        equ 42A3h_BufLeft		equ 4903h_BufRight		equ 4906h_BufDelete		equ 4912h_BufReplace		equ 490Fh_BufDelete		equ 4912h_CloseEditEqu	        equ 496Ch_DispTail		equ 495Dh_GetPrevTok		equ 496Fh_CursorLeft		equ 493Fh_IsEditEmpty	        equ 492Dh

there's a bunch more in that list that the compiler isn't complaining about and they look exactly the same. I'm really confused on why this is...

##### Share on other sites
Well... I think I figured it out. The macros b_call() wasn't defined in the file. but bcall() was so I used that. It looks like they pretty much do the same thing looking at the ti83plus.inc file. I erased all the duplicate labels in the ti83basic.inc and saved them in another file for later. We'll see how this works tho :(

##### Share on other sites
If the duplicate labels had the same values then most likely it should work. I normally would just do the call itself directly instead of using a macro, I'm too low level when it comes to that kind of programming to be honest =P But don't follow that if you don't feel like doing it >_>

By the way, I'm just wondering, from where did you get that file? Did it come with a devkit or what?

##### Share on other sites
I am following the "Learn z80 in 28 days" tutorial and it mentioned the file in the requirements section. So I googled it and downloaded it from the TI site.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633702
• Total Posts
3013447
×