bobrien314 0 Newbie Poster
org 100h
section.text

openfile:
        mov dx,sendfile
        mov al,0h
        mov ah,03dh
        int 21h
        mov bx,ax
        mov [filehandle],bx

filelength:
        mov ah,042h
        mov cx,0h
        mov dx,0h
        mov al,002h
        mov bx,[filehandle]
        int 21h
        
        shr ax,7
        shl dx,9
        or ax,dx
        mov bx,ax
        mov [filediv128],bx
  
        mov dl, bh
        mov ah, 02h
        int 21h
        mov dl, bl
        mov ah, 02h
        int 21h
      
        mov bx,[filediv128]
        mov cx,bx

loopread:
        push cx
        mov cx, 080h
        mov bx,[readin]
        mov dx,bx
        mov bx,[filehandle]
        mov ah,03fh
        int 21h
        


        
       ; mov cx,80h
        mov bx,24h
        mov [readin +129],bx
        

prints:
        mov ah,09h
        mov bx,[readin]
        mov dx,bx
        int 21h

        


endit:
        mov ah, 00h
        int 21h

section .data
        sendfile: db "C:\shit\file.txt",0h


section .bss
        filehandle: resb 2
        filediv128: resb 2
        readin: resb 129

we are trying to read in 129 bytes to a buffer (readin) and print it to the screen but it is completely not working can anyone please help