Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- Start:
- push Arr
- call Proc
- movzx cx, byte[Arr]
- mov si, Arr+1
- Output:
- .startLoop:
- mov dl, [si]
- mov ah, 02h
- add dl, '0'
- int 21h
- mov dl, ' '
- mov ah, 02h
- int 21h
- inc si
- loop .startLoop
- mov ah, 08h
- int 21h
- ret
- Proc:
- .prolog:
- push bp
- mov bp, sp
- sub sp, 0
- .processing:
- push di
- mov di, [bp+4]
- movzx cx, byte[di] ;äëèíà ìàññèâà
- inc di
- .startLoop:
- movsx dx, byte[di]
- and dx, 0000'0100b
- jz .addBit
- .delBit:
- and byte[di], 1111'1011b
- jmp .endLoop
- .addBit:
- or byte[di], 0000'0100b
- .endLoop:
- inc di
- loop .startLoop
- .endProc:
- pop di
- .epilog:
- mov sp, bp
- pop bp
- ret 4
- Arr db 5, 1, 12, 4, 3, 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement