Bitwise IO: Difference between revisions

Content added Content deleted
m (→‎{{header|Z80 Assembly}}: simplified label names)
m (→‎Compressing a String of ASCII Zeroes and Ones: typo fix, removed unnecessary steps)
Line 219: Line 219:
loop_CompressBits:
loop_CompressBits:
LDA (z_BC),y
LDA (z_BC),y
beq Terminated ; if the value read the null terminator, we are done.
beq Terminated ; if the value read is equal to the null terminator, we are done.
AND #$0F ; returns either 0 or 1 in bit 0. There is no error checking for invalid input at the moment.
; value is assumed to equal #$30 for 0 or #$31 for 1.
ror ; bottom bit of accumulator is rotated into the carry flag.

ror ; accumulator is rotated into the carry flag.
rol tempMath ; the carry is shifted into the bottom of tempMath.
rol tempMath ; the carry is shifted into the bottom of tempMath.
; repeating this with each successive ascii bit representation
; repeating this with each successive ascii bit representation