Instruction Set
4-70
INC
INC
Examples
This example writes pixel values to a buffer. INC, CMP, and JL implement a construct
equivalent to the C-language
do-while loop.
Tips
Use ADD instead of INC when you need to detect a carry from the highest bit of an unsigned
result, or detect a signed result that is too large to fit in the destination.
Use INC within a loop when you want to increase a value by 1 each time the loop is executed.
Related Instructions
If you want to
See
Add two numbers
ADD
Subtract 1 from a number
DEC
COUNT
DB
128
; write pixel values to buffer
MOV
CL,0
; set up counter
WRITE:
; write a pixel
CALL
WRITE_PIXEL
INC
CL
; add 1 to counter
CMP
CL,COUNT
; have all pixels been written?
JL
WRITE
; if not, then jump to top of loop
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...