+acadiel Posted December 31, 2014 Share Posted December 31, 2014 Looked in the XB manual, the TI-99/4A Tech pages, etc., but couldn't find an answer to this. When you type CALL LOAD (x,y), I've seen negative numbers in the X and just different values in Y. I'm guessing these are memory location and value (byte?). So, if I do a CALL LOAD (-31931,0) (XB unprotect), which memory location is it addressing? What are the ranges for X and where do they go? Can Y be from 0-255? One of those curious things I've never thought about asking. I've seen people essentially rewrite the XB stack by doing CALL LOAD statements (and it's very positional oriented about where in the stack you are modifying), and I've seen people embedding assembly in XB programs by doing this as well. It was always cool looking at the stubs for TELCO and such that ran an EA/5 executable from an XB program's embedded assembly. Not sure how they originally did it other than sector editing and/or doing call LOADS to modify the stack, but that was always a black art to me anyway. (Kind of like the MIller's Graphics copyright protection.. they did some pretty creative stuff.) Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted December 31, 2014 Share Posted December 31, 2014 The x value is a signed 16-bit integer, so it is limited to -32768 to -1, and 0 to 32767. The positive side equal to >0000 to >7FFF. The negative side starts as -32768 at >8000, and up to -1 at >FFFF. Your -31931 location is >8345. You can use a programming calculator to convert your negative memory location to hex, and strip off the leading repeated "F"s. To convert the other way, take your four digit hexadecimal value, convert to decimal, then subtract 65536. Or the other way The y value is a single byte (unsigned 8-bit integer,) so its values are 0 to 255 or >00 to >FF. 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted December 31, 2014 Share Posted December 31, 2014 (edited) Or you can use RXB and use a built in feature to find out what HEX address you are using. RXB has smart variable scans and figures out if you are going from HEX to DEC or DEC to HEX automatically. CALL HEX(-31931,H$) :: PRINT H$ would return: 8345 CALL HEX(X,A$) would put into A$ what ever value you wanted converted from Decimal to HEX in a range that works with CALL LOAD CALL LINK CALL PEEK CALL PEEKV CALL POKEV CALL PEEKG CALL POKEG CALL IO CALL ISRON CALL ISROFF CALL MOVES CALL EXECUTE CALL SECTOR All commands from RXB that use Decimal values that HEX would help you know the address. CALL HEX also will go the opposite way: CALL HEX("FE",X) would put 254 into the variable X. At 7:50 in this video is HEX has a demo part. Edited December 31, 2014 by RXB 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted January 1, 2015 Share Posted January 1, 2015 ... You can use a programming calculator to convert your negative memory location to hex, and strip off the leading repeated "F"s. To convert the other way, take your four digit hexadecimal value, convert to decimal, then subtract 65536. Or the other way ... Or...just limit the MS calculator (in Programmer mode) to “Word” mode and just flip back and forth between Decimal and Hex. ...lee Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.