WHILE OPERATOR: "INTEL" EXAMPLES

Back to:
index E97

On this page you can see the results of WHILE operator's realization in Intel code. You may need to look additionally for some details about conditions coding.

1. WHILE x<5 DO {cycle's body}; (4FE - address of variable x)
Address, codeOperationsPascal comments
286 A1 FE 04 mov ax,[4FE] Extract x
289 B9 05 00
28C 39 C8
mov cx,5
cmp ax,cx
Is x < 5 ?
28E 7D0D jge 29D (if >=0) Exit if FALSE
290
...
29A
{cycle's body}
29B EB E9 jmp 286To repeat cycle
29D

2. WHILE b DO {cycle's body}; (4FF - address of BOOLEAN variable b)
Address, codeOperationsPascal comments
286 A0 FF 04
289 30 E4
mov al,[4FF]
xor ah,ah (0 ==> ah)
Extract b (byte value)
28B B9 00 00
28E 39 C8
mov cx,0
cmp ax,cx
Is b <> 0 (TRUE)?
290 740D jz 29F (if =0) Exit if FALSE
291
...
29C
{cycle's body}
29D EB E7 jmp 286 To repeat cycle
29F



Back to:
index top E97