Hey guys I'm very new to ASM and have a pretty simple question for you guys. I'm reading a book and there are excersises here and there, one of which involves both setting & clearing the Carry Flag. I found out how to set it, but the only way I can clear it is by first setting the register to 0 and then adding a value that fits.
Here is my code (I'm very new though so I know it's not "perfect"):
DumpRegs is a procedure for displaying the registers & flags. Any help/suggestions appreciated :alright:
Here is my code (I'm very new though so I know it's not "perfect"):
.data
aBigNum BYTE 128 ;128
.code
main PROC
mov al,aBigNum
call DumpRegs
add al,aBigNum
call DumpRegs
sub al,255
call DumpRegs
add al,128
call DumpRegs
exit
main ENDP
END main
DumpRegs is a procedure for displaying the registers & flags. Any help/suggestions appreciated :alright:
CLC - Clear Carry
Usage: CLC
Modifies flags: CF
Clears the Carry Flag.
Clocks Size
Operands 808x 286 386 486 Bytes
none 2 2 2 2 1
F8 CLC Clear CF flag
ref from an old copy of Intel Opcodes And Mnemonics
Usage: CLC
Modifies flags: CF
Clears the Carry Flag.
Clocks Size
Operands 808x 286 386 486 Bytes
none 2 2 2 2 1
F8 CLC Clear CF flag
ref from an old copy of Intel Opcodes And Mnemonics
Thanks a bunch ;)
There are a number of instructions which will clear the carry flag. For example, the or instruction always clears the carry flag. If you "or" any register with itself (such as "or al,al"), the content of that register does not change either but flags other than the carry flag may also get affected.
In assembler, you MUST be aware of the effect of each and every instruction on the various flags if you are going to use them for whatever reason.
Raymond
In assembler, you MUST be aware of the effect of each and every instruction on the various flags if you are going to use them for whatever reason.
Raymond
Thanks ;) Like I said I'm new so I'm open to any and all advice.