Jump to content
IGNORED

Assy math routine help needed


GDMike

Recommended Posts

Naahhh..were still not getting the "2A" in R1. I got a small "a" as an output..

I'm probably not clear again.lol .but I'm trying to read the two bytes on the screen that are next to each other, at location 64,65 in this case they are 2A... and I want to get that into R1 as R1= >2A00 ...BUT the two bytes on the screen won't always be 2A. 

Maybe that's why Lee got confused..

I hope my phone allows me to hit submit... having trouble with this site lately....but my PC is nowhere near my TI..

Edited by GDMike
Link to comment
Share on other sites

Hi GDMike,

Here's how I would move the lower nibbles of two bytes into a single byte:

; assumes two bytes in R1=>XX00 and R2=>YY00
	CI   R1,>4000    ; is it a letter?
	JLE LABEL1
	AI   R1,>0900    ; >41(A) becomes >4A, etc
LABEL1

	CI   R2,>4000    ; is it a letter?
	JLE LABEL2
	AI   R2,>0900    ; >41(A) becomes >4A, etc
LABEL2

	SRL  R2,4        ; R2=>0YY0
	MOVB @R2LB,@R1LB ; R1=>XXY0
	SLA  R1,4        ; R1=>XY00

EDIT: Edited to handle letters above >40, I wasn't thinking about hexadecimal

Edited by PeteE
  • Like 1
Link to comment
Share on other sites

Hi GDMike,

I see you are not using equates for R1LB and R2LB.  This should work instead:

	CI   R1,>4000    ; is it a letter?
	JLE LABEL1
	AI   R1,>0900    ; >41(A) becomes >4A, etc
LABEL1

	CI   R2,>4000    ; is it a letter?
	JLE LABEL2
	AI   R2,>0900    ; >41(A) becomes >4A, etc
LABEL2

	SLA  R1,4        ; R1=>X000
	ANDI R2,>0F00    ; R2=>0Y00
	SOCB R2,R1       ; R1=>XY00

 

  • Like 2
Link to comment
Share on other sites

I was thinking about this overnight. I was just guessing that an actual program would have to be written and that SR(l,r) alone wouldn't probably cut it. Or basically more would have to be compared and moved around..as a simple SRL,4 and AI >30 or so wasn't gonna be enough. That's kinda why I asked for help in the beginning.

Thx

Edited by GDMike
Link to comment
Share on other sites

This is messy, but works!

 

       DEF  RUN
       REF  VMBW,VSBR,VSBW
BUFF   TEXT '2A'
RUN    LI   R0,64
       LI   R1,BUFF
       LI   R2,2
       BLWP @VMBW
       LI   R0,64
       BLWP @VSBR
       SWPB R1
       CI   R1,>40
       JLE  NEXT
       AI   R1,->37
       JMP  NEXT2
NEXT   AI   R1,->30
NEXT2  SLA  R1,4
       MOV  R1,R4
       INC  R0
       CLR  R1
       BLWP @VSBR
       SWPB R1
       CI   R1,>40
       JLE  NEXT3
       AI   R1,->37
       JMP  NEXT4
NEXT3  AI   R1,->30
NEXT4  A    R4,R1
       SWPB R1
       AI   R0,31
       BLWP @VSBW
       JMP  $
       END
 

 

Link to comment
Share on other sites

I can't wait to try it! Clean up on isle 9900 later...I also have some dirty code, but it works..so I do expect that. There is usually another way to make sloppy code cleaner. Lol...I'll add this to ....dang I'm just trying to write here...I got the msg your content could not be delivered...oh I'm hating this site ..@$_#  .....oh, I'll add this to my tool collection!

Thanks everyone!!! 

Link to comment
Share on other sites

A little video. If you insert a "Super-cart"

This program reads it..that's all..

Ctrl M will mute the beeps, while Ctrl M pressed again will un-mute.   Fctn E and X drive the pages fwd and back in 144 byte pages. Ctrl H takes you to the beginning of >6000 page

and Ctrl E takes you to the End of the 8K ram area.

Link to comment
Share on other sites

The test is in my name. Saved to the supercart. It's just a test, but the complete program allows for formatting the cart in a variety of ways with the additional ways to read the cart, decimal,hex and ASCII. This all will be used later as I plan on a game that is loaded into >A000 but plays in >6000 - 4 banks. The data is saved in the cart, skill level, history, levels. Too much to describe...but this is a utility, not that program I describe. Notice you cannot write other than formatting data...(unless you hack the card through other means.. basic,etc..) 

Link to comment
Share on other sites

The test is in my name. Saved to the supercart. It's just a test, but the complete program allows for formatting the cart in a variety of ways with the additional ways to read the cart, decimal,hex and ASCII. This all will be used later as I plan on a game that is loaded into >A000 but plays in >6000 - 4 banks. The data is saved in the cart, skill level, history, levels. Too much to describe...but this is a utility, not that program I describe. Notice you cannot write other than formatting data...(unless you hack the card through other means.. basic,etc..) 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...