register direct addressing mode
Because that is the way Intel designed the INX instruction of the 8085. The 8080 is also the same. INX increments (and DCX decrements) the 16 bit register pairs or BC, DE or HL, depending on what register pair you specify in the INX (or DCX) instruction. To check is the value is 0 after an INX (or DCX) instruction, you need to OR the values of the register pair into the A register. For example..... INX H ;increment HL register pair MOV A,H ; move H register into the accumulator ORA L ; Logical OR it with the L register JZ ADDR ; If 0 then jump to ADDR
03ABH in the 8085 is ... INX B XRA E
INX H instruction requires 1 machine cycle having 6 T-states because 8-bit instruction operate on 16 bit data (HL) completed in 6 T-states.
In order to add 32 bit numbers in the 8085, you need to add them 8 bits at a time, tracking the carrys between each add. LXI B,first_number LXI H,second_number LXI D,result LDAX B ;first byte - no carry in ADD M STAX D INX B; point to next byte INX D INX H LDAX B ;second byte - carry in ADC M ;note the ADC instead of ADD STAX D INX B; point to next byte INX D INX H LDAX B ;third byte - carry in ADC M STAX D INX B; point to next byte INX D INX H LDAX B ;fourth - carry in ADC M STAX D
Lxi h,xx50 mov a,m inx h mov b,m mvi ,ffh inr c sub b jnc xx08 add b inx h mov m,c inx h mov m,a hlt
INR increment the content of register/memory by 1and result is stored in same place. INX increment the register pair by 1(no flags are affected)
Block transfer in 8085... PUSH FLAGS {optional, if registers need to be saved} PUSH B PUSH D PUSH H LXI H,COUNT LXI B,SOURCE LXI D,DESTINATION LOOP LDAX B STAX D INX B INX D DCX H MOV A,H ORA L JNZ LOOP POP H {optional, if registers need to be saved} POP D POP B POP FLAGS
Lxi h, 2000h mov a,m mov b,a inx h mov a,m add b sta 2002h hlt
exp 4In X? I must assume you mean 4InX or InX^4 Regardless, the derivitive of InX = 1/X
its in mnemonics : get the hex code from internet. MVI B,10H(REGISTER B AS A COUNTER) LXI H,C000H(SOURCE REGISTER, H-L AS MEMORY POINTER) LXI D,C050H(DESTINATION REGISTER) L1: MOV A,M STAX D INX H INX D DCR B JNZ L1 RST 1
minx
Lxi h,8000h // hl pointes to the location 8000 mov a,m // the value at 8000 copied to accumulator inx h // increment hl add m // add values at 8000 and 8001 hlt // quit the program