Hello everyone, before you read this, I do have a question about one of my new projects I really want to make... it’s near the end of this post.

Project 1: 2D Minecraft CE
Project 2: 2D Minecraft CE Launcher
Project 3: Advanced Calc CE’s ICE programs (with basically routines not available in BASIC)
Project 4: *NEW PROJECT* On-calc ASM Compiler written in ICE.

So, the question is FOR MY ON-CALC ASM COMPILER project...
So, I’ve had several people to help me gind the hex versions of some tokens and even regular ez80 asm code, but...
Is the ld <var>,<value> ‘s token in asm hex “FD”?
I might have a few more pieces of code like this soon...
but thanks everyone!!!

EDIT 1:
Ok so another question, in the code:
ld a,(iy+8)
... wouldn’t ‘ld ‘ as hex be FD, and ‘a’ be 7E, and ‘(iy+8) be 08? Or is ‘a’ 08 and ‘(iy+8)’ be 7E?

The full hex code is for Toggle Program Mode, which I found somewhere a while back. Here it is:
FD7E08EE02FD7708C9
... and it’s non-hex code was:
ld a,(iy+8)
xor 2
ld (iy+8),a
ret
CAN SOMEONE PLEASE TELL ME WHAT EACH PART of the code above’s 2-character hex is? Like, how would I match up the hexadecimal code to the other code?
I’m asking, still, because I’m trying to understand how asm compiling would work, since I’m making an on-calc asm compiler..
MateoConLechuga wrote:

Code:
I can never find a SIMPLE list of the hexadecimal codes and their simple explanations, like “C9 is Done. It quits the code and returns”, or whatever.


Commands start on page 79:
http://www.zilog.com/force_download.php?filepath=YUhSMGNEb3ZMM2QzZHk1NmFXeHZaeTVqYjIwdlpHOWpjeTlWVFRBd056Y3VjR1Jt


There's literally a description of the opcode and operand hexadecimal representation on each page.
Please, for the love of all things swiss cheese, use [code][/code] tags for code:


Code:

your code


Anyways, 7E corresponds to ld a,(hl) (look it up in the charts we pointed you to). This copies the contents pointed to bu HL into A. By putting an FD in front of it, we use the index register called IY to replace HL (and using DD, uses IX). So it becomes ld a,(iy). BUT using index registers like this requires an offset, so for the love of crêpes, dont use FD7E ! FD7E00 is ld a,(iy+0), but FD7E08 is ld a,(iy+8). Why IY? Because the OS keeps IY pointing to the system flags. As for XOR 2, we do that to toggle the second lowest bit (bit 1) of A. To toggle bit 2, use XOR 4, and bit 6 is XOR 64. Notice that bit n corresponds to 2^n.

Now take the fact that 77 is ld (hl),a to figure out the next instruction, FD7708. And you know RET.
A quick opcode reference that should help as well. Note that the $DD and $FD opcode prefixes are for IX and IY, respectively. $DD can be swapped for $FD for IY instead of IX, and vice versa.
Also: some self-promotion that works better on mobile than the above reference, and is identical.
Good luck, Asm has a steep learning curve to learn, and an even steeper learning curve to master.


Registers do not have a memory adress. They are part of the processor.
There are 8 registers:
BC, DE, HL, AF, IX, IY, SP, PC
Most of these registers can be accessed as 24-bit registers, or 8-bit registers.
BC=BCU,B,C
DE=DEU,D,E
HL=HLU,H,L
IX=IXU,IXH,IXL
IY=IYU,IYH,IYL
Note that the upper byte of these registers cannot be accessed directly.
SP=stack pointer
PC=program counter
Thanks everybody! I appreciate all your help!

I literally just realized the emojis replaced my code earlier 0x5
I’m on mobile, so trying to go back and correct word errors is really hard on iPods. It kinda jumps around trying to move the cursor, but I kinda got used to it, but there’s really nothing wrong with this site on mobile Safari I don’t think.

But either way, I really appreciate everything you guys are doing and helping me with! I know it’s been a lot of questions, but I’m glad y’all still are here to help me!
Yay! So I have been working on my ASM compiler project, and I was able to open a program and save it’s contents to a string variable all in ICE, and also save it to the OS variable ‘Str2’... without a bunch of random ASCII characters that used to annoyingly replace lowercase letters, and that annoying newline ‘:’ replacement with a ‘?’, so it’s clean in the string...
But I DID have to make it scan for the ‘?’ as the newline ‘:’ at the start, so I can get a newline count. When the code is copied to the string, there isn’t and newlines in it, or anything, just spaces instead, so the counter’s needed.

It’s hard to explain, but if you’ve tried loading a program’s data that contains chars like ‘a’, it gets annoying.

The newline counter will be used to calculate the conversion progress bar’s “progress” (based from ICE Compiler, full credit to PT_)! Basically, it’ll go from left to right without jumping back to the left.

It’s going good. I need to make and/or add:
- Built-in ASM source code editor into the asm compiler, so chars like ‘$’,’@‘,etc., can be accessed easier. I might need to make it edit inc files too, unless they won’t or can’t be used in asm hexcodes.
- Auto-search for asm source programs feature
- Beautify menus, they all pretty much use output()...it’s sad Razz
- Make a separate program to add your own asm opcodes and their hexadecimals into an appvar, so anytime I get them, I can add them a lot quicker, so they can be used in the converter.
I NEED HELP!!!!!

I’ve looked at the source for Xenon, and I’m still confused. I can’t figure out how to find any programs that have a

Code:

:.ASM

at the first line. I used to know how, but I’m still having to get back used to ICE programming, since a while back I wasn’t able to charge my calc for a few months.

Like, it’s confusing now, and I NEED help PLEASE!! Can someone give me the code to find those programs?

And, I’ve been able to open a program in ICE and save it’s contents in a string, so it can be used on the homescreen. But the new line colons were not able to be put in it. Instead, it put a space in the string and not the colons.

But can someone help me??
I have an ICE program for program and appear detection/reading that could be helpful. I can send you the source if you want.
epsilon5 wrote:
I have an ICE program for program and appear detection/reading that could be helpful. I can send you the source if you want.


YES PLEASE!!! Thank you so much!!
Smile
As to the colon issue, I believe that that is a token and should be used with single quotes, not double quotes. That's probably your issue.
  
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