Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!decvax!harpo!seismo!hao!hplabs!sri-unix!DDA@CMU-CS-C.ARPA From: DDA@CMU-CS-C.ARPA Newsgroups: net.micro Subject: 6809 LEAX B,X vs ABX Message-ID: <13267@sri-arpa.UUCP> Date: Wed, 2-Nov-83 14:33:54 EST Article-I.D.: sri-arpa.13267 Posted: Wed Nov 2 14:33:54 1983 Date-Received: Sat, 5-Nov-83 20:37:30 EST Lines: 17 From: Drew Anderson In case anyone is interested, the difference is that ABX is unsigned and LEAX B,X is signed. Thus with $1000 in X and $F0 in B, ABX yields $10F0 and LEAX B,X yields $0FF0 (at least according to my TI programmer!) As such, when you are using a table with 129 to 256 items, you must point X at the middle of the table when using the LEAX instruction. I believe that the main reason for this is doing something like a small negative stack pointer move such as: ADJSTK LDA #BYTES # BYTES TO RESERVE NEGA MAKE NEGATIVE OFFSET LEAS A,S RESERVE BYTES. It should be noted that all LEA arguments are 2's complement. Drew Anderson DDA@cmu-cs-c -------