Yes and no. Any code the CPU executes is machine language, and could be written/expressed as assembly language. Right from power-up, before any OS is loaded, so that's about as "independent" as you can get, I guess.
Once an OS has control, not so much... We can "add eax, ebx", or crunch numbers all day long, or scan memory looking for zeros or other bytes (strlen, etc.). But if we want to display the results - or do *any* I/O at all - we're going to be dependent on the OS. We depend on the OS to load our progam and set it running, and unless we want to just "hang" at the end, we need an "exit to OS" function.
Windows and Linux are "protected" OSen. They're "protected" from *us*, I'm afraid. Real dos will give us unrestricted access to the hardware, so we can be a little more "independent". Here's a dos .com file with no dos interrupts showing:
;---------------------------------
; nasm -f bin -o hwnoint.com hwnoint.asm
org 100h
push word 0B800h ; segment of video memory
pop es ; (because stosw uses es:di)
mov di, (10 * 80 + 30) * 2 ; offset into screen
; (row * width + column) * 2 bytes/character
mov si, msg ; offset of our string
mov ah, 0B0h ; color (blinking black on cyan)
top:
lodsb ; get byte from [ds:si] into al
; and increment si for next one
or al, al ; this doesn't change al, but sets
jz depart ; the flags - if zero, we're done
stosw ; stores ax (char & color) to [es:si]
; and add 2 to di for next one
jmp short top ; do more
depart:
ret ; return to dos (or other caller)
msg db " Look, Ma! No ints! ",0 ; note 0, not '$', terminated
; '$' is just for int 21h/9
;------------------------------------
(Gawd, that's gonna wrap unreadably!) There's actually an int 20h hidden behind the "ret", so this isn't as "independent" as it looks.
You can do a lot of "stuff" independent of the OS, but if you've got one, I think it's fair to say that a "complete program" is going to have to interact with it sooner or later. If you *don't* have an OS, "independent" is the only choice, of course. It may feel more like "out here in the wilderness, all alone". :)
Best,
Frank