Fully comment this assembly language program ORG 0H MOV P138
Fully comment this assembly language program.
        ORG 0H
        MOV P1,#38H
        ACALL COMMAND
        ACALL CHECK
        MOV P1,#0CH
        ACALL COMMAND
        ACALL CHECK
        MOV P1,#01H
        ACALL COMMAND
        ACALL CHECK
        MOV P1,#82H
        ACALL COMMAND
        ACALL CHECK
        MOV DPTR,#NAM
 NFL:   CLR A
        MOVC A, @A+DPTR
        MOV P1,A
        ACALL FSU
        ACALL CHECK
        INC DPTR
        JZ MLB
        SJMP NFL
 MLB:    MOV P1, #0C6H
        ACALL COMMAND
        ACALL CHECK
        MOV DPTR, #BPLACE
 NBA:    CLR A
        MOVC A,@A+DPTR
        MOV P1,A
        ACALL FSU
        ACALL CHECK
        INC DPTR
        JZ NEP
        SJMP NBA
 NEP:    SJMP NEP  
 DELAY:   MOV R3,#200
 KATIE:    MOV R4,#250
 GREG:    DJNZ R4,GREG
        DJNZ R3,KATIE
        RET
 COMMAND:CLR P2.0
        CLR P2.1
        SETB P2.2
        ACALL DELAY
        CLR P2.2
        RET
 CHECK: SETB P1.7
        CLR P2.0
        SETB P2.1
 ASUS:   CLR P2.2
        ACALL DELAY
        SETB P2.2
        JB P1.7,ASUS
        RET
 FSU:    SETB P2.0
        CLR P2.1
        SETB P2.2
        ACALL DELAY
        CLR P2.2
        RET
 NAM:    DB \"GREG \",0
 BPLACE: DB \"BROCKTON,MA \",0
        END   
Solution
Well, power is really measuring the amount of energy consumed or delivered per unit time [ Watts = Joules/second]. Positive power means that the energy is being dissipated and negative power means that it is being delivered or sourced. If you attach two sides of a resistor with wires and connect it to a battery and make a closed loop circuit, what happens is that the electrical potential energy of the battery (voltage = Joules/Coulomb) — which is a measure of the energy required for a unit charge to jump across the gap between the positive and negative terminals of the battery — will cause an electrical current to flow because the electric field produced from the positive charges and pointing towards the negative charges attracts electrons from the negative terminal towards the positive terminal. When these electrons are impeded by the resistor, they bump into the resistor’s molecules and lose some energy which manifests itself as heat in the macroscopic world. That energy loss across the resistor is given by P = I^2*R which means that the amount of current flow is a more important factor in how much energy is lost, because I is squared.
Written May 22 · View Upvotes


