Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Halifax on March 23, 2007, 10:25:00 am

Title: Running programs in the VAT
Post by: Halifax 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.
Title: Running programs in the VAT
Post by: Liazon 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.
Title: Running programs in the VAT
Post by: Halifax 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.
Title: Running programs in the VAT
Post by: Liazon 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.
Title: Running programs in the VAT
Post by: Halifax 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
Title: Running programs in the VAT
Post by: Liazon on March 25, 2007, 01:08:00 am
ya basically.  
Title: Running programs in the VAT
Post by: Jon on March 25, 2007, 04:46:00 pm
if you had the address you wanted in hl, you could use jp (hl)
Title: Running programs in the VAT
Post by: Halifax on March 26, 2007, 09:46:00 am
yeah thanks Jon. I figured it might be something like that but I wasn't sure.