flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Bit Isolation |
Author |
|
rhyno_dagreat 08 Jan 2008, 17:11
What do you mean exactly?
|
|||
08 Jan 2008, 17:11 |
|
LocoDelAssembly 08 Jan 2008, 17:17
No, but you can access a byte and later perform bit manipulation instructions to test the desired bit, for example:
Code: ; DX = holds desired port desired_bit_to_test = 5 ; Change "5" to your desired bit (counting from zero) in al, dx test al, 1 shl desired_bit_to_test ; At this point ZF (Zero Flag) is set if the bit was zero and is cleared otherwise setnz al ; Now AL holds a copy of the bit (not required, it is just to do something, you could use branching instructions here instead) http://flatassembler.net/docs.php?article=manual#2.1.7 Last edited by LocoDelAssembly on 08 Jan 2008, 17:18; edited 1 time in total |
|||
08 Jan 2008, 17:17 |
|
Pixelator 08 Jan 2008, 17:18
well, i would like to check and see if bit 5 on the inputport 64h is 0 and if so, jump to a subrutine.
[edit] sorry LocoDelAssembly i just saw your code, thankyou, it is just whan i needed to see Last edited by Pixelator on 08 Jan 2008, 17:20; edited 1 time in total |
|||
08 Jan 2008, 17:18 |
|
LocoDelAssembly 08 Jan 2008, 17:19
Code: in al, $64 test al, 1 shl 5 jnz @f call subroutine @@: |
|||
08 Jan 2008, 17:19 |
|
vid 08 Jan 2008, 18:17
or with newer BT instruction:
Code: in al, 64h bt al, 5 jc bit_set jnc bit_not_set |
|||
08 Jan 2008, 18:17 |
|
Pixelator 09 Jan 2008, 16:04
thank you very much
|
|||
09 Jan 2008, 16:04 |
|
edfed 09 Jan 2008, 19:54
or with the dear old and instruction, the same as test but with overwrite of register.
|
|||
09 Jan 2008, 19:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.