So I'm moving over to SourceCoder for z80 assembly learning, and I am completely lost on the syntax to use.
This program:


Code:

; Program Name:
; Author(s):
; Description:

.nolist
#include "ti83plus.inc"
.list

   .org userMem-2
   .db $BB,$6D
   ; Program code goes here
   ld a,0
   ld (curRow),a
   ld (curCol),a
   ld hl,msg
   bcall (PutS)
   ret
msg:
   .db   "Hello, World!",0


locks up the emulator completely.
What am I missing?
I tried b_call, _PutS, things taken directly from the ti83plus.inc file, still the same thing.
UPDATE

I fixed it, just absolutely lost on why or how its such a small error.

By googling, I found sourcecoders' z80 asm update page announcement from 8 years ago
https://www.cemetech.net/news/2015/4/737/_/z80-and-ez80-asm-support-added-to-sourcecoder-3

After studying it, it looks like there is no space between bcall and the (). This worked!
Huh, that seems like a bad bug in Spasm that it silently ignores the macro parameter in that case.

For reference, this is the listing emitted when there's a space:
Code:
1 00:0000 - - - -
5 00:0000 - - - -
6 00:0000 - - - - .org userMem-2
7 00:9D93 BB 6D - - .db $BB,$6D
8 00:9D95 - - - - ; Program code goes here
9 00:9D95 3E 00 - - ld a,0
10 00:9D97 32 4B 84 - ld (curRow),a
11 00:9D9A 32 4C 84 - ld (curCol),a
12 00:9D9D 21 A2 9D - ld hl,msg
13 00:9DA0 EF - - - bcall (_PutS)
14 00:9DA1 C9 - - - ret
15 00:9DA2 - - - - msg:
16 00:9DA2 48 65 6C 6C
6F 2C 20 57
6F 72 6C 64
We can see that the bcall address on line 13 is omitted completely, where that should be:
Code:
13 00:9DA0 EF 0A 45 - bcall(_PutS)

I've opened an issue with Spasm about this: https://github.com/alberthdev/spasm-ng/issues/70
Thanks a bunch! That's absolutely wild. I plan on using jstified for asm moving forward, so if I come across any other problems, I'll let you know!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement