Nope. All numbers are just numbers. You could use binary if you wanted, because it's stored in exactly the same way on the calc: pure data.
Then why did people blame the fact that my program would convert


220100 to ld (1),hl

instead of

220100 to ld ($0001),hl

Is it because it is like a standard to use Hexadecimal in some instructions?
So $9D95, 9D95h, userMem, progStart, 40341, %1001110110010101, and 1001110110010101b are all exactly the same.

For your question, it's just easier sometimes to use hex or binary. Would you rather call a row of pixels %10110110 or 182? And same with pointers: would you rather use $8000 as the start of RAM or 32768?
ScoutDavid wrote:
Everything that is in parentheses is a RAM Address, right?

Not really; parentheses refer to indirection. For example, inc hl means "increment the value of HL" and inc (hl) means "increment the value at the memory address pointed to by HL".

The exception is jp (hl), which is effectively "ld pc,hl" and not "ld pc,(hl)" as the name may indicate.
ScoutDavid wrote:
So...

ld hl,$FFFF
ld hl,65535

Can both be done and are both possible?

Are there instructions that need to be Hexadecimal? And can't be written in decimal?
They can both be hex or decimal. As I've tried to explain previously, there's no difference between binary and hex and decimal and octal and base 999999999. They're all just ways to represent numbers. However, by convention everyone writes z80 ASM addresses in hex. I know that CALCnet has its buffers at $86EC, that programs get copied to $9d95 to run, that $0020 has a call to ChkFindSym, etc. If you write decimal addresses, it's not wrong, it's just confusing.
Quote:
However, by convention everyone writes z80 ASM addresses in hex. I know that CALCnet has its buffers at $86EC, that programs get copied to $9d95 to run, that $0020 has a call to ChkFindSym, etc. If you write decimal addresses, it's not wrong, it's just confusing.


That's what I wanted to hear. Thanks everyone!

Now, I need an explanation on negatives, like if I were 5 years old xD
ScoutDavid wrote:
Now, I need an explanation on negatives, like if I were 5 years old xD

See two's complement on Wikipedia.
ScoutDavid wrote:
Now, I need an explanation on negatives, like if I were 5 years old xD


Yeah, benryves's link has a nice explanation, To find the positive value of a number written in two's complement, just NOT it (the keyword not in Python, I'm assuming you're using it) and add one.
One flub I noticed in my post - $0020 is Copy9ToOp1, not ChkFindSym. Smile Sorry about that.

Code:
8XP File:
(1-11)Header (11 bytes): 42,42,84,73,56,51,70,42,26,10,0
(12-52)Comment (42 bytes): 42 bytes of ASCII, if the comment is <42 bytes then fill the rest of the space with 0s
(53)Comment Delimiter: 0
(54-55)Length of the Data Section (2 bytes): Length of the data section+19
(56-57)Random Stuff (2 bytes): 13,0
(58-59)Length of the Data Section (2 bytes): Length of the data section+2
(60)Protected (1 byte): 6 if yes, 5 if no
(61-68)Program Name (8 bytes): Program Name (in ASCII)-fill with 0s if <8 bytes
(69-70)More Random Stuff (2 bytes): 0,0
(71-72)Length of the Data Section (2 bytes): Length of the data section+2
(73-74)Length of the Data Section (2 bytes): Length of the data section
(75-?)Data Section (Varies): The program's data
Checksum: Checksum of 56 bytes to the byte before the checksum


Having this, I really need help on making a .8xp file...

My problem this time is actually python, anybody knows how to create a .8xp file with Python? thanks.
Kerm, having written BinPac8x, can probably tell you. Smile
souvik1997 wrote:
Kerm, having written BinPac8x, can probably tell you. Smile


I hope so, I have the Hexadecimal code, just MAKING the file itself is harder.
To open a file for writing, use

Code:

f = open('EXPORT.8xp', 'w')

Then write to it with

Code:

f.write(bytesVar)

Since there are a lot of computations involved, I'd recommend first calculating everything (including the checksum) before you even open the file. Then you can just write the entire file in at once.
Opening and Reading files was already implemented and works well. Writing the file is just harder. Now,

f.write(bytesVar)

What is bytesVar? Is it the hexadecimal code (bytes) of 8xp files?
It's a bytes variable (Python). Some other types are allowed too, like strings.
Deep Thought wrote:
It's a bytes variable (Python). Some other types are allowed too, like strings.


A bytearray() then Very Happy
Wait, sorry, I got confused. write() always takes a string as an argument. Use str(var) to convert vars to strings (str(var, 'utf-8') if it tells you you need an encoding.

EDIT: More info: http://docs.python.org/tutorial/inputoutput.html#methods-of-file-objects
Scout, this is basically the same stuff we already went over in your Tokens topic. Smile

Code:
.nolist
#include "ti83plus.inc"
.list
    .org $9D95-2
    .db $BB, $6D
   
Start:
  B_CALL (_ClrLCDFull)
  ld hl,1
  B_CALL (_DispHL)
  B_CALL (_GetKey)
 
  ret


Any idea why SPASM will compile this, but WabbitEmu gives Error when running it from homescreen?
Probably because you're not using Doors CS 7's Homerun feature. If you want to run it without Doors CS, you need to run it as Asm(prgmBLAH.
  
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 2 of 4
» 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