Hello, I am CoolModder, and I'm planning on learning eZ80 (first assembly for me) during this month.
This thread will mainly be used to track my progress and projects, until I am good enough to write a graphical routine for a NES Emulator. Wish me luck.
Another essential to learning eZ80 ASM itself is getting to know the calculator hardware & memory layout etc.

The best resource for this is WikiTI: https://wikiti.brandonw.net/index.php?title=Calculator_Documentation#TI-84_Plus_CE.5B-T.5D.2C_TI-83_Premium_CE
CoolModder wrote:
Hello, I am CoolModder, and I'm planning on learning eZ80 (first assembly for me) during this month.
This thread will mainly be used to track my progress and projects, until I am good enough to write a graphical routine for a NES Emulator. Wish me luck.

Yay! Hopefully you can find enough documentation, it can be a little hard to find sometimes.
Links and resources are available here, along with a setup for developing your own applications and some getting started tutorials: https://github.com/CE-Programming/asm-docs
My Hello World isn't compiling and the error makes no sense, no documentation mentions anything about the error.

Code:

Code:
include 'include/ez80.inc'
include 'include/tiformat.inc'
include 'include/ti84pceg.inc'

format ti archived executable protected program 'HELLO'
.assume ADL=1
.org userMem-2
.db tExtTok,tAsm84CeCmp

main:
    call ti.ClrLCDFull
    call ti.HomeUp     
    ld hl, text       
    call ti.PutS   
    call _GetKey
    call _ClrScrnFull
    res donePrgm,(iy+doneFlags)
    ret                 

text:
    db "Hello, world!", 0


Error:

Code:

flat assembler  version g.k4v8
src/main.asm [6]:
        .assume ADL=1
Processed: .assume ADL=1
Error: illegal instruction.
Day 2: Assembler Hell
Found ASM in 28 days... Started that, spasm rejects all my include files, fasmg hates all compiler objects (Even ones that should work according to ez80 heaven), only the EZCE program "worked" with a little bit of indirection, and even then I just got 15 periods on the CEmu screen.
Dude read the tutorial I gave you everything you need. Stop doing random things and literally read the tutorial - all other sites are *wrong* and do not provide correct information.

https://github.com/CE-Programming/asm-docs/blob/master/tutorials/1-setup.md#steps
CoolModder wrote:
Found ASM in 28 days... Started that, spasm rejects all my include files, fasmg hates all compiler objects (Even ones that should work according to ez80 heaven)

It sounds like you're attempting to mix resources between assemblers, which cannot work because fasmg and spasm have very different concepts of what syntax is correct.

ez80.inc, tiformat.inc and ti84pceg.inc are includes written for fasmg, so attempting to include them when assembling with spasm is guaranteed to fail. If you're going to try to use spasm, you need a compatible ti84pce.inc. Each assembler also has a different style of naming things (for example, what is called ti.ClrLCDFull with fasmg is called _ClrLCDFull with spasm).

If you're going to use examples, you need to choose one source and only use its examples. If you're going to attempt to mix resources written for different assemblers, you'll need to understand how they differ in order to adapt them to work on the tool you're using.
MateoConLechuga wrote:
Dude read the tutorial I gave you everything you need. Stop doing random things and literally read the tutorial - all other sites are *wrong* and do not provide correct information.

https://github.com/CE-Programming/asm-docs/blob/master/tutorials/1-setup.md#steps

Error from your code:

Code:

fasmg src/main.asm DEMO.8xp
flat assembler  version g.k4v8
src/main.asm [11]:
        ld hl,ti.mpLcdPalette ; mmio address of lcd palette
ld? [88] (CALM)
Error: the value of symbol 'ld?:lhs' is not valid for this use.

....Just got this error, now I think all sites are wrong. The code is copied straight from the website, and I have tried the most recent fasmg and the outdated one included in the github repo.
Are you using the version of fasmg included with the repository, or the one already on your system?
commandblockguy wrote:
Are you using the version of fasmg included with the repository, or the one already on your system?

Quote:
fasmg-outdated src/main.asm DEMO.8xp
flat assembler version g.jann
src/main.asm [11]:
ld hl,ti.mpLcdPalette ; mmio address of lcd palette
ld? [88] (CALM)
Error: the value of symbol 'ld?:lhs' is not valid for this use.

Using old compiler.
CoolModder wrote:
Using old compiler.

No, you are failing to read and use the one that is provided in the download and instead are using the one installed on your system. idk what to tell you, other than to READ THE GUIDE that describes exactly how you should run it.

https://github.com/CE-Programming/asm-docs/blob/master/tutorials/1-setup.md#steps
MateoConLechuga wrote:
CoolModder wrote:
Using old compiler.

No, you are failing to read and use the one that is provided in the download and instead are using the one installed on your system. idk what to tell you, other than to READ THE GUIDE that describes exactly how you should run it.

https://github.com/CE-Programming/asm-docs/blob/master/tutorials/1-setup.md#steps

...The old compiler is the one in the repo (I named it outdated to bypass the windows filesystem constraits,) and the issue was wrong include files.
Day ???:
Guess I will try again. My biggest problem is I can't understand what the code actually means/or does. I don't want to have little scripts that I don't understand and won't need, I want to learn the structure of how ez80 assembly is programmed and understand what each function does and works in junction, so I can write and debug my own scripts. I don't want a program given to me in small chunks that explain the function but not how it works.
I would like to learn eZ80 assembly for the CE too. Because I have NIH syndrome, I don't want to call the OS unless absolutely necessary.
CoolModder wrote:
Day ???:
Guess I will try again. My biggest problem is I can't understand what the code actually means/or does. I don't want to have little scripts that I don't understand and won't need, I want to learn the structure of how ez80 assembly is programmed and understand what each function does and works in junction, so I can write and debug my own scripts. I don't want a program given to me in small chunks that explain the function but not how it works.


It could be you're thinking of assembly a little incorrectly. Your programs will be made up of instructions, and if you aren't clevor OS calls.

Because assembly is lower level, things you would be used to like loops and conditions have to be done a little differently. The best thing to do is come up with your general program logic, then use the eZ80's instructions (and sometimes OS calls) to make the logic a reality.

Here are some resources which could help:
- Official eZ80 datasheet
- Shameless eZ80 Docs plug (the instruction documentation is complete now!)
- WikiTI is a good place to look for OS call documentation, (In the "System Entrypoints") sections. You'll notice that the TI-84 Plus CE is sort of lacking in documentation, which is partly because a lot of system calls perform almost identically to older calculators. The most complete and generally best section to look in is the TI-83 Plus.

Most of all, if you're stuck on solving a specific problem or feature of your program, just ask! That's really the best way to learn.
Well, thinking about it, I guess I should use OS calls because I was trying to quickly wrap my mind around the LCD controller(s), and I failed miserably. It is just a bias I would have to override and eventually rewrite. I keep thinking that ASM is going to be easier than C, C++, Python, etc. because the latter supposedly have too much complexity, but I wad wrong. ASM is much harder.

Note to self: This isn't a platforn where you have to squeeze the clock cycles out of every instruction. It is the same case on the 83+. I keep telling others that they don't have to immediately have optimal code, but I kept trying to force myself to write as low as possible to have "more performance" and "less complexity". I guess Python is just fine. I just need to focus on the algorithm rather than the exact implementation.
TIny_Hacker wrote:
CoolModder wrote:
Day ???:
Guess I will try again. My biggest problem is I can't understand what the code actually means/or does. I don't want to have little scripts that I don't understand and won't need, I want to learn the structure of how ez80 assembly is programmed and understand what each function does and works in junction, so I can write and debug my own scripts. I don't want a program given to me in small chunks that explain the function but not how it works.


It could be you're thinking of assembly a little incorrectly. Your programs will be made up of instructions, and if you aren't clevor OS calls.

Because assembly is lower level, things you would be used to like loops and conditions have to be done a little differently. The best thing to do is come up with your general program logic, then use the eZ80's instructions (and sometimes OS calls) to make the logic a reality.

Here are some resources which could help:
- Official eZ80 datasheet
- Shameless eZ80 Docs plug (the instruction documentation is complete now!)
- WikiTI is a good place to look for OS call documentation, (In the "System Entrypoints") sections. You'll notice that the TI-84 Plus CE is sort of lacking in documentation, which is partly because a lot of system calls perform almost identically to older calculators. The most complete and generally best section to look in is the TI-83 Plus.

Most of all, if you're stuck on solving a specific problem or feature of your program, just ask! That's really the best way to learn.

I think of it as, I don't understand the examples and don't understand how to write my own code, something hard that looks like code to someone who doesn't code. If it was on a Venn diagram, it would not be connected to the other circle. It is its own beast.
CoolModder wrote:
Day ???:
Guess I will try again. My biggest problem is I can't understand what the code actually means/or does. I don't want to have little scripts that I don't understand and won't need, I want to learn the structure of how ez80 assembly is programmed and understand what each function does and works in junction, so I can write and debug my own scripts. I don't want a program given to me in small chunks that explain the function but not how it works.

By "the code" are you referring to the examples from the asm-docs repo? Those are mostly intended as examples of how to interact with the hardware, and expect you to already know how eZ80 assembly works.

Most of the information from ASM in 28 Days still applies, since Z80 assembly is not that different from eZ80 assembly. I would recommend primarily using that for learning the assembly language itself, but keeping in mind that things like macros and assembler directives (e.g include, format, any line starting with a "." or "#") will be different, and using the ones for fasmg from the asm-docs repo instead of the ones for tasm/spasm from Ai28D.
  
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