Jump to content
  • Advertisement
Sign in to follow this  
jdub

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!