Author Topic: Running programs in the VAT  (Read 3489 times)

0 Members and 1 Guest are viewing this topic.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Running programs in the VAT
« on: March 23, 2007, 10:25:00 am »
Ok I know about the VAT and how it works. But once you get te program how do you run it. Also how would I search in the program for like .db 2,4,1,4,5,6 or something and if I found a jp that I wanted to use how would I jump to the label specified. Like if the program had jp label. How would I go to label in the program.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
Running programs in the VAT
« Reply #1 on: March 23, 2007, 12:23:00 pm »
you have to copy it to somewhere with a known address because in the VAT, the program can be anywhere and you'd have to do a good amount of parsing.  Also, labels called within that external program won't be aligned correctly so they jump to the right address, but wrong place.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Running programs in the VAT
« Reply #2 on: March 23, 2007, 07:01:00 pm »
so then for 'jp label' couldn't you do label - $9D95 and increase pointer by that number.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
Running programs in the VAT
« Reply #3 on: March 24, 2007, 03:22:00 am »
ya you probably could, but keep in mind that unless you tell the assembler otherwise, it will think that all addresses are relative to the .org directive, which just tells it where the first address is and whenever it encounters a label, it calculates the address of the label by adding the distance from the first instruction to the address (defined by .org) of that instruction.

In otherwords, when it's in RAM or ROM and you used absolute addressing (jp's instead of jr's), any jumping that occurs within that external program, probably won't work because the absolute addresses are incorrect (it will jump to places in the $9d95 region because the assembler recorded those addresses for absolute jumping), relative to where it is in RAM/ROM.  but if you use jr's I'd assume it's ok, since jr simply adds up to +/-128 to the PC to make the jump.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Running programs in the VAT
« Reply #4 on: March 24, 2007, 11:28:00 am »
Ok yeah. Well I look at it like this

there is a jp label

and there would be a number say $A190 so

$A190 - $9D95 = $03FB so I would just increase the pointer $03FB or ($03FB - 2 cause jp is 2 bytes) from the location it is at since its reading the label
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
Running programs in the VAT
« Reply #5 on: March 25, 2007, 01:08:00 am »
ya basically.  

Offline Jon

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 278
  • Rating: +0/-0
    • View Profile
Running programs in the VAT
« Reply #6 on: March 25, 2007, 04:46:00 pm »
if you had the address you wanted in hl, you could use jp (hl)

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Running programs in the VAT
« Reply #7 on: March 26, 2007, 09:46:00 am »
yeah thanks Jon. I figured it might be something like that but I wasn't sure.
There are 10 types of people in this world-- those that can read binary, and those that can't.