; Code written by Sanchit Karve
; born2c0de
; printf("I'm a %XR",195936478);
; Target Processor : 16-bit 80x86 Microprocessor or Higher.
; No User Interface code, since this is a code snippet.
; Code can be copied and pasted in your code since
; PUSHA and POPA have been used to prevent changes to
; previous Register Values.
; For use with 32-bit Assemblers, you can also replace
; all registers with 'E' (Eg. SI becomes ESI, AX -> EAX)
; Assumption:
; Value(in decimal) to be converted in Binary should be
; in register SI.
; Move it from Stack or from Variable to SI register
; before using this code.
PUSHA
; SI Contains the Value to be converted.
MOV BX,80h
MOV AX,BX
MOV DX,SI
loop_begin:
AND DX,AX
TEST DX,AX
JZ jump_ahead
XOR DX,DX
INC DX
jump_ahead:
PUSHA
; Call Output Function or INT21h, and pass value
; stored in DX as output.
; If you're planning to pass it as an argument to a
; function, use PUSH DX to pass it via stack.
; Remember to shift the SP (or BP if you're opening
; stack frame) accordingly up the stack after the
; number has been displayed by the function.
POPA
MOV DX,SI
MOV AX,BX
SHR AX,1
MOV BX,AX
TEST BX,BX
JNZ loop_begin
POPA
this one doesnt work, any others!