1 / 4

ASSEMBLER M. Antczak, S. Wąsik

ASSEMBLER M. Antczak, S. Wąsik. Debug session:. starting of the example.exe program debugging process debug example.exe. checking the value that is stored in the AX register - rax AX 0000 :. setting the value that will be stored in the AX register - rax AX 0000 : 1.

arlene
Download Presentation

ASSEMBLER M. Antczak, S. Wąsik

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. ASSEMBLER M. Antczak, S. Wąsik

  2. Debug session: • starting of the example.exe program debugging process • debug example.exe • checking the value that is stored in the AX register • -rax • AX 0000 • : • setting the value that will be stored in the AX register • -rax • AX 0000 • : 1 • program execution (go) • -g • debug session termination (quit) • -q

  3. DecDig 0 1 2 3 4 5 6 7 8 9 Base=10 HexDig 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 A  10 B  11 C  12 D  13 E  14 F  15 Base=16 HexDig Negation 0 F 1 E 2 D 3 C 4 B 5 A 6 9 7 8 8 7 9 6 A  5 B  4 C  3 D  2 E  1 F  0 Hexadecimal arithmetic: 1 1  1 A  10 4  4 ---------- 15 – F 8  8 C  12 ---------- 20 – 16 = 4 negation 5F4 4 F4 2 + 16 7 -------- 11 - B 7 + 16 8 -------- 15 - F 2 3 BF F 3BF

  4. Basic assembler instructions set: ADD AX, BX  AX = AX + BX SUB AX, BX  AX = AX - BX NEG AX  AX = (-1)*AX INC AX  AX = AX + 1 DEC AX  AX = AX – 1 MOV AX, BX  AX = BX IMUL BX  AX = AX * BX IDIV BX  AX = AX / BX and DX = AX % BX while(a==b) { instrs } Assume: a  AX; b  BX loop: instrs finish: int 3 Assume: a  AX; b  BX loop: CMP AX, BX instrs finish: int 3 Assume: a  AX; b  BX loop: CMP AX, BX instrs JMP loop finish: int 3 Assume: a  AX; b  BX loop: CMP AX, BX JNE finish instrs JMP loop finish: int 3 • Jump instructions – used to jump to the memory place identified by particular address (e.g. code block label) : • direct jump (without condition) • JMP loop • conditional jumps (when the condition is fulfilled) • CMP AX, BX ; flags setting • JNE finish • Differentpossibilities: JNE  != ; JE  == ; • JG  > ; JL  < ;JLE, JNG  <= ; JGE, JNL  >= ; Assume: a  AX; b  BX ifCond: instr1 elseCond: instr2 finish: int 3 Assume: a  AX; b  BX ifCond: CMP AX, BX instr1 elseCond: instr2 finish: int 3 Assume: a  AX; b  BX ifCond: CMP AX, BX JL elseCond instr1 elseCond: instr2 finish: int 3 Assume: a  AX; b  BX ifCond: CMP AX, BX JL elseCond instr1 JMP finish elseCond: instr2 finish: int 3 if(a>=b) instr1 else instr2

More Related