1 / 7

Assembly Microprocessors session 5

Assembly Microprocessors session 5. ing. Ernst E. Mak MSc. Generic Instructions Taxonomy. input/output data load a value(register) into a register arithmetic jumping / subroutine control bitwise operators : Boolean, Register shifts interrupt handling stacking. SHIFT RIGHT. CarryFlag.

abril
Download Presentation

Assembly Microprocessors session 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Assembly Microprocessorssession 5 ing. Ernst E. Mak MSc

  2. Generic Instructions Taxonomy • input/output data • load a value(register) into a register • arithmetic • jumping / subroutine • control • bitwise operators : Boolean, Register shifts • interrupt handling • stacking

  3. SHIFT RIGHT CarryFlag 1 1 0 0 1 0 0 0 c 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 0 1 c 0 1 1 0 0 1 0 0 1

  4. SHIFT LEFT CarryFlag 1 1 0 0 1 0 0 0 c 1 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 c 1 0 0 1 0 0 0 0 0

  5. ROTATE CarryFlag 0 1 0 0 1 0 0 0 1 RL 1 0 0 1 0 0 0 1 0 CarryFlag 0 1 0 0 1 0 0 0 1 RLC 1 0 0 1 0 0 0 0 0

  6. multiply 33 0 0 1 0 0 0 0 1 5 1 0 1 * 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 + 0 0 0 1 0 1 0 0 1 0 1 165

  7. Multiplication using shift ;multiplication using shift-operators ;original numbers in B and C ;thus multiplication is B*C ;answer in HL register start: ld hl,0 ;initialize HL to 0 loop: srl c ;shift rightwards, least sign bit falls ; into carry jp nc,skip ;if the bit was 0,skip next lines ld a,l ;add B into HL using A add a,b ;.. ld l,a ;.. ld a,h ;.. adc a,0 ;.. ld h,a ;.. skip: ld a,0 ;reset A to zero cp c ;compare C to 0 jp z,end ;if C=zero, the job is done sla b ;shift b leftward, ignore carry jp loop ;jump to next loop end: halt ;end reached

More Related