Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class main {
  4.     public static void main(String[] args) {
  5.         try {
  6.             File w = new File("C:\\Tasm 1.4\\Tasm\\riven.asm");
  7.             FileWriter out = new FileWriter(w);
  8.             FileReader fr = new FileReader("C:\\Users\\Iman\\Desktop\\riven.txt");
  9.             out.write(".model small \n");
  10.             out.write(".code\n");
  11.             out.write("org 100h\n");
  12.             out.write("s: \n");
  13.             int i = 0;
  14.             int line = 0, col = 0;
  15.             while ((i = fr.read()) != -1) {
  16.                 char a = (char) i;
  17.                 if (!Character.isSpace(a)) {
  18.                     System.out.print(a);
  19.                     out.write("mov ah,02\n");
  20.                     out.write("mov dh," + line + "\n");
  21.                     out.write("mov dl," + col + "\n");
  22.                     out.write("int 10h\n");
  23.                     out.write("mov ah,09\n");
  24.                     out.write("mov al,'" + a + "' \n");
  25.                     out.write("mov bh,00\n");
  26.                     out.write("mov bl,0Fh\n");
  27.                     out.write("mov cx,1\n");
  28.                     out.write("int 10h\n");
  29.                     out.write("\n");
  30.                 }
  31.                 col++;
  32.                 if (a == '\n') {
  33.                     col = 0;
  34.                     line++;
  35.                 }
  36.             }
  37.             out.write("int 20h\n");
  38.             out.write("end s \n");
  39.             fr.close();
  40.             out.close();
  41.         } catch (Exception e) {
  42.             e.getMessage();
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement